11558Srgrimes/* 21558Srgrimes * Copyright 2007-2009, Ingo Weinhold, ingo_weinhold@gmx.de. 31558Srgrimes * Copyright 2010 Andreas Faerber, andreas.faerber@web.de 41558Srgrimes * Distributed under the terms of the MIT License. 51558Srgrimes */ 61558Srgrimes 71558Srgrimes// This file is used to get C structure offsets into assembly code. 81558Srgrimes// The build system assembles the file and processes the output to create 91558Srgrimes// a header file with macro definitions, that can be included from assembly 101558Srgrimes// code. 111558Srgrimes 121558Srgrimes 131558Srgrimes#include <computed_asm_macros.h> 141558Srgrimes 151558Srgrimes#include <cpu.h> 161558Srgrimes 171558Srgrimes 181558Srgrimes#define DEFINE_MACRO(macro, value) DEFINE_COMPUTED_ASM_MACRO(macro, value) 191558Srgrimes 201558Srgrimes#define DEFINE_OFFSET_MACRO(prefix, structure, member) \ 211558Srgrimes DEFINE_MACRO(prefix##_##member, offsetof(struct structure, member)); 221558Srgrimes 231558Srgrimes#define DEFINE_SIZEOF_MACRO(prefix, structure) \ 241558Srgrimes DEFINE_MACRO(prefix##_sizeof, sizeof(struct structure)); 251558Srgrimes 261558Srgrimes 271558Srgrimesvoid 281558Srgrimesdummy() 291558Srgrimes{ 301558Srgrimes // struct cpu_ent 311558Srgrimes DEFINE_OFFSET_MACRO(CPU_ENT, cpu_ent, fault_handler); 321558Srgrimes DEFINE_OFFSET_MACRO(CPU_ENT, cpu_ent, fault_handler_stack_pointer); 331558Srgrimes} 341558Srgrimes