smol-gilbraltar/include/crt.h
2024-12-23 01:46:17 +01:00

11 lines
300 B
C

#include <stdint.h>
extern uintptr_t SSP_GUARD_SYMBOL;
#include <cpu_aarch64.h>
#define READ_CPU_TICKS cpu_cntpct
__attribute__((always_inline)) static inline void crt_init_ssp(void) {
SSP_GUARD_SYMBOL = READ_CPU_TICKS() + (READ_CPU_TICKS() << 32UL);
SSP_GUARD_SYMBOL &= ~(uintptr_t)0xff00;
}