LibXenon
Bare-metal Xbox 360 homebrew library
Loading...
Searching...
No Matches
mf-runtime.h
Go to the documentation of this file.
1/* Implementation header for mudflap runtime library.
2 Mudflap: narrow-pointer bounds-checking by tree rewriting.
3 Copyright (C) 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
4 Contributed by Frank Ch. Eigler <fche@redhat.com>
5 and Graydon Hoare <graydon@redhat.com>
6
7This file is part of GCC.
8
9GCC is free software; you can redistribute it and/or modify it under
10the terms of the GNU General Public License as published by the Free
11Software Foundation; either version 3, or (at your option) any later
12version.
13
14GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15WARRANTY; without even the implied warranty of MERCHANTABILITY or
16FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17for more details.
18
19Under Section 7 of GPL version 3, you are granted additional
20permissions described in the GCC Runtime Library Exception, version
213.1, as published by the Free Software Foundation.
22
23You should have received a copy of the GNU General Public License and
24a copy of the GCC Runtime Library Exception along with this program;
25see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
26<http://www.gnu.org/licenses/>. */
27
28/* Public libmudflap declarations -*- C -*- */
29
30#ifndef MF_RUNTIME_H
31#define MF_RUNTIME_H
32
33typedef void *__mf_ptr_t;
34typedef unsigned int __mf_uintptr_t __attribute__ ((__mode__ (__pointer__)));
35typedef __SIZE_TYPE__ __mf_size_t;
36
37/* Global declarations used by instrumentation. When _MUDFLAP is
38 defined, these have been auto-declared by the compiler and we
39 should not declare them again (ideally we *would* declare them
40 again, to verify that the compiler's declarations match the
41 library's, but the C++ front end has no mechanism for allowing
42 the re-definition of a structure type). */
43
44#ifndef _MUDFLAP
45struct __mf_cache { __mf_uintptr_t low; __mf_uintptr_t high; };
46extern struct __mf_cache __mf_lookup_cache [];
47extern __mf_uintptr_t __mf_lc_mask;
48extern unsigned char __mf_lc_shift;
49#endif
50
51/* Codes to describe the type of access to check: __mf_check arg 3 */
52
53#define __MF_CHECK_READ 0
54#define __MF_CHECK_WRITE 1
55
56
57/* Codes to describe a region of memory being registered: __mf_*register arg 3 */
58
59#define __MF_TYPE_NOACCESS 0
60#define __MF_TYPE_HEAP 1
61#define __MF_TYPE_HEAP_I 2
62#define __MF_TYPE_STACK 3
63#define __MF_TYPE_STATIC 4
64#define __MF_TYPE_GUESS 5
65
66
67/* The public mudflap API */
68
69#ifdef __cplusplus
70extern "C" {
71#endif
72
73extern void __mf_check (void *ptr, __mf_size_t sz, int type, const char *location)
74 __attribute((nothrow));
75extern void __mf_register (void *ptr, __mf_size_t sz, int type, const char *name)
76 __attribute((nothrow));
77extern void __mf_unregister (void *ptr, __mf_size_t sz, int type)
78 __attribute((nothrow));
79extern unsigned __mf_watch (void *ptr, __mf_size_t sz);
80extern unsigned __mf_unwatch (void *ptr, __mf_size_t sz);
81extern void __mf_report ();
82extern int __mf_set_options (const char *opts);
83
84
85void mf_check(void * addr,int size,int check_reads, int check_writes, int halt_on_access);
86
87
88#ifdef __cplusplus
89}
90#endif
91
92#endif /* MF_RUNTIME_H */
u32 ptr
Definition: iso9660.c:536
u32 size
Definition: iso9660.c:537
__mf_uintptr_t __mf_lc_mask
unsigned int __mf_uintptr_t __attribute__((__mode__(__pointer__)))
Definition: mf-runtime.h:34
void * __mf_ptr_t
Definition: mf-runtime.h:33
int __mf_set_options(const char *opts)
struct __mf_cache __mf_lookup_cache[]
unsigned __mf_unwatch(void *ptr, __mf_size_t sz)
unsigned __mf_watch(void *ptr, __mf_size_t sz)
void __mf_check(void *ptr, __mf_size_t sz, int type, const char *location) __attribute((nothrow))
void __mf_report()
void __mf_unregister(void *ptr, __mf_size_t sz, int type) __attribute((nothrow))
void mf_check(void *addr, int size, int check_reads, int check_writes, int halt_on_access)
__SIZE_TYPE__ __mf_size_t
Definition: mf-runtime.h:35
void __mf_register(void *ptr, __mf_size_t sz, int type, const char *name) __attribute((nothrow))
unsigned char __mf_lc_shift
__mf_uintptr_t high
Definition: mf-runtime.h:45
__mf_uintptr_t low
Definition: mf-runtime.h:45
u8 type
Definition: xenos_edid.h:1