diff options
Diffstat (limited to 'arch/um')
| -rw-r--r-- | arch/um/Makefile-i386 | 4 | ||||
| -rw-r--r-- | arch/um/include/kern_util.h | 13 | ||||
| -rw-r--r-- | arch/um/kernel/time_kern.c | 10 | ||||
| -rw-r--r-- | arch/um/os-Linux/main.c | 2 | ||||
| -rw-r--r-- | arch/um/os-Linux/time.c | 10 | ||||
| -rw-r--r-- | arch/um/sys-i386/syscalls.c | 9 | ||||
| -rw-r--r-- | arch/um/sys-x86_64/signal.c | 24 | ||||
| -rw-r--r-- | arch/um/sys-x86_64/syscalls.c | 2 |
8 files changed, 38 insertions, 36 deletions
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386 index 7a0e04e34bf9..b65ca115ef77 100644 --- a/arch/um/Makefile-i386 +++ b/arch/um/Makefile-i386 | |||
| @@ -33,5 +33,9 @@ include $(srctree)/arch/i386/Makefile.cpu | |||
| 33 | # prevent gcc from keeping the stack 16 byte aligned. Taken from i386. | 33 | # prevent gcc from keeping the stack 16 byte aligned. Taken from i386. |
| 34 | cflags-y += $(call cc-option,-mpreferred-stack-boundary=2) | 34 | cflags-y += $(call cc-option,-mpreferred-stack-boundary=2) |
| 35 | 35 | ||
| 36 | # Prevent sprintf in nfsd from being converted to strcpy and resulting in | ||
| 37 | # an unresolved reference. | ||
| 38 | cflags-y += -ffreestanding | ||
| 39 | |||
| 36 | CFLAGS += $(cflags-y) | 40 | CFLAGS += $(cflags-y) |
| 37 | USER_CFLAGS += $(cflags-y) | 41 | USER_CFLAGS += $(cflags-y) |
diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h index efa3d33c0be6..310980b32173 100644 --- a/arch/um/include/kern_util.h +++ b/arch/um/include/kern_util.h | |||
| @@ -120,20 +120,11 @@ extern int is_syscall(unsigned long addr); | |||
| 120 | extern void free_irq(unsigned int, void *); | 120 | extern void free_irq(unsigned int, void *); |
| 121 | extern int cpu(void); | 121 | extern int cpu(void); |
| 122 | 122 | ||
| 123 | extern void time_init_kern(void); | ||
| 124 | |||
| 123 | /* Are we disallowed to sleep? Used to choose between GFP_KERNEL and GFP_ATOMIC. */ | 125 | /* Are we disallowed to sleep? Used to choose between GFP_KERNEL and GFP_ATOMIC. */ |
| 124 | extern int __cant_sleep(void); | 126 | extern int __cant_sleep(void); |
| 125 | extern void segv_handler(int sig, union uml_pt_regs *regs); | 127 | extern void segv_handler(int sig, union uml_pt_regs *regs); |
| 126 | extern void sigio_handler(int sig, union uml_pt_regs *regs); | 128 | extern void sigio_handler(int sig, union uml_pt_regs *regs); |
| 127 | 129 | ||
| 128 | #endif | 130 | #endif |
| 129 | |||
| 130 | /* | ||
| 131 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
| 132 | * Emacs will notice this stuff at the end of the file and automatically | ||
| 133 | * adjust the settings for this buffer only. This must remain at the end | ||
| 134 | * of the file. | ||
| 135 | * --------------------------------------------------------------------------- | ||
| 136 | * Local variables: | ||
| 137 | * c-file-style: "linux" | ||
| 138 | * End: | ||
| 139 | */ | ||
diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c index 528cf623f8b4..86f51d04c98d 100644 --- a/arch/um/kernel/time_kern.c +++ b/arch/um/kernel/time_kern.c | |||
| @@ -84,6 +84,16 @@ void timer_irq(union uml_pt_regs *regs) | |||
| 84 | } | 84 | } |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | |||
| 88 | void time_init_kern(void) | ||
| 89 | { | ||
| 90 | unsigned long long nsecs; | ||
| 91 | |||
| 92 | nsecs = os_nsecs(); | ||
| 93 | set_normalized_timespec(&wall_to_monotonic, -nsecs / BILLION, | ||
| 94 | -nsecs % BILLION); | ||
| 95 | } | ||
| 96 | |||
| 87 | void do_boot_timer_handler(struct sigcontext * sc) | 97 | void do_boot_timer_handler(struct sigcontext * sc) |
| 88 | { | 98 | { |
| 89 | struct pt_regs regs; | 99 | struct pt_regs regs; |
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index 3a0ac38e978b..90912aaca7aa 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c | |||
| @@ -59,7 +59,7 @@ static __init void do_uml_initcalls(void) | |||
| 59 | initcall_t *call; | 59 | initcall_t *call; |
| 60 | 60 | ||
| 61 | call = &__uml_initcall_start; | 61 | call = &__uml_initcall_start; |
| 62 | while (call < &__uml_initcall_end){; | 62 | while (call < &__uml_initcall_end){ |
| 63 | (*call)(); | 63 | (*call)(); |
| 64 | call++; | 64 | call++; |
| 65 | } | 65 | } |
diff --git a/arch/um/os-Linux/time.c b/arch/um/os-Linux/time.c index 6f7626775acb..280c4fb9b585 100644 --- a/arch/um/os-Linux/time.c +++ b/arch/um/os-Linux/time.c | |||
| @@ -81,20 +81,12 @@ void uml_idle_timer(void) | |||
| 81 | set_interval(ITIMER_REAL); | 81 | set_interval(ITIMER_REAL); |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | extern void ktime_get_ts(struct timespec *ts); | ||
| 85 | #define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) | ||
| 86 | |||
| 87 | void time_init(void) | 84 | void time_init(void) |
| 88 | { | 85 | { |
| 89 | struct timespec now; | ||
| 90 | |||
| 91 | if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR) | 86 | if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR) |
| 92 | panic("Couldn't set SIGVTALRM handler"); | 87 | panic("Couldn't set SIGVTALRM handler"); |
| 93 | set_interval(ITIMER_VIRTUAL); | 88 | set_interval(ITIMER_VIRTUAL); |
| 94 | 89 | time_init_kern(); | |
| 95 | do_posix_clock_monotonic_gettime(&now); | ||
| 96 | wall_to_monotonic.tv_sec = -now.tv_sec; | ||
| 97 | wall_to_monotonic.tv_nsec = -now.tv_nsec; | ||
| 98 | } | 90 | } |
| 99 | 91 | ||
| 100 | unsigned long long os_nsecs(void) | 92 | unsigned long long os_nsecs(void) |
diff --git a/arch/um/sys-i386/syscalls.c b/arch/um/sys-i386/syscalls.c index 749dd1bfe60f..710d5fb807e1 100644 --- a/arch/um/sys-i386/syscalls.c +++ b/arch/um/sys-i386/syscalls.c | |||
| @@ -99,11 +99,12 @@ long sys_ipc (uint call, int first, int second, | |||
| 99 | 99 | ||
| 100 | switch (call) { | 100 | switch (call) { |
| 101 | case SEMOP: | 101 | case SEMOP: |
| 102 | return sys_semtimedop(first, (struct sembuf *) ptr, second, | 102 | return sys_semtimedop(first, (struct sembuf __user *) ptr, |
| 103 | NULL); | 103 | second, NULL); |
| 104 | case SEMTIMEDOP: | 104 | case SEMTIMEDOP: |
| 105 | return sys_semtimedop(first, (struct sembuf *) ptr, second, | 105 | return sys_semtimedop(first, (struct sembuf __user *) ptr, |
| 106 | (const struct timespec *) fifth); | 106 | second, |
| 107 | (const struct timespec __user *) fifth); | ||
| 107 | case SEMGET: | 108 | case SEMGET: |
| 108 | return sys_semget (first, second, third); | 109 | return sys_semget (first, second, third); |
| 109 | case SEMCTL: { | 110 | case SEMCTL: { |
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c index a4c46a8af008..9edf114faf79 100644 --- a/arch/um/sys-x86_64/signal.c +++ b/arch/um/sys-x86_64/signal.c | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | #include "skas.h" | 21 | #include "skas.h" |
| 22 | 22 | ||
| 23 | static int copy_sc_from_user_skas(struct pt_regs *regs, | 23 | static int copy_sc_from_user_skas(struct pt_regs *regs, |
| 24 | struct sigcontext *from) | 24 | struct sigcontext __user *from) |
| 25 | { | 25 | { |
| 26 | int err = 0; | 26 | int err = 0; |
| 27 | 27 | ||
| @@ -54,7 +54,8 @@ static int copy_sc_from_user_skas(struct pt_regs *regs, | |||
| 54 | return(err); | 54 | return(err); |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp, | 57 | int copy_sc_to_user_skas(struct sigcontext __user *to, |
| 58 | struct _fpstate __user *to_fp, | ||
| 58 | struct pt_regs *regs, unsigned long mask, | 59 | struct pt_regs *regs, unsigned long mask, |
| 59 | unsigned long sp) | 60 | unsigned long sp) |
| 60 | { | 61 | { |
| @@ -106,10 +107,11 @@ int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp, | |||
| 106 | #endif | 107 | #endif |
| 107 | 108 | ||
| 108 | #ifdef CONFIG_MODE_TT | 109 | #ifdef CONFIG_MODE_TT |
| 109 | int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from, | 110 | int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext __user *from, |
| 110 | int fpsize) | 111 | int fpsize) |
| 111 | { | 112 | { |
| 112 | struct _fpstate *to_fp, *from_fp; | 113 | struct _fpstate *to_fp; |
| 114 | struct _fpstate __user *from_fp; | ||
| 113 | unsigned long sigs; | 115 | unsigned long sigs; |
| 114 | int err; | 116 | int err; |
| 115 | 117 | ||
| @@ -124,13 +126,14 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from, | |||
| 124 | return(err); | 126 | return(err); |
| 125 | } | 127 | } |
| 126 | 128 | ||
| 127 | int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp, | 129 | int copy_sc_to_user_tt(struct sigcontext __user *to, struct _fpstate __user *fp, |
| 128 | struct sigcontext *from, int fpsize, unsigned long sp) | 130 | struct sigcontext *from, int fpsize, unsigned long sp) |
| 129 | { | 131 | { |
| 130 | struct _fpstate *to_fp, *from_fp; | 132 | struct _fpstate __user *to_fp; |
| 133 | struct _fpstate *from_fp; | ||
| 131 | int err; | 134 | int err; |
| 132 | 135 | ||
| 133 | to_fp = (fp ? fp : (struct _fpstate *) (to + 1)); | 136 | to_fp = (fp ? fp : (struct _fpstate __user *) (to + 1)); |
| 134 | from_fp = from->fpstate; | 137 | from_fp = from->fpstate; |
| 135 | err = copy_to_user(to, from, sizeof(*to)); | 138 | err = copy_to_user(to, from, sizeof(*to)); |
| 136 | /* The SP in the sigcontext is the updated one for the signal | 139 | /* The SP in the sigcontext is the updated one for the signal |
| @@ -158,7 +161,8 @@ static int copy_sc_from_user(struct pt_regs *to, void __user *from) | |||
| 158 | return(ret); | 161 | return(ret); |
| 159 | } | 162 | } |
| 160 | 163 | ||
| 161 | static int copy_sc_to_user(struct sigcontext *to, struct _fpstate *fp, | 164 | static int copy_sc_to_user(struct sigcontext __user *to, |
| 165 | struct _fpstate __user *fp, | ||
| 162 | struct pt_regs *from, unsigned long mask, | 166 | struct pt_regs *from, unsigned long mask, |
| 163 | unsigned long sp) | 167 | unsigned long sp) |
| 164 | { | 168 | { |
| @@ -169,7 +173,7 @@ static int copy_sc_to_user(struct sigcontext *to, struct _fpstate *fp, | |||
| 169 | 173 | ||
| 170 | struct rt_sigframe | 174 | struct rt_sigframe |
| 171 | { | 175 | { |
| 172 | char *pretcode; | 176 | char __user *pretcode; |
| 173 | struct ucontext uc; | 177 | struct ucontext uc; |
| 174 | struct siginfo info; | 178 | struct siginfo info; |
| 175 | }; | 179 | }; |
| @@ -188,7 +192,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig, | |||
| 188 | 192 | ||
| 189 | frame = (struct rt_sigframe __user *) | 193 | frame = (struct rt_sigframe __user *) |
| 190 | round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; | 194 | round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; |
| 191 | frame = (struct rt_sigframe *) ((unsigned long) frame - 128); | 195 | frame = (struct rt_sigframe __user *) ((unsigned long) frame - 128); |
| 192 | 196 | ||
| 193 | if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) | 197 | if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) |
| 194 | goto out; | 198 | goto out; |
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c index 6acee5c4ada6..6fce9f45dfdc 100644 --- a/arch/um/sys-x86_64/syscalls.c +++ b/arch/um/sys-x86_64/syscalls.c | |||
| @@ -45,7 +45,7 @@ static long arch_prctl_tt(int code, unsigned long addr) | |||
| 45 | case ARCH_GET_GS: | 45 | case ARCH_GET_GS: |
| 46 | ret = arch_prctl(code, (unsigned long) &tmp); | 46 | ret = arch_prctl(code, (unsigned long) &tmp); |
| 47 | if(!ret) | 47 | if(!ret) |
| 48 | ret = put_user(tmp, &addr); | 48 | ret = put_user(tmp, (long __user *)addr); |
| 49 | break; | 49 | break; |
| 50 | default: | 50 | default: |
| 51 | ret = -EINVAL; | 51 | ret = -EINVAL; |
