1 //===-- sanitizer_freebsd.h -------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file is a part of Sanitizer runtime. It contains FreeBSD-specific
13 //===----------------------------------------------------------------------===//
15 #ifndef SANITIZER_FREEBSD_H
16 #define SANITIZER_FREEBSD_H
18 #include "sanitizer_internal_defs.h"
20 // x86-64 FreeBSD 9.2 and older define 'ucontext_t' incorrectly in
22 #if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32)
23 # include <osreldate.h>
24 # if __FreeBSD_version <= 902001 // v9.2
25 # include <ucontext.h>
27 namespace __sanitizer
{
29 typedef __int32_t __xregister_t
;
31 typedef struct __xmcontext
{
32 __xregister_t mc_onstack
;
45 __xregister_t mc_trapno
;
49 __xregister_t mc_eflags
;
56 __xregister_t mc_flags
;
58 int mc_fpstate
[128] __aligned(16);
59 __xregister_t mc_fsbase
;
60 __xregister_t mc_gsbase
;
61 __xregister_t mc_xfpustate
;
62 __xregister_t mc_xfpustate_len
;
67 typedef struct __xucontext
{
69 xmcontext_t uc_mcontext
;
71 struct __ucontext
*uc_link
;
77 } // namespace __sanitizer
79 # endif // __FreeBSD_version <= 902001
80 #endif // SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32)
82 #endif // SANITIZER_FREEBSD_H