| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: longjmp.c,v 1.4 2023/09/03 21:41:45 mrg Exp $ */ | | 1 | /* $NetBSD: longjmp.c,v 1.5 2024/02/20 00:09:31 uwe Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2003 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2003 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Christian Limpach. | | 8 | * by Christian Limpach. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -37,27 +37,27 @@ | | | @@ -37,27 +37,27 @@ |
37 | #include <string.h> | | 37 | #include <string.h> |
38 | #include <stddef.h> | | 38 | #include <stddef.h> |
39 | | | 39 | |
40 | #define __LIBC12_SOURCE__ | | 40 | #define __LIBC12_SOURCE__ |
41 | #include <setjmp.h> | | 41 | #include <setjmp.h> |
42 | #include <compat/include/setjmp.h> | | 42 | #include <compat/include/setjmp.h> |
43 | | | 43 | |
44 | #include "assym.h" | | 44 | #include "assym.h" |
45 | #include "sparc_longjmp.h" | | 45 | #include "sparc_longjmp.h" |
46 | | | 46 | |
47 | /* | | 47 | /* |
48 | * check that offsets in the above structures match their usage in the | | 48 | * check that offsets in the above structures match their usage in the |
49 | * setjmp() side of this setup. a jmp_buf is the 12-word contents of | | 49 | * setjmp() side of this setup. a jmp_buf is the 12-word contents of |
50 | * the sigcontexst structure, plus 2 more words for g4 and g7. | | 50 | * the sigcontext structure, plus 2 more words for g4 and g7. |
51 | */ | | 51 | */ |
52 | __CTASSERT(_SIZEOF_SC + _JB_G4 == offsetof(struct __jmp_buf,regs.g4)); | | 52 | __CTASSERT(_SIZEOF_SC + _JB_G4 == offsetof(struct __jmp_buf,regs.g4)); |
53 | __CTASSERT(_SIZEOF_SC + _JB_G7 == offsetof(struct __jmp_buf,regs.g7)); | | 53 | __CTASSERT(_SIZEOF_SC + _JB_G7 == offsetof(struct __jmp_buf,regs.g7)); |
54 | __CTASSERT(sizeof(jmp_buf) >= sizeof(struct __jmp_buf)); | | 54 | __CTASSERT(sizeof(jmp_buf) >= sizeof(struct __jmp_buf)); |
55 | | | 55 | |
56 | /* | | 56 | /* |
57 | * Use setcontext to reload the stack pointer, program counter <pc,npc>, and | | 57 | * Use setcontext to reload the stack pointer, program counter <pc,npc>, and |
58 | * set the return value in %o0. The %i and %l registers will be reloaded | | 58 | * set the return value in %o0. The %i and %l registers will be reloaded |
59 | * from the place to which %sp points. | | 59 | * from the place to which %sp points. |
60 | */ | | 60 | */ |
61 | void | | 61 | void |
62 | __longjmp14(jmp_buf env, int val) | | 62 | __longjmp14(jmp_buf env, int val) |
63 | { | | 63 | { |