Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/powerpc/elf32_machdep.c
Context not available. | |||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#include "opt_pax.h" | |||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
Context not available. | |||||
#include <machine/reg.h> | #include <machine/reg.h> | ||||
#include <machine/md_var.h> | #include <machine/md_var.h> | ||||
#ifdef PAX_ASLR | |||||
#include <sys/pax.h> | |||||
#endif | |||||
#ifdef __powerpc64__ | #ifdef __powerpc64__ | ||||
#include <compat/freebsd32/freebsd32_proto.h> | #include <compat/freebsd32/freebsd32_proto.h> | ||||
#include <compat/freebsd32/freebsd32_util.h> | #include <compat/freebsd32/freebsd32_util.h> | ||||
Context not available. | |||||
.sv_shared_page_base = FREEBSD32_SHAREDPAGE, | .sv_shared_page_base = FREEBSD32_SHAREDPAGE, | ||||
.sv_shared_page_len = PAGE_SIZE, | .sv_shared_page_len = PAGE_SIZE, | ||||
.sv_schedtail = NULL, | .sv_schedtail = NULL, | ||||
#ifdef PAX_ASLR | |||||
.sv_pax_aslr_init = _pax_aslr_init32, | |||||
#else | |||||
.sv_pax_aslr_init = NULL, | |||||
#endif | |||||
imp: This is a fairly common idiom. Perhaps it would be better to say .sv_pax_aslr_init = PAX_INIT… | |||||
desUnsubmitted Not Done Inline ActionsIn the non-PAX_ASLR case sv_pax_aslr_init is implicitly initialized to NULL, so the #else is unnecessary. Same for all the other {elf,freebsd}{,32,64}_machdep.c. des: In the non-PAX_ASLR case sv_pax_aslr_init is implicitly initialized to NULL, so the #else is… | |||||
}; | }; | ||||
INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); | INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); | ||||
Context not available. |
This is a fairly common idiom. Perhaps it would be better to say .sv_pax_aslr_init = PAX_INIT(_pax_aslr_init32) where PAX_INIT(x) expands to x when PAX_ASLR is defined, and NULL when not. Pick your own name instead of PAX_INIT, I'm not picky about that. But to do that, then sys/pax.h likely would need to always be included...