2 * Copyright 2007-2011, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
6 // This file is used to get C structure offsets into assembly code.
7 // The build system assembles the file and processes the output to create
8 // a header file with macro definitions, that can be included from assembly
12 #include <computed_asm_macros.h>
15 #include <ksyscalls.h>
16 #include <thread_types.h>
19 #define DEFINE_MACRO(macro, value) DEFINE_COMPUTED_ASM_MACRO(macro, value)
21 #define DEFINE_OFFSET_MACRO(prefix, structure, member) \
22 DEFINE_MACRO(prefix##_##member, offsetof(struct structure, member));
24 #define DEFINE_SIZEOF_MACRO(prefix, structure) \
25 DEFINE_MACRO(prefix##_sizeof, sizeof(struct structure));
32 DEFINE_OFFSET_MACRO(THREAD
, Thread
, kernel_time
);
33 DEFINE_OFFSET_MACRO(THREAD
, Thread
, user_time
);
34 DEFINE_OFFSET_MACRO(THREAD
, Thread
, last_time
);
35 DEFINE_OFFSET_MACRO(THREAD
, Thread
, in_kernel
);
36 DEFINE_OFFSET_MACRO(THREAD
, Thread
, flags
);
37 DEFINE_OFFSET_MACRO(THREAD
, Thread
, kernel_stack_top
);
38 DEFINE_OFFSET_MACRO(THREAD
, Thread
, fault_handler
);
41 DEFINE_OFFSET_MACRO(IFRAME
, iframe
, fp
);
42 DEFINE_OFFSET_MACRO(IFRAME
, iframe
, fpc
);
43 DEFINE_OFFSET_MACRO(IFRAME
, iframe
, fpu
);
44 DEFINE_OFFSET_MACRO(IFRAME
, iframe
, d
);
45 DEFINE_OFFSET_MACRO(IFRAME
, iframe
, a
);
46 DEFINE_OFFSET_MACRO(IFRAME
, iframe
, cpu
);
49 DEFINE_OFFSET_MACRO(IFRAME
, iframe
, cs
);
50 DEFINE_OFFSET_MACRO(IFRAME
, iframe
, eax
);
51 DEFINE_OFFSET_MACRO(IFRAME
, iframe
, edx
);
52 DEFINE_OFFSET_MACRO(IFRAME
, iframe
, orig_eax
);
53 DEFINE_OFFSET_MACRO(IFRAME
, iframe
, vector
);
54 DEFINE_OFFSET_MACRO(IFRAME
, iframe
, eip
);
55 DEFINE_OFFSET_MACRO(IFRAME
, iframe
, flags
);
56 DEFINE_OFFSET_MACRO(IFRAME
, iframe
, user_esp
);
59 DEFINE_SIZEOF_MACRO(FPU_STATE
, mc680x0_fpu_state
);
60 DEFINE_SIZEOF_MACRO(FPU_DATA_REG
, mc680x0_fp_data_reg
);
62 // struct syscall_info
63 DEFINE_SIZEOF_MACRO(SYSCALL_INFO
, syscall_info
);
64 DEFINE_OFFSET_MACRO(SYSCALL_INFO
, syscall_info
, function
);
65 DEFINE_OFFSET_MACRO(SYSCALL_INFO
, syscall_info
, parameter_size
);