File tree Expand file tree Collapse file tree 3 files changed +5
-10
lines changed Expand file tree Collapse file tree 3 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ void foo(void)
31
31
DEFINE (TASK_TGID , offsetof(struct task_struct , tgid ));
32
32
BLANK ();
33
33
34
+ DEFINE (SIZEOF_PT_REGS , sizeof (struct pt_regs ));
34
35
DEFINE (PT_PTRACED , PT_PTRACED );
35
36
DEFINE (CLONE_VM , CLONE_VM );
36
37
DEFINE (CLONE_UNTRACED , CLONE_UNTRACED );
Original file line number Diff line number Diff line change 9
9
10
10
#include <linux/config.h>
11
11
#include <asm/system.h>
12
+ #include <asm/asm_offsets.h>
12
13
13
14
.globl swapper_pg_dir
14
15
.globl _stext
@@ -25,7 +26,7 @@ __start:
25
26
/* We need to get current_task_info loaded up... */
26
27
lda $8 ,init_thread_union
27
28
/* ... and find our stack ... */
28
- lda $30 ,0x4000 ($8 )
29
+ lda $30 ,0x4000 - SIZEOF_PT_REGS ($8 )
29
30
/* ... and then we can start the kernel. */
30
31
jsr $26 ,start_kernel
31
32
call_pal PAL_halt
Original file line number Diff line number Diff line change @@ -71,15 +71,8 @@ struct switch_stack {
71
71
#define instruction_pointer (regs ) ((regs)->pc)
72
72
extern void show_regs (struct pt_regs * );
73
73
74
- /*
75
- * TODO: if kernel-only threads do not have a dummy pt_regs structure at the
76
- * top of the stack, this would cause kernel stack corruption. Either check
77
- * first that we're not dealing with a kernel thread or change the kernel
78
- * stacks to allocate a dummy pt_regs structure.
79
- */
80
-
81
- #define alpha_task_regs (task ) ((struct pt_regs *) \
82
- ((long) task->thread_info + PAGE_SIZE) - 1)
74
+ #define alpha_task_regs (task ) \
75
+ ((struct pt_regs *) ((long) (task)->thread_info + 2*PAGE_SIZE) - 1)
83
76
84
77
#define force_successful_syscall_return () (alpha_task_regs(current)->r0 = 0)
85
78
You can’t perform that action at this time.
0 commit comments