diff options
Diffstat (limited to 'arch/um/kernel')
-rw-r--r-- | arch/um/kernel/trap_kern.c | 27 | ||||
-rw-r--r-- | arch/um/kernel/trap_user.c | 21 |
2 files changed, 0 insertions, 48 deletions
diff --git a/arch/um/kernel/trap_kern.c b/arch/um/kernel/trap_kern.c index c20aef120598..bef8abd5ea9e 100644 --- a/arch/um/kernel/trap_kern.c +++ b/arch/um/kernel/trap_kern.c | |||
@@ -200,30 +200,3 @@ void winch(int sig, union uml_pt_regs *regs) | |||
200 | void trap_init(void) | 200 | void trap_init(void) |
201 | { | 201 | { |
202 | } | 202 | } |
203 | |||
204 | DEFINE_SPINLOCK(trap_lock); | ||
205 | |||
206 | static int trap_index = 0; | ||
207 | |||
208 | int next_trap_index(int limit) | ||
209 | { | ||
210 | int ret; | ||
211 | |||
212 | spin_lock(&trap_lock); | ||
213 | ret = trap_index; | ||
214 | if(++trap_index == limit) | ||
215 | trap_index = 0; | ||
216 | spin_unlock(&trap_lock); | ||
217 | return(ret); | ||
218 | } | ||
219 | |||
220 | /* | ||
221 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
222 | * Emacs will notice this stuff at the end of the file and automatically | ||
223 | * adjust the settings for this buffer only. This must remain at the end | ||
224 | * of the file. | ||
225 | * --------------------------------------------------------------------------- | ||
226 | * Local variables: | ||
227 | * c-file-style: "linux" | ||
228 | * End: | ||
229 | */ | ||
diff --git a/arch/um/kernel/trap_user.c b/arch/um/kernel/trap_user.c index f825a6eda3f5..e9ccd6b8d3c7 100644 --- a/arch/um/kernel/trap_user.c +++ b/arch/um/kernel/trap_user.c | |||
@@ -40,35 +40,14 @@ void kill_child_dead(int pid) | |||
40 | } while(1); | 40 | } while(1); |
41 | } | 41 | } |
42 | 42 | ||
43 | /* Unlocked - don't care if this is a bit off */ | ||
44 | int nsegfaults = 0; | ||
45 | |||
46 | struct { | ||
47 | unsigned long address; | ||
48 | int is_write; | ||
49 | int pid; | ||
50 | unsigned long sp; | ||
51 | int is_user; | ||
52 | } segfault_record[1024]; | ||
53 | |||
54 | void segv_handler(int sig, union uml_pt_regs *regs) | 43 | void segv_handler(int sig, union uml_pt_regs *regs) |
55 | { | 44 | { |
56 | int index, max; | ||
57 | struct faultinfo * fi = UPT_FAULTINFO(regs); | 45 | struct faultinfo * fi = UPT_FAULTINFO(regs); |
58 | 46 | ||
59 | if(UPT_IS_USER(regs) && !SEGV_IS_FIXABLE(fi)){ | 47 | if(UPT_IS_USER(regs) && !SEGV_IS_FIXABLE(fi)){ |
60 | bad_segv(*fi, UPT_IP(regs)); | 48 | bad_segv(*fi, UPT_IP(regs)); |
61 | return; | 49 | return; |
62 | } | 50 | } |
63 | max = sizeof(segfault_record)/sizeof(segfault_record[0]); | ||
64 | index = next_trap_index(max); | ||
65 | |||
66 | nsegfaults++; | ||
67 | segfault_record[index].address = FAULT_ADDRESS(*fi); | ||
68 | segfault_record[index].pid = os_getpid(); | ||
69 | segfault_record[index].is_write = FAULT_WRITE(*fi); | ||
70 | segfault_record[index].sp = UPT_SP(regs); | ||
71 | segfault_record[index].is_user = UPT_IS_USER(regs); | ||
72 | segv(*fi, UPT_IP(regs), UPT_IS_USER(regs), regs); | 51 | segv(*fi, UPT_IP(regs), UPT_IS_USER(regs), regs); |
73 | } | 52 | } |
74 | 53 | ||