| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: locore.s,v 1.346 2013/01/23 12:19:02 martin Exp $ */ | | 1 | /* $NetBSD: locore.s,v 1.347 2013/01/23 21:03:25 martin Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2006-2010 Matthew R. Green | | 4 | * Copyright (c) 2006-2010 Matthew R. Green |
5 | * Copyright (c) 1996-2002 Eduardo Horvath | | 5 | * Copyright (c) 1996-2002 Eduardo Horvath |
6 | * Copyright (c) 1996 Paul Kranenburg | | 6 | * Copyright (c) 1996 Paul Kranenburg |
7 | * Copyright (c) 1996 | | 7 | * Copyright (c) 1996 |
8 | * The President and Fellows of Harvard College. | | 8 | * The President and Fellows of Harvard College. |
9 | * All rights reserved. | | 9 | * All rights reserved. |
10 | * Copyright (c) 1992, 1993 | | 10 | * Copyright (c) 1992, 1993 |
11 | * The Regents of the University of California. | | 11 | * The Regents of the University of California. |
12 | * All rights reserved. | | 12 | * All rights reserved. |
13 | * | | 13 | * |
14 | * This software was developed by the Computer Systems Engineering group | | 14 | * This software was developed by the Computer Systems Engineering group |
| @@ -6273,26 +6273,87 @@ ENTRY(OF_val2sym32) | | | @@ -6273,26 +6273,87 @@ ENTRY(OF_val2sym32) |
6273 | btst 7, %i0 | | 6273 | btst 7, %i0 |
6274 | bnz,pn %icc, 1f | | 6274 | bnz,pn %icc, 1f |
6275 | add %sp, BIAS, %o1 | | 6275 | add %sp, BIAS, %o1 |
6276 | btst 1, %sp | | 6276 | btst 1, %sp |
6277 | movnz %icc, %o1, %sp | | 6277 | movnz %icc, %o1, %sp |
6278 | call _C_LABEL(OF_val2sym) | | 6278 | call _C_LABEL(OF_val2sym) |
6279 | mov %i0, %o0 | | 6279 | mov %i0, %o0 |
6280 | 1: | | 6280 | 1: |
6281 | ret | | 6281 | ret |
6282 | restore %o0, 0, %o0 | | 6282 | restore %o0, 0, %o0 |
6283 | #endif /* _LP64 */ | | 6283 | #endif /* _LP64 */ |
6284 | #endif /* DDB */ | | 6284 | #endif /* DDB */ |
6285 | | | 6285 | |
| | | 6286 | |
| | | 6287 | #if defined(MULTIPROCESSOR) |
| | | 6288 | /* |
| | | 6289 | * IPI target function to setup a C compatible environment and call a MI function. |
| | | 6290 | * |
| | | 6291 | * On entry: |
| | | 6292 | * We are on one of the alternate set of globals |
| | | 6293 | * %g2 = function to call |
| | | 6294 | * %g3 = single argument to called function |
| | | 6295 | */ |
| | | 6296 | ENTRY(sparc64_ipi_ccall) |
| | | 6297 | #ifdef TRAPS_USE_IG |
| | | 6298 | wrpr %g0, PSTATE_KERN|PSTATE_IG, %pstate ! DEBUG |
| | | 6299 | #endif |
| | | 6300 | TRAP_SETUP(-CC64FSZ-TF_SIZE) |
| | | 6301 | |
| | | 6302 | #ifdef DEBUG |
| | | 6303 | rdpr %tt, %o1 ! debug |
| | | 6304 | sth %o1, [%sp + CC64FSZ + STKB + TF_TT]! debug |
| | | 6305 | #endif |
| | | 6306 | mov %g3, %o0 ! save argument of function to call |
| | | 6307 | mov %g2, %o5 ! save function pointer |
| | | 6308 | |
| | | 6309 | wrpr %g0, PSTATE_KERN, %pstate ! Get back to normal globals |
| | | 6310 | stx %g1, [%sp + CC64FSZ + STKB + TF_G + ( 1*8)] |
| | | 6311 | mov %g1, %o1 ! code |
| | | 6312 | rdpr %tpc, %o2 ! (pc) |
| | | 6313 | stx %g2, [%sp + CC64FSZ + STKB + TF_G + ( 2*8)] |
| | | 6314 | rdpr %tstate, %g1 |
| | | 6315 | stx %g3, [%sp + CC64FSZ + STKB + TF_G + ( 3*8)] |
| | | 6316 | rdpr %tnpc, %o3 |
| | | 6317 | stx %g4, [%sp + CC64FSZ + STKB + TF_G + ( 4*8)] |
| | | 6318 | rd %y, %o4 |
| | | 6319 | stx %g5, [%sp + CC64FSZ + STKB + TF_G + ( 5*8)] |
| | | 6320 | stx %g6, [%sp + CC64FSZ + STKB + TF_G + ( 6*8)] |
| | | 6321 | wrpr %g0, 0, %tl ! return to tl=0 |
| | | 6322 | stx %g7, [%sp + CC64FSZ + STKB + TF_G + ( 7*8)] |
| | | 6323 | |
| | | 6324 | stx %g1, [%sp + CC64FSZ + STKB + TF_TSTATE] |
| | | 6325 | stx %o2, [%sp + CC64FSZ + STKB + TF_PC] |
| | | 6326 | stx %o3, [%sp + CC64FSZ + STKB + TF_NPC] |
| | | 6327 | st %o4, [%sp + CC64FSZ + STKB + TF_Y] |
| | | 6328 | |
| | | 6329 | rdpr %pil, %g5 |
| | | 6330 | stb %g5, [%sp + CC64FSZ + STKB + TF_PIL] |
| | | 6331 | stb %g5, [%sp + CC64FSZ + STKB + TF_OLDPIL] |
| | | 6332 | |
| | | 6333 | !! In the EMBEDANY memory model %g4 points to the start of the data segment. |
| | | 6334 | !! In our case we need to clear it before calling any C-code |
| | | 6335 | clr %g4 |
| | | 6336 | wr %g0, ASI_NUCLEUS, %asi ! default kernel ASI |
| | | 6337 | |
| | | 6338 | call %o5 ! call function |
| | | 6339 | nop |
| | | 6340 | |
| | | 6341 | ba,a return_from_trap ! and return from IPI |
| | | 6342 | nop |
| | | 6343 | |
| | | 6344 | #endif |
| | | 6345 | |
| | | 6346 | |
6286 | .data | | 6347 | .data |
6287 | _ALIGN | | 6348 | _ALIGN |
6288 | #if NKSYMS || defined(DDB) || defined(LKM) | | 6349 | #if NKSYMS || defined(DDB) || defined(LKM) |
6289 | .globl _C_LABEL(esym) | | 6350 | .globl _C_LABEL(esym) |
6290 | _C_LABEL(esym): | | 6351 | _C_LABEL(esym): |
6291 | POINTER 0 | | 6352 | POINTER 0 |
6292 | .globl _C_LABEL(ssym) | | 6353 | .globl _C_LABEL(ssym) |
6293 | _C_LABEL(ssym): | | 6354 | _C_LABEL(ssym): |
6294 | POINTER 0 | | 6355 | POINTER 0 |
6295 | #endif | | 6356 | #endif |
6296 | .comm _C_LABEL(promvec), PTRSZ | | 6357 | .comm _C_LABEL(promvec), PTRSZ |
6297 | | | 6358 | |
6298 | #ifdef DEBUG | | 6359 | #ifdef DEBUG |