1414#include <asm/smp.h>
1515#include <asm/tlbflush.h>
1616
17- #define CREATE_TRACE_POINTS
18- #include <asm/trace.h>
19-
2017/* default SBI version is 0.1 */
2118unsigned long sbi_spec_version __ro_after_init = SBI_SPEC_VERSION_DEFAULT ;
2219EXPORT_SYMBOL (sbi_spec_version );
@@ -27,55 +24,6 @@ static int (*__sbi_rfence)(int fid, const struct cpumask *cpu_mask,
2724 unsigned long start , unsigned long size ,
2825 unsigned long arg4 , unsigned long arg5 ) __ro_after_init ;
2926
30- struct sbiret __sbi_ecall (unsigned long arg0 , unsigned long arg1 ,
31- unsigned long arg2 , unsigned long arg3 ,
32- unsigned long arg4 , unsigned long arg5 ,
33- int fid , int ext )
34- {
35- struct sbiret ret ;
36-
37- trace_sbi_call (ext , fid );
38-
39- register uintptr_t a0 asm ("a0" ) = (uintptr_t )(arg0 );
40- register uintptr_t a1 asm ("a1" ) = (uintptr_t )(arg1 );
41- register uintptr_t a2 asm ("a2" ) = (uintptr_t )(arg2 );
42- register uintptr_t a3 asm ("a3" ) = (uintptr_t )(arg3 );
43- register uintptr_t a4 asm ("a4" ) = (uintptr_t )(arg4 );
44- register uintptr_t a5 asm ("a5" ) = (uintptr_t )(arg5 );
45- register uintptr_t a6 asm ("a6" ) = (uintptr_t )(fid );
46- register uintptr_t a7 asm ("a7" ) = (uintptr_t )(ext );
47- asm volatile ("ecall"
48- : "+r" (a0 ), "+r" (a1 )
49- : "r" (a2 ), "r" (a3 ), "r" (a4 ), "r" (a5 ), "r" (a6 ), "r" (a7 )
50- : "memory" );
51- ret .error = a0 ;
52- ret .value = a1 ;
53-
54- trace_sbi_return (ext , ret .error , ret .value );
55-
56- return ret ;
57- }
58- EXPORT_SYMBOL (__sbi_ecall );
59-
60- int sbi_err_map_linux_errno (int err )
61- {
62- switch (err ) {
63- case SBI_SUCCESS :
64- return 0 ;
65- case SBI_ERR_DENIED :
66- return - EPERM ;
67- case SBI_ERR_INVALID_PARAM :
68- return - EINVAL ;
69- case SBI_ERR_INVALID_ADDRESS :
70- return - EFAULT ;
71- case SBI_ERR_NOT_SUPPORTED :
72- case SBI_ERR_FAILURE :
73- default :
74- return - ENOTSUPP ;
75- };
76- }
77- EXPORT_SYMBOL (sbi_err_map_linux_errno );
78-
7927#ifdef CONFIG_RISCV_SBI_V01
8028static unsigned long __sbi_v01_cpumask_to_hartmask (const struct cpumask * cpu_mask )
8129{
@@ -535,17 +483,6 @@ long sbi_probe_extension(int extid)
535483}
536484EXPORT_SYMBOL (sbi_probe_extension );
537485
538- static long __sbi_base_ecall (int fid )
539- {
540- struct sbiret ret ;
541-
542- ret = sbi_ecall (SBI_EXT_BASE , fid , 0 , 0 , 0 , 0 , 0 , 0 );
543- if (!ret .error )
544- return ret .value ;
545- else
546- return sbi_err_map_linux_errno (ret .error );
547- }
548-
549486static inline long sbi_get_spec_version (void )
550487{
551488 return __sbi_base_ecall (SBI_EXT_BASE_GET_SPEC_VERSION );
0 commit comments