aboutsummaryrefslogtreecommitdiff
path: root/include/assembly.h
blob: 6965583c0b478c2d5fe10d1ac75cd94eb43cfb92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef ASSEMBLY_H_
#define ASSEMBLY_H_

#define __ASSEMBLY__

#define BIOS2FLAT(x)	((x) - _start + 0xf0000)
#define BIOS2FLATROM(x)	((x) - _start + 0xffff0000)
_start = 0

#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_ */