Changeset View
Changeset View
Standalone View
Standalone View
head/sys/mips/mips/machdep.c
Show First 20 Lines • Show All 377 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Fix kernel_kseg0_end address in case trampoline placed debug sympols | * Fix kernel_kseg0_end address in case trampoline placed debug sympols | ||||
* data there | * data there | ||||
*/ | */ | ||||
void | void | ||||
mips_postboot_fixup(void) | mips_postboot_fixup(void) | ||||
{ | { | ||||
static char fake_preload[256]; | /* | ||||
* We store u_long sized objects into the reload area, so the array | |||||
* must be so aligned. The standard allows any alignment for char data. | |||||
*/ | |||||
static char fake_preload[256] _Alignas(_Alignof(u_long)); | |||||
caddr_t preload_ptr = (caddr_t)&fake_preload[0]; | caddr_t preload_ptr = (caddr_t)&fake_preload[0]; | ||||
size_t size = 0; | size_t size = 0; | ||||
#define PRELOAD_PUSH_VALUE(type, value) do { \ | #define PRELOAD_PUSH_VALUE(type, value) do { \ | ||||
*(type *)(preload_ptr + size) = (value); \ | *(type *)(preload_ptr + size) = (value); \ | ||||
size += sizeof(type); \ | size += sizeof(type); \ | ||||
} while (0); | } while (0); | ||||
▲ Show 20 Lines • Show All 179 Lines • Show Last 20 Lines |