[ACPI]
[reactos.git] / reactos / drivers / bus / acpi / include / glue.h
1 #ifndef __GLUE_HEADER
2 #define __GLUE_HEADER
3
4 #include <stddef.h>
5
6 /* header for linux macros and definitions */
7
8 /**
9 * container_of - cast a member of a structure out to the containing structure
10 * @ptr: the pointer to the member.
11 * @type: the type of the container struct this is embedded in.
12 * @member: the name of the member within the struct.
13 *
14 */
15 #define container_of(ptr, type, member) (type *)( (char *)(ptr) - offsetof(type,member) )
16
17
18 #define time_after(a,b) \
19 ((long)(b) - (long)(a) < 0))
20
21 #define time_before(a,b) time_after(b,a)
22
23 #define in_interrupt() ((__readeflags() >> 9) & 1)
24
25 typedef int (*acpi_table_handler) (ACPI_TABLE_HEADER *table);
26
27 typedef int (*acpi_table_entry_handler) (ACPI_SUBTABLE_HEADER *header, const unsigned long end);
28
29
30 #endif