4
* Global definitions that are included at the beginning
5
* of every file using the -include directive.
7
* These definitions are used to permit the same
8
* source code to be used to build both the security
9
* server component of the kernel and the checkpolicy
23
#include <sys/types.h>
24
#include <netinet/in.h>
25
#include <arpa/inet.h>
29
typedef unsigned int security_id_t;
31
#define SELINUX_MAGIC 0xf97cff8c
33
#define selinux_enforcing 1
38
#include "av_permissions.h"
40
#define NIPQUAD(addr) \
41
((unsigned char *)&addr)[0], \
42
((unsigned char *)&addr)[1], \
43
((unsigned char *)&addr)[2], \
44
((unsigned char *)&addr)[3]
46
#if __BYTE_ORDER == __LITTLE_ENDIAN
47
#define cpu_to_le32(x) (x)
48
#define le32_to_cpu(x) (x)
49
#define cpu_to_le64(x) (x)
50
#define le64_to_cpu(x) (x)
52
#define cpu_to_le32(x) bswap_32(x)
53
#define le32_to_cpu(x) bswap_32(x)
54
#define cpu_to_le64(x) bswap_64(x)
55
#define le64_to_cpu(x) bswap_64(x)
60
#define kmalloc(size, flags) malloc(size)
61
#define kfree(ptr) free(ptr)
62
#define vmalloc(size) malloc(size)
63
#define vfree(ptr) free(ptr)
67
typedef unsigned int spinlock_t;
68
#define spin_lock_init(x) *(x) = 0
69
#define spin_lock_irq(x)
70
#define spin_unlock_irq(x)
72
typedef unsigned int rwlock_t;
73
#define read_lock(x) *(x) = 1
74
#define read_unlock(x)
75
#define write_lock_irq(x)
76
#define write_unlock_irq(x)
77
#define RW_LOCK_UNLOCKED 0
79
#define DECLARE_MUTEX(x) unsigned int x
80
#define down(x) *(x) = 1
83
#define BUG_ON(x) do { if (x) printf("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); } while (0)
85
#define BUG() do { printf("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); } while (0)
87
static inline void selinux_complete_init(void) {}
89
#endif /* __SS_GLOBAL_H */