~vcs-imports-ii/libsigsegv/master

« back to all changes in this revision

Viewing changes to src/signals-bsd.h

  • Committer: Bruno Haible
  • Date: 2023-11-10 01:21:52 UTC
  • Revision ID: git-v1:b3b4eb445bf15b96139c4636ef3c5936ae3b988d
Port to CHERI.

* m4/fault.m4 (SV_TRY_FAULT): Use 'uintptr_t' instead of
'unsigned long'.
* src/signals-bsd.h (SIGSEGV_FOR_ALL_SIGNALS): On CheriBSD, treat
SIGPROT like SIGSEGV and SIGBUS.
* src/fault-freebsd-arm.h (SIGSEGV_FAULT_STACKPOINTER): Define
differently on CheriBSD.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* List of signals.  BSD version.
2
 
   Copyright (C) 2002  Bruno Haible <bruno@clisp.org>
 
2
   Copyright (C) 2002-2023  Bruno Haible <bruno@clisp.org>
3
3
 
4
4
   This program is free software: you can redistribute it and/or modify
5
5
   it under the terms of the GNU General Public License as published by
16
16
 
17
17
/* List of signals that are sent when an invalid virtual memory address
18
18
   is accessed, or when the stack overflows.  */
19
 
#define SIGSEGV_FOR_ALL_SIGNALS(var,body) \
20
 
  { int var; var = SIGSEGV; { body } var = SIGBUS; { body } }
 
19
#if defined __CHERI__
 
20
# define SIGSEGV_FOR_ALL_SIGNALS(var,body) \
 
21
    { int var;                             \
 
22
      var = SIGSEGV; { body }              \
 
23
      var = SIGBUS; { body }               \
 
24
      var = SIGPROT; { body }              \
 
25
    }
 
26
#else
 
27
# define SIGSEGV_FOR_ALL_SIGNALS(var,body) \
 
28
    { int var;                             \
 
29
      var = SIGSEGV; { body }              \
 
30
      var = SIGBUS; { body }               \
 
31
    }
 
32
#endif