From edd661f68c2c6f354fd4a98cb846f71d54361d5f Mon Sep 17 00:00:00 2001 From: Albert Ou Date: Sat, 31 Jan 2015 16:00:00 -0800 Subject: linux-headers: Synchronize with UAPI split This update removes definitions internal to kernel space from asm headers exported to user space. --- linux-headers/include/asm/asm-offsets.h | 1 - linux-headers/include/asm/auxvec.h | 8 +- linux-headers/include/asm/bitsperlong.h | 25 ++--- linux-headers/include/asm/csr.h | 125 ------------------------- linux-headers/include/asm/ptrace.h | 65 +------------ linux-headers/include/asm/sigcontext.h | 42 +++++++-- linux-headers/include/asm/unistd.h | 22 +---- linux-headers/include/asm/user.h | 19 ---- linux-headers/include/asm/vdso.h | 15 --- linux-headers/include/drm/vmwgfx_drm.h | 2 +- linux-headers/include/linux/in6.h | 3 +- linux-headers/include/linux/libc-compat.h | 3 + linux-headers/include/linux/netfilter/xt_bpf.h | 2 + linux-headers/include/linux/usb/functionfs.h | 10 +- linux-headers/include/linux/version.h | 2 +- linux-headers/include/linux/xattr.h | 2 +- linux-headers/include/rdma/rdma_user_cm.h | 1 + 17 files changed, 63 insertions(+), 284 deletions(-) delete mode 100644 linux-headers/include/asm/asm-offsets.h delete mode 100644 linux-headers/include/asm/csr.h delete mode 100644 linux-headers/include/asm/user.h delete mode 100644 linux-headers/include/asm/vdso.h (limited to 'linux-headers') diff --git a/linux-headers/include/asm/asm-offsets.h b/linux-headers/include/asm/asm-offsets.h deleted file mode 100644 index d370ee3..0000000 --- a/linux-headers/include/asm/asm-offsets.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/linux-headers/include/asm/auxvec.h b/linux-headers/include/asm/auxvec.h index 41fa68b..8a860a5 100644 --- a/linux-headers/include/asm/auxvec.h +++ b/linux-headers/include/asm/auxvec.h @@ -1 +1,7 @@ -#include +#ifndef _ASM_RISCV_AUXVEC_H +#define _ASM_RISCV_AUXVEC_H + +/* vDSO location */ +#define AT_SYSINFO_EHDR 33 + +#endif /* _ASM_RISCV_AUXVEC_H */ diff --git a/linux-headers/include/asm/bitsperlong.h b/linux-headers/include/asm/bitsperlong.h index f67718d..e7f8569 100644 --- a/linux-headers/include/asm/bitsperlong.h +++ b/linux-headers/include/asm/bitsperlong.h @@ -1,21 +1,8 @@ -#ifndef __ASM_RISCV_BITS_PER_LONG -#define __ASM_RISCV_BITS_PER_LONG +#ifndef _ASM_RISCV_BITSPERLONG_H +#define _ASM_RISCV_BITSPERLONG_H -/* - * There seems to be no way of detecting this automatically from user - * space, so 64 bit architectures should override this in their - * bitsperlong.h. In particular, an architecture that supports - * both 32 and 64 bit user space must not rely on CONFIG_64BIT - * to decide it, but rather check a compiler provided macro. - */ -#ifndef __BITS_PER_LONG -#if _RISCV_SIM == _ABI64 -#define __BITS_PER_LONG 64 -#elif _RISCV_SIM == _ABI32 -#define __BITS_PER_LONG 32 -#else -#error Unknown word length -#endif -#endif /* __BITS_PER_LONG */ +#define __BITS_PER_LONG _RISCV_SZLONG -#endif /* __ASM_RISCV_BITS_PER_LONG */ +#include + +#endif /* _ASM_RISCV_BITSPERLONG_H */ diff --git a/linux-headers/include/asm/csr.h b/linux-headers/include/asm/csr.h deleted file mode 100644 index 5042bea..0000000 --- a/linux-headers/include/asm/csr.h +++ /dev/null @@ -1,125 +0,0 @@ -#ifndef _ASM_RISCV_CSR_H -#define _ASM_RISCV_CSR_H - -#include - -/* Status register flags */ -#define SR_S _AC(0x00000001,UL) /* Supervisor */ -#define SR_PS _AC(0x00000002,UL) /* Previous supervisor */ -#define SR_EI _AC(0x00000004,UL) /* Enable interrupts */ -#define SR_PEI _AC(0x00000008,UL) /* Previous EI */ -#define SR_EF _AC(0x00000010,UL) /* Enable floating-point */ -#define SR_U64 _AC(0x00000020,UL) /* RV64 user mode */ -#define SR_S64 _AC(0x00000040,UL) /* RV64 supervisor mode */ -#define SR_VM _AC(0x00000080,UL) /* Enable virtual memory */ -#define SR_IM _AC(0x00FF0000,UL) /* Interrupt mask */ -#define SR_IP _AC(0xFF000000,UL) /* Pending interrupts */ - -#define SR_IM_SHIFT 16 -#define SR_IM_MASK(n) ((_AC(1,UL)) << ((n) + SR_IM_SHIFT)) - -#define EXC_INST_MISALIGNED 0 -#define EXC_INST_ACCESS 1 -#define EXC_SYSCALL 6 -#define EXC_LOAD_MISALIGNED 8 -#define EXC_STORE_MISALIGNED 9 -#define EXC_LOAD_ACCESS 10 -#define EXC_STORE_ACCESS 11 - -#ifndef __ASSEMBLY__ - -#define CSR_ZIMM(val) \ - (__builtin_constant_p(val) && ((unsigned long)(val) < 0x20)) - -#define csr_swap(csr,val) \ -({ \ - typeof(val) __v = (val); \ - if (CSR_ZIMM(__v)) { \ - __asm__ __volatile__ ( \ - "csrrw %0, " #csr ", %1" \ - : "=r" (__v) : "i" (__v)); \ - } else { \ - __asm__ __volatile__ ( \ - "csrrw %0, " #csr ", %1" \ - : "=r" (__v) : "r" (__v)); \ - } \ - __v; \ -}) - -#define csr_read(csr) \ -({ \ - register unsigned long __v; \ - __asm__ __volatile__ ( \ - "csrr %0, " #csr : "=r" (__v)); \ - __v; \ -}) - -#define csr_write(csr,val) \ -({ \ - typeof(val) __v = (val); \ - if (CSR_ZIMM(__v)) { \ - __asm__ __volatile__ ( \ - "csrw " #csr ", %0" : : "i" (__v)); \ - } else { \ - __asm__ __volatile__ ( \ - "csrw " #csr ", %0" : : "r" (__v)); \ - } \ -}) - -#define csr_read_set(csr,val) \ -({ \ - typeof(val) __v = (val); \ - if (CSR_ZIMM(val)) { \ - __asm__ __volatile__ ( \ - "csrrs %0, " #csr ", %1" \ - : "=r" (__v) : "i" (__v)); \ - } else { \ - __asm__ __volatile__ ( \ - "csrrs %0, " #csr ", %1" \ - : "=r" (__v) : "r" (__v)); \ - } \ - __v; \ -}) - -#define csr_set(csr,val) \ -({ \ - typeof(val) __v = (val); \ - if (CSR_ZIMM(__v)) { \ - __asm__ __volatile__ ( \ - "csrs " #csr ", %0" : : "i" (__v)); \ - } else { \ - __asm__ __volatile__ ( \ - "csrs " #csr ", %0" : : "r" (__v)); \ - } \ -}) - -#define csr_read_clear(csr,val) \ -({ \ - typeof(val) __v = (val); \ - if (CSR_ZIMM(__v)) { \ - __asm__ __volatile__ ( \ - "csrrc %0, " #csr ", %1" \ - : "=r" (__v) : "i" (__v)); \ - } else { \ - __asm__ __volatile__ ( \ - "csrrc %0, " #csr ", %1" \ - : "=r" (__v) : "r" (__v)); \ - } \ - __v; \ -}) - -#define csr_clear(csr,val) \ -({ \ - typeof(val) __v = (val); \ - if (CSR_ZIMM(__v)) { \ - __asm__ __volatile__ ( \ - "csrc " #csr ", %0" : : "i" (__v)); \ - } else { \ - __asm__ __volatile__ ( \ - "csrc " #csr ", %0" : : "r" (__v)); \ - } \ -}) - -#endif /* __ASSEMBLY__ */ - -#endif /* _ASM_RISCV_CSR_H */ diff --git a/linux-headers/include/asm/ptrace.h b/linux-headers/include/asm/ptrace.h index 054d8bf..5e2fbb6 100644 --- a/linux-headers/include/asm/ptrace.h +++ b/linux-headers/include/asm/ptrace.h @@ -1,12 +1,10 @@ #ifndef _ASM_RISCV_PTRACE_H #define _ASM_RISCV_PTRACE_H -#include +/* Mirror pt_regs from ptrace.h */ -#ifndef __ASSEMBLY__ - -typedef struct pt_regs { - unsigned long zero; +typedef struct user_regs_struct { + unsigned long pc; unsigned long ra; unsigned long s[12]; unsigned long sp; @@ -15,62 +13,7 @@ typedef struct pt_regs { unsigned long a[8]; unsigned long t[5]; unsigned long gp; - /* PCRs */ unsigned long status; - unsigned long epc; - unsigned long badvaddr; - unsigned long cause; - /* For restarting system calls */ - unsigned long syscallno; -} pt_regs; - -#define user_mode(regs) (((regs)->status & SR_PS) == 0) - - -/* Helpers for working with the instruction pointer */ -#define GET_IP(regs) ((regs)->epc) -#define SET_IP(regs, val) (GET_IP(regs) = (val)) - -static __inline__ unsigned long instruction_pointer(struct pt_regs *regs) -{ - return GET_IP(regs); -} -static __inline__ void instruction_pointer_set(struct pt_regs *regs, - unsigned long val) -{ - SET_IP(regs, val); -} - -#define profile_pc(regs) instruction_pointer(regs) - -/* Helpers for working with the user stack pointer */ -#define GET_USP(regs) ((regs)->sp) -#define SET_USP(regs, val) (GET_USP(regs) = (val)) - -static __inline__ unsigned long user_stack_pointer(struct pt_regs *regs) -{ - return GET_USP(regs); -} -static __inline__ void user_stack_pointer_set(struct pt_regs *regs, - unsigned long val) -{ - SET_USP(regs, val); -} - -/* Helpers for working with the frame pointer */ -#define GET_FP(regs) ((regs)->s[0]) -#define SET_FP(regs, val) (GET_FP(regs) = (val)) - -static __inline__ unsigned long frame_pointer(struct pt_regs *regs) -{ - return GET_FP(regs); -} -static __inline__ void frame_pointer_set(struct pt_regs *regs, - unsigned long val) -{ - SET_FP(regs, val); -} - -#endif /* __ASSEMBLY__ */ +} user_regs_struct; #endif /* _ASM_RISCV_PTRACE_H */ diff --git a/linux-headers/include/asm/sigcontext.h b/linux-headers/include/asm/sigcontext.h index 6d89223..c762962 100644 --- a/linux-headers/include/asm/sigcontext.h +++ b/linux-headers/include/asm/sigcontext.h @@ -1,21 +1,43 @@ -#ifndef __ASM_RISCV_SIGCONTEXT_H -#define __ASM_RISCV_SIGCONTEXT_H +#ifndef _ASM_RISCV_SIGCONTEXT_H +#define _ASM_RISCV_SIGCONTEXT_H /* This struct is saved by setup_frame in signal.c, to keep the current * context while a signal handler is executed. It is restored by sys_sigreturn. */ struct sigcontext { - unsigned long zero; + unsigned long epc; unsigned long ra; - unsigned long s[12]; unsigned long sp; - unsigned long tp; - unsigned long v[2]; - unsigned long a[8]; - unsigned long t[5]; unsigned long gp; - unsigned long epc; + unsigned long tp; + unsigned long t0; + unsigned long t1; + unsigned long t2; + unsigned long s0; + unsigned long s1; + unsigned long a0; + unsigned long a1; + unsigned long a2; + unsigned long a3; + unsigned long a4; + unsigned long a5; + unsigned long a6; + unsigned long a7; + unsigned long s2; + unsigned long s3; + unsigned long s4; + unsigned long s5; + unsigned long s6; + unsigned long s7; + unsigned long s8; + unsigned long s9; + unsigned long s10; + unsigned long s11; + unsigned long t3; + unsigned long t4; + unsigned long t5; + unsigned long t6; }; -#endif /* __ASM_RISCV_SIGCONTEXT_H */ +#endif /* _ASM_RISCV_SIGCONTEXT_H */ diff --git a/linux-headers/include/asm/unistd.h b/linux-headers/include/asm/unistd.h index a216ab3..2ccd451 100644 --- a/linux-headers/include/asm/unistd.h +++ b/linux-headers/include/asm/unistd.h @@ -1,29 +1,9 @@ -#if !defined(_ASM_RISCV_UNISTD_H) || defined(__SYSCALL) -#define _ASM_RISCV_UNISTD_H - -#define __ARCH_HAVE_MMU -#define __ARCH_WANT_SYSCALL_NO_AT -#define __ARCH_WANT_SYSCALL_DEPRECATED -#define __ARCH_WANT_SYSCALL_OFF_T -#define __ARCH_WANT_SYSCALL_NO_FLAGS - -#define __ARCH_WANT_SYS_EXECVE -#define __ARCH_WANT_SYS_CLONE -#define __ARCH_WANT_SYS_VFORK -#define __ARCH_WANT_SYS_FORK - #include #define __NR_sysriscv __NR_arch_specific_syscall -#ifdef CONFIG_RV_SYSRISCV_ATOMIC +#ifndef __riscv_atomic __SYSCALL(__NR_sysriscv, sys_sysriscv) #endif -#define __NR_ipc 1080 -#undef __NR_syscalls -#define __NR_syscalls (__NR_ipc + 1) - #define RISCV_ATOMIC_CMPXCHG 1 #define RISCV_ATOMIC_CMPXCHG64 2 - -#endif /* _ASM_RISCV_UNISTD_H */ diff --git a/linux-headers/include/asm/user.h b/linux-headers/include/asm/user.h deleted file mode 100644 index e1a8ee2..0000000 --- a/linux-headers/include/asm/user.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef _ASM_RISCV_USER_H -#define _ASM_RISCV_USER_H - -/* Mirror pt_regs from ptrace.h */ - -typedef struct user_regs_struct { - unsigned long zero; - unsigned long ra; - unsigned long s[12]; - unsigned long sp; - unsigned long tp; - unsigned long v[2]; - unsigned long a[8]; - unsigned long t[5]; - unsigned long gp; - unsigned long status; -} user_regs_struct; - -#endif /* _ASM_RISCV_USER_H */ diff --git a/linux-headers/include/asm/vdso.h b/linux-headers/include/asm/vdso.h deleted file mode 100644 index b5ca21c..0000000 --- a/linux-headers/include/asm/vdso.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _ASM_RISCV_VDSO_H -#define _ASM_RISCV_VDSO_H - -#include - -struct vdso_data { -}; - -#define VDSO_SYMBOL(base, name) \ -({ \ - extern const char __vdso_##name[]; \ - (void *)((unsigned long)(base) + __vdso_##name); \ -}) - -#endif /* _ASM_RISCV_VDSO_H */ diff --git a/linux-headers/include/drm/vmwgfx_drm.h b/linux-headers/include/drm/vmwgfx_drm.h index 8c5e2d7..e602c64 100644 --- a/linux-headers/include/drm/vmwgfx_drm.h +++ b/linux-headers/include/drm/vmwgfx_drm.h @@ -28,7 +28,7 @@ #ifndef __VMWGFX_DRM_H__ #define __VMWGFX_DRM_H__ -#include +#include #define DRM_VMW_MAX_SURFACE_FACES 6 #define DRM_VMW_MAX_MIP_LEVELS 24 diff --git a/linux-headers/include/linux/in6.h b/linux-headers/include/linux/in6.h index b690d02..05189c3 100644 --- a/linux-headers/include/linux/in6.h +++ b/linux-headers/include/linux/in6.h @@ -149,7 +149,7 @@ struct in6_flowlabel_req { /* * IPV6 socket options */ - +#if __UAPI_DEF_IPV6_OPTIONS #define IPV6_ADDRFORM 1 #define IPV6_2292PKTINFO 2 #define IPV6_2292HOPOPTS 3 @@ -192,6 +192,7 @@ struct in6_flowlabel_req { #define IPV6_IPSEC_POLICY 34 #define IPV6_XFRM_POLICY 35 +#endif /* * Multicast: diff --git a/linux-headers/include/linux/libc-compat.h b/linux-headers/include/linux/libc-compat.h index 629e104..9e860a0 100644 --- a/linux-headers/include/linux/libc-compat.h +++ b/linux-headers/include/linux/libc-compat.h @@ -69,6 +69,7 @@ #define __UAPI_DEF_SOCKADDR_IN6 0 #define __UAPI_DEF_IPV6_MREQ 0 #define __UAPI_DEF_IPPROTO_V6 0 +#define __UAPI_DEF_IPV6_OPTIONS 0 #else @@ -82,6 +83,7 @@ #define __UAPI_DEF_SOCKADDR_IN6 1 #define __UAPI_DEF_IPV6_MREQ 1 #define __UAPI_DEF_IPPROTO_V6 1 +#define __UAPI_DEF_IPV6_OPTIONS 1 #endif /* _NETINET_IN_H */ @@ -103,6 +105,7 @@ #define __UAPI_DEF_SOCKADDR_IN6 1 #define __UAPI_DEF_IPV6_MREQ 1 #define __UAPI_DEF_IPPROTO_V6 1 +#define __UAPI_DEF_IPV6_OPTIONS 1 /* Definitions for xattr.h */ #define __UAPI_DEF_XATTR 1 diff --git a/linux-headers/include/linux/netfilter/xt_bpf.h b/linux-headers/include/linux/netfilter/xt_bpf.h index 5dda450..2ec9fbc 100644 --- a/linux-headers/include/linux/netfilter/xt_bpf.h +++ b/linux-headers/include/linux/netfilter/xt_bpf.h @@ -6,6 +6,8 @@ #define XT_BPF_MAX_NUM_INSTR 64 +struct sk_filter; + struct xt_bpf_info { __u16 bpf_program_num_elem; struct sock_filter bpf_program[XT_BPF_MAX_NUM_INSTR]; diff --git a/linux-headers/include/linux/usb/functionfs.h b/linux-headers/include/linux/usb/functionfs.h index a31b40c..71d4f8d 100644 --- a/linux-headers/include/linux/usb/functionfs.h +++ b/linux-headers/include/linux/usb/functionfs.h @@ -26,24 +26,18 @@ struct usb_endpoint_descriptor_no_audio { __u8 bInterval; } __attribute__((packed)); -/* Legacy format, deprecated as of 3.14. */ -struct usb_functionfs_descs_head { - __le32 magic; - __le32 length; - __le32 fs_count; - __le32 hs_count; -} __attribute__((packed, deprecated)); /* * All numbers must be in little endian order. */ +/* Legacy format, deprecated as of 3.14. */ struct usb_functionfs_descs_head { __le32 magic; __le32 length; __le32 fs_count; __le32 hs_count; -} __attribute__((packed)); +} __attribute__((packed, deprecated)); /* * Descriptors format: diff --git a/linux-headers/include/linux/version.h b/linux-headers/include/linux/version.h index 1d58748..81d4123 100644 --- a/linux-headers/include/linux/version.h +++ b/linux-headers/include/linux/version.h @@ -1,2 +1,2 @@ -#define LINUX_VERSION_CODE 200207 +#define LINUX_VERSION_CODE 200223 #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) diff --git a/linux-headers/include/linux/xattr.h b/linux-headers/include/linux/xattr.h index c7ad960..2634d03 100644 --- a/linux-headers/include/linux/xattr.h +++ b/linux-headers/include/linux/xattr.h @@ -13,7 +13,7 @@ #ifndef _LINUX_XATTR_H #define _LINUX_XATTR_H -#ifdef __UAPI_DEF_XATTR +#if __UAPI_DEF_XATTR #define __USE_KERNEL_XATTR_DEFS #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ diff --git a/linux-headers/include/rdma/rdma_user_cm.h b/linux-headers/include/rdma/rdma_user_cm.h index 99b80ab..3066718 100644 --- a/linux-headers/include/rdma/rdma_user_cm.h +++ b/linux-headers/include/rdma/rdma_user_cm.h @@ -34,6 +34,7 @@ #define RDMA_USER_CM_H #include +#include #include #include #include -- cgit v1.1