process.c (f4091322d7397c8eb85c071570cab0e82ee3e261) | process.c (39d91a9eafec7524482e70af76ccbe803dce5b8e) |
---|---|
1/* 2 * OpenRISC process.c 3 * 4 * Linux architectural port borrowing liberally from similar works of 5 * others. All original copyrights apply as per the original source 6 * declaration. 7 * 8 * Modifications for the OpenRISC architecture: --- 154 unchanged lines hidden (view full) --- 163 sp -= sizeof(struct pt_regs); 164 kregs = (struct pt_regs *)sp; 165 166 if (unlikely(p->flags & PF_KTHREAD)) { 167 memset(kregs, 0, sizeof(struct pt_regs)); 168 kregs->gpr[20] = usp; /* fn, kernel thread */ 169 kregs->gpr[22] = arg; 170 } else { | 1/* 2 * OpenRISC process.c 3 * 4 * Linux architectural port borrowing liberally from similar works of 5 * others. All original copyrights apply as per the original source 6 * declaration. 7 * 8 * Modifications for the OpenRISC architecture: --- 154 unchanged lines hidden (view full) --- 163 sp -= sizeof(struct pt_regs); 164 kregs = (struct pt_regs *)sp; 165 166 if (unlikely(p->flags & PF_KTHREAD)) { 167 memset(kregs, 0, sizeof(struct pt_regs)); 168 kregs->gpr[20] = usp; /* fn, kernel thread */ 169 kregs->gpr[22] = arg; 170 } else { |
171 *userregs = *regs; | 171 *userregs = *current_pt_regs(); |
172 | 172 |
173 userregs->sp = usp; | 173 if (usp) 174 userregs->sp = usp; |
174 userregs->gpr[11] = 0; /* Result from fork() */ 175 176 kregs->gpr[20] = 0; /* Userspace thread */ 177 } 178 179 /* 180 * _switch wants the kernel stack page in pt_regs->sp so that it 181 * can restore it to thread_info->ksp... see _switch for details. --- 78 unchanged lines hidden --- | 175 userregs->gpr[11] = 0; /* Result from fork() */ 176 177 kregs->gpr[20] = 0; /* Userspace thread */ 178 } 179 180 /* 181 * _switch wants the kernel stack page in pt_regs->sp so that it 182 * can restore it to thread_info->ksp... see _switch for details. --- 78 unchanged lines hidden --- |