diff options
Diffstat (limited to 'include/assembly.h')
-rw-r--r-- | include/assembly.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/assembly.h b/include/assembly.h new file mode 100644 index 0000000..3601024 --- /dev/null +++ b/include/assembly.h @@ -0,0 +1,29 @@ +#ifndef ASSEMBLY_H_ +#define ASSEMBLY_H_ + +#define __ASSEMBLY__ + +#define ORG(x) \ + .section .fixedaddr._##x + +#define __ALIGN .p2align 4, 0x90 +#define ENTRY(name) \ + __ALIGN; \ + .globl name; \ + name: + +#define GLOBAL(name) \ + .globl name; \ + name: + +#define ENTRY_END(name) GLOBAL(name##_end) +#define END(name) GLOBAL(name##_end) + +/* + * gas produces size override prefix with which + * we are unhappy, lets make it hardcoded for + * 16 bit mode + */ +#define IRET .byte 0xcf + +#endif /* ASSEMBLY_H_ */ |