swtch64.S (223485) | swtch64.S (230400) |
---|---|
1/* $FreeBSD: head/sys/powerpc/aim/swtch64.S 223485 2011-06-23 22:21:28Z nwhitehorn $ */ | 1/* $FreeBSD: head/sys/powerpc/aim/swtch64.S 230400 2012-01-20 22:34:19Z andreast $ */ |
2/* $NetBSD: locore.S,v 1.24 2000/05/31 05:09:17 thorpej Exp $ */ 3 4/*- 5 * Copyright (C) 2001 Benno Rice 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 53 unchanged lines hidden (view full) --- 63 64#include <machine/trap.h> 65#include <machine/param.h> 66#include <machine/asm.h> 67 68/* 69 * void cpu_throw(struct thread *old, struct thread *new) 70 */ | 2/* $NetBSD: locore.S,v 1.24 2000/05/31 05:09:17 thorpej Exp $ */ 3 4/*- 5 * Copyright (C) 2001 Benno Rice 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 53 unchanged lines hidden (view full) --- 63 64#include <machine/trap.h> 65#include <machine/param.h> 66#include <machine/asm.h> 67 68/* 69 * void cpu_throw(struct thread *old, struct thread *new) 70 */ |
71ENTRY(cpu_throw) | 71ENTRY_NOPROF(cpu_throw) |
72 mr %r13, %r4 73 b cpu_switchin 74 75/* 76 * void cpu_switch(struct thread *old, 77 * struct thread *new, 78 * struct mutex *mtx); 79 * 80 * Switch to a new thread saving the current state in the old thread. 81 */ | 72 mr %r13, %r4 73 b cpu_switchin 74 75/* 76 * void cpu_switch(struct thread *old, 77 * struct thread *new, 78 * struct mutex *mtx); 79 * 80 * Switch to a new thread saving the current state in the old thread. 81 */ |
82ENTRY(cpu_switch) | 82ENTRY_NOPROF(cpu_switch) |
83 ld %r6,TD_PCB(%r3) /* Get the old thread's PCB ptr */ 84 std %r12,PCB_CONTEXT(%r6) /* Save the non-volatile GP regs. 85 These can now be used for scratch */ 86 std %r14,PCB_CONTEXT+2*8(%r6) 87 std %r15,PCB_CONTEXT+3*8(%r6) 88 std %r16,PCB_CONTEXT+4*8(%r6) 89 std %r17,PCB_CONTEXT+5*8(%r6) 90 std %r18,PCB_CONTEXT+6*8(%r6) --- 141 unchanged lines hidden (view full) --- 232 */ 233 stdcx. %r1, 0, %r3 234 blr 235 236/* 237 * savectx(pcb) 238 * Update pcb, saving current processor state 239 */ | 83 ld %r6,TD_PCB(%r3) /* Get the old thread's PCB ptr */ 84 std %r12,PCB_CONTEXT(%r6) /* Save the non-volatile GP regs. 85 These can now be used for scratch */ 86 std %r14,PCB_CONTEXT+2*8(%r6) 87 std %r15,PCB_CONTEXT+3*8(%r6) 88 std %r16,PCB_CONTEXT+4*8(%r6) 89 std %r17,PCB_CONTEXT+5*8(%r6) 90 std %r18,PCB_CONTEXT+6*8(%r6) --- 141 unchanged lines hidden (view full) --- 232 */ 233 stdcx. %r1, 0, %r3 234 blr 235 236/* 237 * savectx(pcb) 238 * Update pcb, saving current processor state 239 */ |
240ENTRY(savectx) | 240ENTRY_NOPROF(savectx) |
241 std %r12,PCB_CONTEXT(%r3) /* Save the non-volatile GP regs. */ 242 std %r13,PCB_CONTEXT+1*8(%r3) 243 std %r14,PCB_CONTEXT+2*8(%r3) 244 std %r15,PCB_CONTEXT+3*8(%r3) 245 std %r16,PCB_CONTEXT+4*8(%r3) 246 std %r17,PCB_CONTEXT+5*8(%r3) 247 std %r18,PCB_CONTEXT+6*8(%r3) 248 std %r19,PCB_CONTEXT+7*8(%r3) --- 14 unchanged lines hidden (view full) --- 263 std %r4,PCB_CR(%r3) 264 std %r2,PCB_TOC(%r3) /* Save the TOC pointer */ 265 blr 266 267/* 268 * fork_trampoline() 269 * Set up the return from cpu_fork() 270 */ | 241 std %r12,PCB_CONTEXT(%r3) /* Save the non-volatile GP regs. */ 242 std %r13,PCB_CONTEXT+1*8(%r3) 243 std %r14,PCB_CONTEXT+2*8(%r3) 244 std %r15,PCB_CONTEXT+3*8(%r3) 245 std %r16,PCB_CONTEXT+4*8(%r3) 246 std %r17,PCB_CONTEXT+5*8(%r3) 247 std %r18,PCB_CONTEXT+6*8(%r3) 248 std %r19,PCB_CONTEXT+7*8(%r3) --- 14 unchanged lines hidden (view full) --- 263 std %r4,PCB_CR(%r3) 264 std %r2,PCB_TOC(%r3) /* Save the TOC pointer */ 265 blr 266 267/* 268 * fork_trampoline() 269 * Set up the return from cpu_fork() 270 */ |
271ENTRY(fork_trampoline) | 271 272ENTRY_NOPROF(fork_trampoline) |
272 ld %r3,CF_FUNC(%r1) 273 ld %r4,CF_ARG0(%r1) 274 ld %r5,CF_ARG1(%r1) 275 276 stdu %r1,-48(%r1) 277 bl fork_exit 278 nop 279 addi %r1,%r1,48+CF_SIZE-FSP /* Allow 8 bytes in front of 280 trapframe to simulate FRAME_SETUP 281 does when allocating space for 282 a frame pointer/saved LR */ 283 b trapexit 284 nop | 273 ld %r3,CF_FUNC(%r1) 274 ld %r4,CF_ARG0(%r1) 275 ld %r5,CF_ARG1(%r1) 276 277 stdu %r1,-48(%r1) 278 bl fork_exit 279 nop 280 addi %r1,%r1,48+CF_SIZE-FSP /* Allow 8 bytes in front of 281 trapframe to simulate FRAME_SETUP 282 does when allocating space for 283 a frame pointer/saved LR */ 284 b trapexit 285 nop |