Ticket #6032: ppc_asm_offsets.diff

File ppc_asm_offsets.diff, 1.5 KB (added by andreasf, 11 years ago)

proposed patch: add asm_offsets.cpp

  • src/system/kernel/arch/ppc/Jamfile

    diff --git a/src/system/kernel/arch/ppc/Jamfile b/src/system/kernel/arch/ppc/Jamfile
    index 3f9e576..493d20c 100644
    a b KernelMergeObject kernel_arch_ppc.o :  
    3333    :
    3434    $(TARGET_KERNEL_PIC_CCFLAGS) -Wno-unused
    3535;
     36
     37CreateAsmStructOffsetsHeader asm_offsets.h : asm_offsets.cpp ;
  • new file src/system/kernel/arch/ppc/asm_offsets.cpp

    diff --git a/src/system/kernel/arch/ppc/asm_offsets.cpp b/src/system/kernel/arch/ppc/asm_offsets.cpp
    new file mode 100644
    index 0000000..13f69d0
    - +  
     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
     27void
     28dummy()
     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}