| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: locore.s,v 1.268 2012/11/04 00:32:47 chs Exp $ */ | | 1 | /* $NetBSD: locore.s,v 1.268.16.1 2018/01/03 20:06:02 snj Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1996 Paul Kranenburg | | 4 | * Copyright (c) 1996 Paul Kranenburg |
5 | * Copyright (c) 1996 | | 5 | * Copyright (c) 1996 |
6 | * The President and Fellows of Harvard College. All rights reserved. | | 6 | * The President and Fellows of Harvard College. All rights reserved. |
7 | * Copyright (c) 1992, 1993 | | 7 | * Copyright (c) 1992, 1993 |
8 | * The Regents of the University of California. All rights reserved. | | 8 | * The Regents of the University of California. All rights reserved. |
9 | * | | 9 | * |
10 | * This software was developed by the Computer Systems Engineering group | | 10 | * This software was developed by the Computer Systems Engineering group |
11 | * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and | | 11 | * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and |
12 | * contributed to Berkeley. | | 12 | * contributed to Berkeley. |
13 | * | | 13 | * |
14 | * All advertising materials mentioning features or use of this software | | 14 | * All advertising materials mentioning features or use of this software |
| @@ -6278,28 +6278,29 @@ Lpanic_ljmp: | | | @@ -6278,28 +6278,29 @@ Lpanic_ljmp: |
6278 | _ALIGN | | 6278 | _ALIGN |
6279 | | | 6279 | |
6280 | ENTRY(longjmp) | | 6280 | ENTRY(longjmp) |
6281 | addcc %o1, %g0, %g6 ! compute v ? v : 1 in a global register | | 6281 | addcc %o1, %g0, %g6 ! compute v ? v : 1 in a global register |
6282 | be,a 0f | | 6282 | be,a 0f |
6283 | mov 1, %g6 | | 6283 | mov 1, %g6 |
6284 | 0: | | 6284 | 0: |
6285 | mov %o0, %g1 ! save a in another global register | | 6285 | mov %o0, %g1 ! save a in another global register |
6286 | ld [%g1+8], %g7 /* get caller's frame */ | | 6286 | ld [%g1+8], %g7 /* get caller's frame */ |
6287 | 1: | | 6287 | 1: |
6288 | cmp %fp, %g7 ! compare against desired frame | | 6288 | cmp %fp, %g7 ! compare against desired frame |
6289 | bl,a 1b ! if below, | | 6289 | bl,a 1b ! if below, |
6290 | restore ! pop frame and loop | | 6290 | restore ! pop frame and loop |
6291 | be,a 2f ! if there, | | 6291 | ld [%g1+0], %o2 ! fetch return %sp |
6292 | ldd [%g1+0], %o2 ! fetch return %sp and pc, and get out | | 6292 | be,a 2f ! we're there, get out |
| | | 6293 | ld [%g1+4], %o3 ! fetch return pc |
6293 | | | 6294 | |
6294 | Llongjmpbotch: | | 6295 | Llongjmpbotch: |
6295 | ! otherwise, went too far; bomb out | | 6296 | ! otherwise, went too far; bomb out |
6296 | save %sp, -CCFSZ, %sp /* preserve current window */ | | 6297 | save %sp, -CCFSZ, %sp /* preserve current window */ |
6297 | sethi %hi(Lpanic_ljmp), %o0 | | 6298 | sethi %hi(Lpanic_ljmp), %o0 |
6298 | call _C_LABEL(panic) | | 6299 | call _C_LABEL(panic) |
6299 | or %o0, %lo(Lpanic_ljmp), %o0; | | 6300 | or %o0, %lo(Lpanic_ljmp), %o0; |
6300 | unimp 0 | | 6301 | unimp 0 |
6301 | | | 6302 | |
6302 | 2: | | 6303 | 2: |
6303 | cmp %o2, %sp ! %sp must not decrease | | 6304 | cmp %o2, %sp ! %sp must not decrease |
6304 | bge,a 3f | | 6305 | bge,a 3f |
6305 | mov %o2, %sp ! it is OK, put it in place | | 6306 | mov %o2, %sp ! it is OK, put it in place |