Created new private system header computed_asm_macros.h defining the macro we
use for the asm_offsets.cpp file, so it can be reused elsewhere. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34311 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef _SYSTEM_COMPUTED_ASM_MACROS_H
|
||||||
|
#define _SYSTEM_COMPUTED_ASM_MACROS_H
|
||||||
|
|
||||||
|
|
||||||
|
#define DEFINE_COMPUTED_ASM_MACRO(macro, value) \
|
||||||
|
asm volatile("#define " #macro " %0" : : "i" (value))
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _SYSTEM_COMPUTED_ASM_MACROS_H */
|
||||||
@@ -1,20 +1,22 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Ingo Weinhold, [email protected].
|
* Copyright 2007-2009, Ingo Weinhold, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This file is used to get C structure offsets into assembler code.
|
// This file is used to get C structure offsets into assembly code.
|
||||||
// The build system assembles the file and processes the output to create
|
// The build system assembles the file and processes the output to create
|
||||||
// a header file with macro definitions, that can be included from assembler
|
// a header file with macro definitions, that can be included from assembly
|
||||||
// code.
|
// code.
|
||||||
|
|
||||||
|
|
||||||
|
#include <computed_asm_macros.h>
|
||||||
|
|
||||||
#include <arch_cpu.h>
|
#include <arch_cpu.h>
|
||||||
#include <ksyscalls.h>
|
#include <ksyscalls.h>
|
||||||
#include <thread_types.h>
|
#include <thread_types.h>
|
||||||
|
|
||||||
|
|
||||||
#define DEFINE_MACRO(macro, value) \
|
#define DEFINE_MACRO(macro, value) DEFINE_COMPUTED_ASM_MACRO(macro, value)
|
||||||
asm volatile("#define " #macro " %0" : : "i" (value))
|
|
||||||
|
|
||||||
#define DEFINE_OFFSET_MACRO(prefix, structure, member) \
|
#define DEFINE_OFFSET_MACRO(prefix, structure, member) \
|
||||||
DEFINE_MACRO(prefix##_##member, offsetof(struct structure, member));
|
DEFINE_MACRO(prefix##_##member, offsetof(struct structure, member));
|
||||||
|
|||||||
@@ -1,22 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Ingo Weinhold, [email protected].
|
* Copyright 2007-2009, Ingo Weinhold, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This file is used to get C structure offsets into assembler code.
|
// This file is used to get C structure offsets into assembly code.
|
||||||
// The build system assembles the file and processes the output to create
|
// The build system assembles the file and processes the output to create
|
||||||
// a header file with macro definitions, that can be included from assembler
|
// a header file with macro definitions, that can be included from assembly
|
||||||
// code.
|
// code.
|
||||||
|
|
||||||
|
|
||||||
|
#include <computed_asm_macros.h>
|
||||||
|
|
||||||
#include <arch_cpu.h>
|
#include <arch_cpu.h>
|
||||||
#include <cpu.h>
|
#include <cpu.h>
|
||||||
#include <ksyscalls.h>
|
#include <ksyscalls.h>
|
||||||
#include <thread_types.h>
|
#include <thread_types.h>
|
||||||
|
|
||||||
|
|
||||||
#define DEFINE_MACRO(macro, value) \
|
#define DEFINE_MACRO(macro, value) DEFINE_COMPUTED_ASM_MACRO(macro, value)
|
||||||
asm volatile("#define " #macro " %0" : : "i" (value))
|
|
||||||
|
|
||||||
#define DEFINE_OFFSET_MACRO(prefix, structure, member) \
|
#define DEFINE_OFFSET_MACRO(prefix, structure, member) \
|
||||||
DEFINE_MACRO(prefix##_##member, offsetof(struct structure, member));
|
DEFINE_MACRO(prefix##_##member, offsetof(struct structure, member));
|
||||||
|
|||||||
Reference in New Issue
Block a user