| 1 | /* |
| 2 | * Copyright 2007-2009, Ingo Weinhold, ingo_weinhold@gmx.de. |
| 3 | * Copyright 2010 Andreas Faerber, andreas.faerber@web.de |
| 4 | * Distributed under the terms of the MIT License. |
| 5 | */ |
| 6 | |
| 7 | // This file is used to get C structure offsets into assembly code. |
| 8 | // The build system assembles the file and processes the output to create |
| 9 | // a header file with macro definitions, that can be included from assembly |
| 10 | // code. |
| 11 | |
| 12 | |
| 13 | #include <computed_asm_macros.h> |
| 14 | |
| 15 | #include <cpu.h> |
| 16 | |
| 17 | |
| 18 | #define DEFINE_MACRO(macro, value) DEFINE_COMPUTED_ASM_MACRO(macro, value) |
| 19 | |
| 20 | #define DEFINE_OFFSET_MACRO(prefix, structure, member) \ |
| 21 | DEFINE_MACRO(prefix##_##member, offsetof(struct structure, member)); |
| 22 | |
| 23 | #define DEFINE_SIZEOF_MACRO(prefix, structure) \ |
| 24 | DEFINE_MACRO(prefix##_sizeof, sizeof(struct structure)); |
| 25 | |
| 26 | |
| 27 | void |
| 28 | dummy() |
| 29 | { |
| 30 | // struct cpu_ent |
| 31 | DEFINE_OFFSET_MACRO(CPU_ENT, cpu_ent, fault_handler); |
| 32 | DEFINE_OFFSET_MACRO(CPU_ENT, cpu_ent, fault_handler_stack_pointer); |
| 33 | } |