diff options
author | kib <kib@FreeBSD.org> | 2015-12-07 12:20:26 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-12-07 12:20:26 +0000 |
commit | 80e8626b434515d16b3576174438526755336810 (patch) | |
tree | ee009a15b4f96147d9c165989cac04cfe89b0677 /sys/arm/include | |
parent | 29c1a1655d214f8a5756afd74f04ccf3006ab7fe (diff) | |
download | FreeBSD-src-80e8626b434515d16b3576174438526755336810.zip FreeBSD-src-80e8626b434515d16b3576174438526755336810.tar.gz |
Add support for usermode (vdso-like) gettimeofday(2) and
clock_gettime(2) on ARMv7 and ARMv8 systems which have architectural
generic timer hardware. It is similar how the RDTSC timer is used in
userspace on x86.
Fix a permission problem where generic timer access from EL0 (or
userspace on v7) was not properly initialized on APs.
For ARMv7, mark the stack non-executable. The shared page is added for
all arms (including ARMv8 64bit), and the signal trampoline code is
moved to the page.
Reviewed by: andrew
Discussed with: emaste, mmel
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D4209
Diffstat (limited to 'sys/arm/include')
-rw-r--r-- | sys/arm/include/md_var.h | 5 | ||||
-rw-r--r-- | sys/arm/include/vdso.h | 3 | ||||
-rw-r--r-- | sys/arm/include/vmparam.h | 3 |
3 files changed, 9 insertions, 2 deletions
diff --git a/sys/arm/include/md_var.h b/sys/arm/include/md_var.h index 642124d..981c0b3 100644 --- a/sys/arm/include/md_var.h +++ b/sys/arm/include/md_var.h @@ -45,6 +45,11 @@ extern int (*_arm_bzero)(void *, int, int); extern int _min_memcpy_size; extern int _min_bzero_size; +struct vdso_timehands; +struct timecounter; +extern uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, + struct timecounter *); + #define DST_IS_USER 0x1 #define SRC_IS_USER 0x2 #define IS_PHYSICAL 0x4 diff --git a/sys/arm/include/vdso.h b/sys/arm/include/vdso.h index d6aa162..6a0ec7b 100644 --- a/sys/arm/include/vdso.h +++ b/sys/arm/include/vdso.h @@ -29,6 +29,7 @@ #define _ARM_VDSO_H #define VDSO_TIMEHANDS_MD \ - uint32_t th_res[8]; + uint32_t th_physical; \ + uint32_t th_res[7]; #endif diff --git a/sys/arm/include/vmparam.h b/sys/arm/include/vmparam.h index b6e76bf..36f19a3 100644 --- a/sys/arm/include/vmparam.h +++ b/sys/arm/include/vmparam.h @@ -124,7 +124,8 @@ #endif #define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS -#define USRSTACK VM_MAXUSER_ADDRESS +#define SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE) +#define USRSTACK SHAREDPAGE /* initial pagein size of beginning of executable file */ #ifndef VM_INITIAL_PAGEIN |