2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
12 /* Size of bootinfo buffer - one page */
13 #define BOOTMEM_SIZE 4096
15 static void *bootmem_Virt
;
16 static void *bootmem_Limit
;
17 ULONG_PTR bootmem_Phys
;
19 ULONG_PTR
InitBootMem(void)
21 bootmem_Virt
= AllocPhysMem(BOOTMEM_SIZE
, PAGE_READWRITE
, 0, 0, &bootmem_Phys
);
25 bootmem_Limit
= bootmem_Virt
+ BOOTMEM_SIZE
;
26 /* This routine returns PHYSICAL address */
33 void *AllocBootMem(unsigned int size
)
35 void *ptr
= bootmem_Virt
;
37 /* Align size at pointer boundary */
38 size
= (size
+ sizeof(void *) - 1) & (~(sizeof(void *) - 1));
39 if (bootmem_Limit
- ptr
< size
)
41 DisplayError("Not enough memory to build boot information (%d bytes requested)", size
);
42 exit(0); /* I'm tired to write those if's... */
51 void *AddTag(unsigned int tag
, ULONG_PTR data
)
53 ULONG_PTR
*ptr
= AllocBootMem(sizeof(ULONG_PTR
) * 2);