xref: /openbmc/qemu/pc-bios/vof/entry.S (revision c09124dc)
1#define LOAD32(rn, name)    \
2	lis     rn,name##@h;    \
3	ori     rn,rn,name##@l
4
5#define ENTRY(func_name)    \
6	.text;                  \
7	.align  2;              \
8	.globl  .func_name;     \
9	.func_name:             \
10	.globl  func_name;      \
11	func_name:
12
13#define KVMPPC_HCALL_BASE       0xf000
14#define KVMPPC_H_RTAS           (KVMPPC_HCALL_BASE + 0x0)
15#define KVMPPC_H_VOF_CLIENT     (KVMPPC_HCALL_BASE + 0x5)
16
17	. = 0x100 /* Do exactly as SLOF does */
18
19ENTRY(_start)
20	LOAD32(2, __toc_start)
21	b entry_c
22
23ENTRY(_prom_entry)
24	LOAD32(2, __toc_start)
25	stwu    %r1,-112(%r1)
26	stw     %r31,104(%r1)
27	mflr    %r31
28	bl prom_entry
29	nop
30	mtlr    %r31
31	lwz     %r31,104(%r1)
32	addi    %r1,%r1,112
33	blr
34
35ENTRY(ci_entry)
36	mr	4,3
37	LOAD32(3,KVMPPC_H_VOF_CLIENT)
38	sc	1
39	blr
40
41/* This is the actual RTAS blob copied to the OS at instantiate-rtas */
42ENTRY(hv_rtas)
43	mr      %r4,%r3
44	LOAD32(3,KVMPPC_H_RTAS)
45	sc	1
46	blr
47	.globl hv_rtas_size
48hv_rtas_size:
49	.long . - hv_rtas;
50