mirror of
https://github.com/memtest86plus/memtest86plus.git
synced 2025-02-25 18:55:23 -06:00
Help the code build with contemporary Clang: rework the PTE definition macros to avoid excessive recursivity (and in fact avoid it completely), replace a non-portable goto construct.
This commit is contained in:
parent
778c7b4cc4
commit
e31e24bda5
@ -171,7 +171,8 @@ static void run_at(uintptr_t addr, int my_cpu)
|
|||||||
__asm__ __volatile__("movl %0, %%edi" : : "r" (new_start_addr));
|
__asm__ __volatile__("movl %0, %%edi" : : "r" (new_start_addr));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
goto *new_start_addr;
|
// Jump to new_start_addr.
|
||||||
|
((void (*)(void))new_start_addr)();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool set_load_addr(uintptr_t *load_addr, size_t program_size, uintptr_t lower_limit, uintptr_t upper_limit)
|
static bool set_load_addr(uintptr_t *load_addr, size_t program_size, uintptr_t lower_limit, uintptr_t upper_limit)
|
||||||
|
@ -648,18 +648,37 @@ gdt_end:
|
|||||||
|
|
||||||
.data
|
.data
|
||||||
|
|
||||||
.macro ptes64 start, count=64
|
.macro ptes8 start, flags
|
||||||
.quad \start + 0x0000000 + 0x83
|
.quad \start + 0x00000000 + \flags
|
||||||
.quad \start + 0x0200000 + 0x83
|
.quad \start + 0x00200000 + \flags
|
||||||
.quad \start + 0x0400000 + 0x83
|
.quad \start + 0x00400000 + \flags
|
||||||
.quad \start + 0x0600000 + 0x83
|
.quad \start + 0x00600000 + \flags
|
||||||
.quad \start + 0x0800000 + 0x83
|
.quad \start + 0x00800000 + \flags
|
||||||
.quad \start + 0x0A00000 + 0x83
|
.quad \start + 0x00A00000 + \flags
|
||||||
.quad \start + 0x0C00000 + 0x83
|
.quad \start + 0x00C00000 + \flags
|
||||||
.quad \start + 0x0E00000 + 0x83
|
.quad \start + 0x00E00000 + \flags
|
||||||
.if \count-1
|
.endm
|
||||||
ptes64 "(\start+0x01000000)",\count-1
|
|
||||||
.endif
|
.macro ptes64 start, flags
|
||||||
|
ptes8 \start + 0x00000000, \flags
|
||||||
|
ptes8 \start + 0x01000000, \flags
|
||||||
|
ptes8 \start + 0x02000000, \flags
|
||||||
|
ptes8 \start + 0x03000000, \flags
|
||||||
|
ptes8 \start + 0x04000000, \flags
|
||||||
|
ptes8 \start + 0x05000000, \flags
|
||||||
|
ptes8 \start + 0x06000000, \flags
|
||||||
|
ptes8 \start + 0x07000000, \flags
|
||||||
|
.endm
|
||||||
|
|
||||||
|
.macro ptes512 start, flags
|
||||||
|
ptes64 \start + 0x00000000, \flags
|
||||||
|
ptes64 \start + 0x08000000, \flags
|
||||||
|
ptes64 \start + 0x10000000, \flags
|
||||||
|
ptes64 \start + 0x18000000, \flags
|
||||||
|
ptes64 \start + 0x20000000, \flags
|
||||||
|
ptes64 \start + 0x28000000, \flags
|
||||||
|
ptes64 \start + 0x30000000, \flags
|
||||||
|
ptes64 \start + 0x38000000, \flags
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro maxdepth depth=1
|
.macro maxdepth depth=1
|
||||||
@ -702,22 +721,22 @@ pdp:
|
|||||||
.align 4096
|
.align 4096
|
||||||
.globl pd0
|
.globl pd0
|
||||||
pd0:
|
pd0:
|
||||||
ptes64 0x0000000000000000
|
ptes512 0x0000000000000000, 0x0000000000000083
|
||||||
|
|
||||||
.align 4096
|
.align 4096
|
||||||
.globl pd1
|
.globl pd1
|
||||||
pd1:
|
pd1:
|
||||||
ptes64 0x0000000040000000
|
ptes512 0x0000000040000000, 0x0000000000000083
|
||||||
|
|
||||||
.align 4096
|
.align 4096
|
||||||
.globl pd2
|
.globl pd2
|
||||||
pd2:
|
pd2:
|
||||||
ptes64 0x0000000080000000
|
ptes512 0x0000000080000000, 0x0000000000000083
|
||||||
|
|
||||||
.align 4096
|
.align 4096
|
||||||
.globl pd3
|
.globl pd3
|
||||||
pd3:
|
pd3:
|
||||||
ptes64 0x00000000C0000000
|
ptes512 0x00000000C0000000, 0x0000000000000083
|
||||||
|
|
||||||
.previous
|
.previous
|
||||||
|
|
||||||
|
@ -465,18 +465,37 @@ gdt_end:
|
|||||||
|
|
||||||
.data
|
.data
|
||||||
|
|
||||||
.macro ptes64 start, count=64
|
.macro ptes8 start, flags
|
||||||
.quad \start + 0x0000000 + 0x83
|
.quad \start + 0x00000000 + \flags
|
||||||
.quad \start + 0x0200000 + 0x83
|
.quad \start + 0x00200000 + \flags
|
||||||
.quad \start + 0x0400000 + 0x83
|
.quad \start + 0x00400000 + \flags
|
||||||
.quad \start + 0x0600000 + 0x83
|
.quad \start + 0x00600000 + \flags
|
||||||
.quad \start + 0x0800000 + 0x83
|
.quad \start + 0x00800000 + \flags
|
||||||
.quad \start + 0x0A00000 + 0x83
|
.quad \start + 0x00A00000 + \flags
|
||||||
.quad \start + 0x0C00000 + 0x83
|
.quad \start + 0x00C00000 + \flags
|
||||||
.quad \start + 0x0E00000 + 0x83
|
.quad \start + 0x00E00000 + \flags
|
||||||
.if \count-1
|
.endm
|
||||||
ptes64 "(\start+0x01000000)",\count-1
|
|
||||||
.endif
|
.macro ptes64 start, flags
|
||||||
|
ptes8 \start + 0x00000000, \flags
|
||||||
|
ptes8 \start + 0x01000000, \flags
|
||||||
|
ptes8 \start + 0x02000000, \flags
|
||||||
|
ptes8 \start + 0x03000000, \flags
|
||||||
|
ptes8 \start + 0x04000000, \flags
|
||||||
|
ptes8 \start + 0x05000000, \flags
|
||||||
|
ptes8 \start + 0x06000000, \flags
|
||||||
|
ptes8 \start + 0x07000000, \flags
|
||||||
|
.endm
|
||||||
|
|
||||||
|
.macro ptes512 start, flags
|
||||||
|
ptes64 \start + 0x00000000, \flags
|
||||||
|
ptes64 \start + 0x08000000, \flags
|
||||||
|
ptes64 \start + 0x10000000, \flags
|
||||||
|
ptes64 \start + 0x18000000, \flags
|
||||||
|
ptes64 \start + 0x20000000, \flags
|
||||||
|
ptes64 \start + 0x28000000, \flags
|
||||||
|
ptes64 \start + 0x30000000, \flags
|
||||||
|
ptes64 \start + 0x38000000, \flags
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro maxdepth depth=1
|
.macro maxdepth depth=1
|
||||||
@ -514,22 +533,22 @@ pdp:
|
|||||||
.align 4096
|
.align 4096
|
||||||
.globl pd0
|
.globl pd0
|
||||||
pd0:
|
pd0:
|
||||||
ptes64 0x0000000000000000
|
ptes512 0x0000000000000000, 0x0000000000000083
|
||||||
|
|
||||||
.align 4096
|
.align 4096
|
||||||
.globl pd1
|
.globl pd1
|
||||||
pd1:
|
pd1:
|
||||||
ptes64 0x0000000040000000
|
ptes512 0x0000000040000000, 0x0000000000000083
|
||||||
|
|
||||||
.align 4096
|
.align 4096
|
||||||
.globl pd2
|
.globl pd2
|
||||||
pd2:
|
pd2:
|
||||||
ptes64 0x0000000080000000
|
ptes512 0x0000000080000000, 0x0000000000000083
|
||||||
|
|
||||||
.align 4096
|
.align 4096
|
||||||
.globl pd3
|
.globl pd3
|
||||||
pd3:
|
pd3:
|
||||||
ptes64 0x00000000C0000000
|
ptes512 0x00000000C0000000, 0x0000000000000083
|
||||||
|
|
||||||
.previous
|
.previous
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user