Diff of /src/runtime/bsd-os.h [4af254] .. [3d19a6] Maximize Restore

  Switch to unified view

a/src/runtime/bsd-os.h b/src/runtime/bsd-os.h
...
...
16
#include <sys/types.h>
16
#include <sys/types.h>
17
#include <sys/mman.h>
17
#include <sys/mman.h>
18
#include <sys/signal.h>
18
#include <sys/signal.h>
19
19
20
typedef caddr_t os_vm_address_t;
20
typedef caddr_t os_vm_address_t;
21
#ifdef __NetBSD__
22
typedef vsize_t os_vm_size_t;
23
#else
21
typedef vm_size_t os_vm_size_t;
24
typedef vm_size_t os_vm_size_t;
25
#endif
22
typedef off_t os_vm_offset_t;
26
typedef off_t os_vm_offset_t;
23
typedef int os_vm_prot_t;
27
typedef int os_vm_prot_t;
24
typedef int os_context_register_t;
28
typedef int os_context_register_t;
25
29
26
#if defined __OpenBSD__
30
#if defined __OpenBSD__
27
/* name defined for compatibility between OpenBSD 3.1 sigaltstack(2) and
31
/* name defined for compatibility between OpenBSD 3.1 sigaltstack(2) and
28
 * Linux sigaltstack(2) */
32
 * Linux sigaltstack(2) */
29
typedef struct sigaltstack stack_t;
33
typedef struct sigaltstack stack_t;
30
#elif defined __FreeBSD__
34
#elif defined __FreeBSD__
31
/* FreeBSD 4.6 already has stack_t defined. */
35
/* FreeBSD 4.6 and NetBSD 1.6 already have stack_t defined. */
32
#endif
36
#endif
33
37
34
#if defined __FreeBSD__
38
#if defined __FreeBSD__
35
/* Note: The man page for sigaction(2) in FreeBSD 4.0 says that this
39
/* Note: The man page for sigaction(2) in FreeBSD 4.0 says that this
36
 * is an mcontext_t, but according to comments by Raymond Wiker in the
40
 * is an mcontext_t, but according to comments by Raymond Wiker in the
...
...
43
 * (unlike Linux and OpenBSD) doesn't let us tweak the CPU's single
47
 * (unlike Linux and OpenBSD) doesn't let us tweak the CPU's single
44
 * step flag bit by messing with the flags stored in a signal context,
48
 * step flag bit by messing with the flags stored in a signal context,
45
 * so we need to implement single stepping in a more roundabout way. */
49
 * so we need to implement single stepping in a more roundabout way. */
46
#define CANNOT_GET_TO_SINGLE_STEP_FLAG
50
#define CANNOT_GET_TO_SINGLE_STEP_FLAG
47
#define SIG_MEMORY_FAULT SIGBUS
51
#define SIG_MEMORY_FAULT SIGBUS
52
48
#elif defined __OpenBSD__
53
#elif defined __OpenBSD__
54
49
typedef struct sigcontext os_context_t;
55
typedef struct sigcontext os_context_t;
50
#define SIG_MEMORY_FAULT SIGSEGV
56
#define SIG_MEMORY_FAULT SIGSEGV
57
58
#elif defined __NetBSD__
59
60
#include <ucontext.h>
61
typedef ucontext_t os_context_t;
62
#define SIG_MEMORY_FAULT SIGSEGV
63
51
#elif defined LISP_FEATURE_DARWIN
64
#elif defined LISP_FEATURE_DARWIN
52
  /* man pages claim that the third argument is a sigcontext struct,
65
  /* man pages claim that the third argument is a sigcontext struct,
53
     but ucontext_t is defined, matches sigcontext where sensible,
66
     but ucontext_t is defined, matches sigcontext where sensible,
54
     offers better access to mcontext, and is of course the SUSv2-
67
     offers better access to mcontext, and is of course the SUSv2-
55
     mandated type of the third argument, so we use that instead.
68
     mandated type of the third argument, so we use that instead.
...
...
57
     to be cross with them ;) -- PRM */
70
     to be cross with them ;) -- PRM */
58
71
59
#include <ucontext.h>
72
#include <ucontext.h>
60
typedef ucontext_t os_context_t;
73
typedef ucontext_t os_context_t;
61
#define SIG_MEMORY_FAULT SIGBUS
74
#define SIG_MEMORY_FAULT SIGBUS
75
62
#else
76
#else
63
#error unsupported BSD variant
77
#error unsupported BSD variant
64
#endif
78
#endif
65
79
66
#include "target-arch-os.h"
80
#include "target-arch-os.h"