diff options
Diffstat (limited to 'ANDROID_3.4.5/arch/arm/include/asm')
-rw-r--r-- | ANDROID_3.4.5/arch/arm/include/asm/assembler.h | 8 | ||||
-rw-r--r-- | ANDROID_3.4.5/arch/arm/include/asm/hardirq.h | 4 | ||||
-rwxr-xr-x | ANDROID_3.4.5/arch/arm/include/asm/mach/version.h | 1 | ||||
-rw-r--r-- | ANDROID_3.4.5/arch/arm/include/asm/memory.h | 1 | ||||
-rw-r--r-- | ANDROID_3.4.5/arch/arm/include/asm/smp.h | 6 | ||||
-rw-r--r-- | ANDROID_3.4.5/arch/arm/include/asm/system_misc.h | 2 | ||||
-rw-r--r-- | ANDROID_3.4.5/arch/arm/include/asm/uaccess.h | 186 |
7 files changed, 207 insertions, 1 deletions
diff --git a/ANDROID_3.4.5/arch/arm/include/asm/assembler.h b/ANDROID_3.4.5/arch/arm/include/asm/assembler.h index 03fb9362..5c8b3bf4 100644 --- a/ANDROID_3.4.5/arch/arm/include/asm/assembler.h +++ b/ANDROID_3.4.5/arch/arm/include/asm/assembler.h @@ -320,4 +320,12 @@ .size \name , . - \name .endm + .macro check_uaccess, addr:req, size:req, limit:req, tmp:req, bad:req +#ifndef CONFIG_CPU_USE_DOMAINS + adds \tmp, \addr, #\size - 1 + sbcccs \tmp, \tmp, \limit + bcs \bad +#endif + .endm + #endif /* __ASM_ASSEMBLER_H__ */ diff --git a/ANDROID_3.4.5/arch/arm/include/asm/hardirq.h b/ANDROID_3.4.5/arch/arm/include/asm/hardirq.h index 2740c2a2..6f45e085 100644 --- a/ANDROID_3.4.5/arch/arm/include/asm/hardirq.h +++ b/ANDROID_3.4.5/arch/arm/include/asm/hardirq.h @@ -5,7 +5,11 @@ #include <linux/threads.h> #include <asm/irq.h> +#ifdef CONFIG_OTZONE_ASYNC_NOTIFY_SUPPORT +#define NR_IPI 7 +#else #define NR_IPI 6 +#endif typedef struct { unsigned int __softirq_pending; diff --git a/ANDROID_3.4.5/arch/arm/include/asm/mach/version.h b/ANDROID_3.4.5/arch/arm/include/asm/mach/version.h new file mode 100755 index 00000000..2616dcfb --- /dev/null +++ b/ANDROID_3.4.5/arch/arm/include/asm/mach/version.h @@ -0,0 +1 @@ +#define CONFIG_KERNEL_VERSION "0.26.00.00" diff --git a/ANDROID_3.4.5/arch/arm/include/asm/memory.h b/ANDROID_3.4.5/arch/arm/include/asm/memory.h index fcb57574..8fb66dc9 100644 --- a/ANDROID_3.4.5/arch/arm/include/asm/memory.h +++ b/ANDROID_3.4.5/arch/arm/include/asm/memory.h @@ -227,6 +227,7 @@ static inline void *phys_to_virt(phys_addr_t x) */ #define __pa(x) __virt_to_phys((unsigned long)(x)) #define __va(x) ((void *)__phys_to_virt((unsigned long)(x))) +#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0))/*add by roger*/ #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) /* diff --git a/ANDROID_3.4.5/arch/arm/include/asm/smp.h b/ANDROID_3.4.5/arch/arm/include/asm/smp.h index 7f74b59f..4008d69e 100644 --- a/ANDROID_3.4.5/arch/arm/include/asm/smp.h +++ b/ANDROID_3.4.5/arch/arm/include/asm/smp.h @@ -95,4 +95,10 @@ extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); extern void smp_send_all_cpu_backtrace(void); +#ifdef CONFIG_OTZONE_ASYNC_NOTIFY_SUPPORT +typedef void (ipi_secure_notify_handler)(struct pt_regs *regs); +int register_secure_notify_handler(ipi_secure_notify_handler handler); +int unregister_secure_notify_handler(void); +#endif + #endif /* ifndef __ASM_ARM_SMP_H */ diff --git a/ANDROID_3.4.5/arch/arm/include/asm/system_misc.h b/ANDROID_3.4.5/arch/arm/include/asm/system_misc.h index 5a85f148..aaa6df1a 100644 --- a/ANDROID_3.4.5/arch/arm/include/asm/system_misc.h +++ b/ANDROID_3.4.5/arch/arm/include/asm/system_misc.h @@ -8,7 +8,7 @@ #include <linux/irqflags.h> extern void cpu_init(void); - +void soft_restart_noirq(unsigned long);/*add by roger*/ void soft_restart(unsigned long); extern void (*arm_pm_restart)(char str, const char *cmd); extern void (*arm_pm_idle)(void); diff --git a/ANDROID_3.4.5/arch/arm/include/asm/uaccess.h b/ANDROID_3.4.5/arch/arm/include/asm/uaccess.h index 71f6536d..3b43e80e 100644 --- a/ANDROID_3.4.5/arch/arm/include/asm/uaccess.h +++ b/ANDROID_3.4.5/arch/arm/include/asm/uaccess.h @@ -101,6 +101,8 @@ extern int __get_user_1(void *); extern int __get_user_2(void *); extern int __get_user_4(void *); +// YJChen, 20131230, patch start for CTS android.security#testVroot +#if 0 #define __get_user_x(__r2,__p,__e,__s,__i...) \ __asm__ __volatile__ ( \ __asmeq("%0", "r0") __asmeq("%1", "r2") \ @@ -130,11 +132,89 @@ extern int __get_user_4(void *); __e; \ }) +#else + +#define __GUP_CLOBBER_1 "lr", "cc" +#ifdef CONFIG_CPU_USE_DOMAINS +#define __GUP_CLOBBER_2 "ip", "lr", "cc" +#else +#define __GUP_CLOBBER_2 "lr", "cc" +#endif +#define __GUP_CLOBBER_4 "lr", "cc" + +#define __get_user_x(__r2,__p,__e,__l,__s) \ + __asm__ __volatile__ ( \ + __asmeq("%0", "r0") __asmeq("%1", "r2") \ + __asmeq("%3", "r1") \ + "bl __get_user_" #__s \ + : "=&r" (__e), "=r" (__r2) \ + : "0" (__p), "r" (__l) \ + : __GUP_CLOBBER_##__s) + +#if 0 +#define get_user(x,p) \ +({ \ + unsigned long __limit = current_thread_info()->addr_limit - 1; \ + register const typeof(*(p)) __user *__p asm("r0") = (p); \ + register unsigned long __r2 asm("r2"); \ + register unsigned long __l asm("r1") = __limit; \ + register int __e asm("r0"); \ + switch (sizeof(*(__p))) { \ + case 1: \ + __get_user_x(__r2, __p, __e, __l, 1); \ + break; \ + case 2: \ + __get_user_x(__r2, __p, __e, __l, 2); \ + break; \ + case 4: \ + __get_user_x(__r2, __p, __e, __l, 4); \ + break; \ + default: __e = __get_user_bad(); break; \ + } \ + x = (typeof(*(p))) __r2; \ + __e; \ +}) +#else +#define __get_user_check(x,p) \ + ({ \ + unsigned long __limit = current_thread_info()->addr_limit - 1; \ + register const typeof(*(p)) __user *__p asm("r0") = (p);\ + register unsigned long __r2 asm("r2"); \ + register unsigned long __l asm("r1") = __limit; \ + register int __e asm("r0"); \ + switch (sizeof(*(__p))) { \ + case 1: \ + __get_user_x(__r2, __p, __e, __l, 1); \ + break; \ + case 2: \ + __get_user_x(__r2, __p, __e, __l, 2); \ + break; \ + case 4: \ + __get_user_x(__r2, __p, __e, __l, 4); \ + break; \ + default: __e = __get_user_bad(); break; \ + } \ + x = (typeof(*(p))) __r2; \ + __e; \ + }) + +#define get_user(x,p) \ + ({ \ + might_fault(); \ + __get_user_check(x,p); \ + }) +#endif + +#endif +// YJChen, 20131230, patch end for CTS android.security#testVroot + extern int __put_user_1(void *, unsigned int); extern int __put_user_2(void *, unsigned int); extern int __put_user_4(void *, unsigned int); extern int __put_user_8(void *, unsigned long long); +// YJChen, 20131230, patch start for CTS android.security#testVroot +#if 0 #define __put_user_x(__r2,__p,__e,__s) \ __asm__ __volatile__ ( \ __asmeq("%0", "r0") __asmeq("%2", "r2") \ @@ -166,6 +246,112 @@ extern int __put_user_8(void *, unsigned long long); __e; \ }) +#else + +#define __put_user_x(__r2,__p,__e,__l,__s) \ + __asm__ __volatile__ ( \ + __asmeq("%0", "r0") __asmeq("%2", "r2") \ + __asmeq("%3", "r1") \ + "bl __put_user_" #__s \ + : "=&r" (__e) \ + : "0" (__p), "r" (__r2), "r" (__l) \ + : "ip", "lr", "cc") + +#if 0 + #if 1 +#define put_user(x,p) \ +({ \ + unsigned long __limit = current_thread_info()->addr_limit - 1; \ + register const typeof(*(p)) __r2 asm("r2") = (x); \ + register const typeof(*(p)) __user *__p asm("r0") = (p); \ + register unsigned long __l asm("r1") = __limit; \ + register int __e asm("r0"); \ + switch (sizeof(*(__p))) { \ + case 1: \ + __put_user_x(__r2, __p, __e, __l, 1); \ + break; \ + case 2: \ + __put_user_x(__r2, __p, __e, __l, 2); \ + break; \ + case 4: \ + __put_user_x(__r2, __p, __e, __l, 4); \ + break; \ + case 8: \ + __put_user_x(__r2, __p, __e, __l, 8); \ + break; \ + default: __e = __put_user_bad(); break; \ + } \ + __e; \ +}) + #else +#define put_user(x,p) \ +({ \ + unsigned long __limit = current_thread_info()->addr_limit - 1; \ + register const typeof(*(p)) __r2 asm("r2") = (x); \ + register const typeof(*(p)) __user *__p asm("r0") = (p); \ + register unsigned long __l asm("r1") = __limit; \ + register int __e asm("r0"); \ + switch (sizeof(*(__p))) { \ + case 1: \ + if ((unsigned long)p+1 > __limit) \ + dump_stack(); \ + __put_user_x(__r2, __p, __e, __l, 1); \ + break; \ + case 2: \ + if ((unsigned long)p+2 > __limit) \ + dump_stack(); \ + __put_user_x(__r2, __p, __e, __l, 2); \ + break; \ + case 4: \ + if ((unsigned long)p+4 > __limit) \ + dump_stack(); \ + __put_user_x(__r2, __p, __e, __l, 4); \ + break; \ + case 8: \ + if ((unsigned long)p+8 > __limit) \ + dump_stack(); \ + __put_user_x(__r2, __p, __e, __l, 8); \ + break; \ + default: __e = __put_user_bad(); break; \ + } \ + __e; \ +}) + #endif +#else +#define __put_user_check(x,p) \ + ({ \ + unsigned long __limit = current_thread_info()->addr_limit - 1; \ + register const typeof(*(p)) __r2 asm("r2") = (x); \ + register const typeof(*(p)) __user *__p asm("r0") = (p);\ + register unsigned long __l asm("r1") = __limit; \ + register int __e asm("r0"); \ + switch (sizeof(*(__p))) { \ + case 1: \ + __put_user_x(__r2, __p, __e, __l, 1); \ + break; \ + case 2: \ + __put_user_x(__r2, __p, __e, __l, 2); \ + break; \ + case 4: \ + __put_user_x(__r2, __p, __e, __l, 4); \ + break; \ + case 8: \ + __put_user_x(__r2, __p, __e, __l, 8); \ + break; \ + default: __e = __put_user_bad(); break; \ + } \ + __e; \ + }) + +#define put_user(x,p) \ + ({ \ + might_fault(); \ + __put_user_check(x,p); \ + }) +#endif + +#endif +// YJChen, 20131230, patch end for CTS android.security#testVroot #else /* CONFIG_MMU */ /* |