Browse Source

linux-headers: Synchronize with UAPI split

This update removes definitions internal to kernel space from asm
headers exported to user space.
pull/21/head
Albert Ou 11 years ago
parent
commit
edd661f68c
  1. 1
      linux-headers/include/asm/asm-offsets.h
  2. 8
      linux-headers/include/asm/auxvec.h
  3. 25
      linux-headers/include/asm/bitsperlong.h
  4. 125
      linux-headers/include/asm/csr.h
  5. 65
      linux-headers/include/asm/ptrace.h
  6. 42
      linux-headers/include/asm/sigcontext.h
  7. 22
      linux-headers/include/asm/unistd.h
  8. 19
      linux-headers/include/asm/user.h
  9. 15
      linux-headers/include/asm/vdso.h
  10. 2
      linux-headers/include/drm/vmwgfx_drm.h
  11. 3
      linux-headers/include/linux/in6.h
  12. 3
      linux-headers/include/linux/libc-compat.h
  13. 2
      linux-headers/include/linux/netfilter/xt_bpf.h
  14. 10
      linux-headers/include/linux/usb/functionfs.h
  15. 2
      linux-headers/include/linux/version.h
  16. 2
      linux-headers/include/linux/xattr.h
  17. 1
      linux-headers/include/rdma/rdma_user_cm.h

1
linux-headers/include/asm/asm-offsets.h

@ -1 +0,0 @@
#include <generated/asm-offsets.h>

8
linux-headers/include/asm/auxvec.h

@ -1 +1,7 @@
#include <asm-generic/auxvec.h> #ifndef _ASM_RISCV_AUXVEC_H
#define _ASM_RISCV_AUXVEC_H
/* vDSO location */
#define AT_SYSINFO_EHDR 33
#endif /* _ASM_RISCV_AUXVEC_H */

25
linux-headers/include/asm/bitsperlong.h

@ -1,21 +1,8 @@
#ifndef __ASM_RISCV_BITS_PER_LONG #ifndef _ASM_RISCV_BITSPERLONG_H
#define __ASM_RISCV_BITS_PER_LONG #define _ASM_RISCV_BITSPERLONG_H
/* #define __BITS_PER_LONG _RISCV_SZLONG
* 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 */
#endif /* __ASM_RISCV_BITS_PER_LONG */ #include <asm-generic/bitsperlong.h>
#endif /* _ASM_RISCV_BITSPERLONG_H */

125
linux-headers/include/asm/csr.h

@ -1,125 +0,0 @@
#ifndef _ASM_RISCV_CSR_H
#define _ASM_RISCV_CSR_H
#include <linux/const.h>
/* 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 */

65
linux-headers/include/asm/ptrace.h

@ -1,12 +1,10 @@
#ifndef _ASM_RISCV_PTRACE_H #ifndef _ASM_RISCV_PTRACE_H
#define _ASM_RISCV_PTRACE_H #define _ASM_RISCV_PTRACE_H
#include <asm/csr.h> /* Mirror pt_regs from ptrace.h */
#ifndef __ASSEMBLY__ typedef struct user_regs_struct {
unsigned long pc;
typedef struct pt_regs {
unsigned long zero;
unsigned long ra; unsigned long ra;
unsigned long s[12]; unsigned long s[12];
unsigned long sp; unsigned long sp;
@ -15,62 +13,7 @@ typedef struct pt_regs {
unsigned long a[8]; unsigned long a[8];
unsigned long t[5]; unsigned long t[5];
unsigned long gp; unsigned long gp;
/* PCRs */
unsigned long status; unsigned long status;
unsigned long epc; } user_regs_struct;
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__ */
#endif /* _ASM_RISCV_PTRACE_H */ #endif /* _ASM_RISCV_PTRACE_H */

42
linux-headers/include/asm/sigcontext.h

@ -1,21 +1,43 @@
#ifndef __ASM_RISCV_SIGCONTEXT_H #ifndef _ASM_RISCV_SIGCONTEXT_H
#define __ASM_RISCV_SIGCONTEXT_H #define _ASM_RISCV_SIGCONTEXT_H
/* This struct is saved by setup_frame in signal.c, to keep the current /* 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. * context while a signal handler is executed. It is restored by sys_sigreturn.
*/ */
struct sigcontext { struct sigcontext {
unsigned long zero; unsigned long epc;
unsigned long ra; unsigned long ra;
unsigned long s[12];
unsigned long sp; unsigned long sp;
unsigned long tp;
unsigned long v[2];
unsigned long a[8];
unsigned long t[5];
unsigned long gp; 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 */

22
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 <asm-generic/unistd.h> #include <asm-generic/unistd.h>
#define __NR_sysriscv __NR_arch_specific_syscall #define __NR_sysriscv __NR_arch_specific_syscall
#ifdef CONFIG_RV_SYSRISCV_ATOMIC #ifndef __riscv_atomic
__SYSCALL(__NR_sysriscv, sys_sysriscv) __SYSCALL(__NR_sysriscv, sys_sysriscv)
#endif #endif
#define __NR_ipc 1080
#undef __NR_syscalls
#define __NR_syscalls (__NR_ipc + 1)
#define RISCV_ATOMIC_CMPXCHG 1 #define RISCV_ATOMIC_CMPXCHG 1
#define RISCV_ATOMIC_CMPXCHG64 2 #define RISCV_ATOMIC_CMPXCHG64 2
#endif /* _ASM_RISCV_UNISTD_H */

19
linux-headers/include/asm/user.h

@ -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 */

15
linux-headers/include/asm/vdso.h

@ -1,15 +0,0 @@
#ifndef _ASM_RISCV_VDSO_H
#define _ASM_RISCV_VDSO_H
#include <linux/types.h>
struct vdso_data {
};
#define VDSO_SYMBOL(base, name) \
({ \
extern const char __vdso_##name[]; \
(void *)((unsigned long)(base) + __vdso_##name); \
})
#endif /* _ASM_RISCV_VDSO_H */

2
linux-headers/include/drm/vmwgfx_drm.h

@ -28,7 +28,7 @@
#ifndef __VMWGFX_DRM_H__ #ifndef __VMWGFX_DRM_H__
#define __VMWGFX_DRM_H__ #define __VMWGFX_DRM_H__
#include <drm.h> #include <drm/drm.h>
#define DRM_VMW_MAX_SURFACE_FACES 6 #define DRM_VMW_MAX_SURFACE_FACES 6
#define DRM_VMW_MAX_MIP_LEVELS 24 #define DRM_VMW_MAX_MIP_LEVELS 24

3
linux-headers/include/linux/in6.h

@ -149,7 +149,7 @@ struct in6_flowlabel_req {
/* /*
* IPV6 socket options * IPV6 socket options
*/ */
#if __UAPI_DEF_IPV6_OPTIONS
#define IPV6_ADDRFORM 1 #define IPV6_ADDRFORM 1
#define IPV6_2292PKTINFO 2 #define IPV6_2292PKTINFO 2
#define IPV6_2292HOPOPTS 3 #define IPV6_2292HOPOPTS 3
@ -192,6 +192,7 @@ struct in6_flowlabel_req {
#define IPV6_IPSEC_POLICY 34 #define IPV6_IPSEC_POLICY 34
#define IPV6_XFRM_POLICY 35 #define IPV6_XFRM_POLICY 35
#endif
/* /*
* Multicast: * Multicast:

3
linux-headers/include/linux/libc-compat.h

@ -69,6 +69,7 @@
#define __UAPI_DEF_SOCKADDR_IN6 0 #define __UAPI_DEF_SOCKADDR_IN6 0
#define __UAPI_DEF_IPV6_MREQ 0 #define __UAPI_DEF_IPV6_MREQ 0
#define __UAPI_DEF_IPPROTO_V6 0 #define __UAPI_DEF_IPPROTO_V6 0
#define __UAPI_DEF_IPV6_OPTIONS 0
#else #else
@ -82,6 +83,7 @@
#define __UAPI_DEF_SOCKADDR_IN6 1 #define __UAPI_DEF_SOCKADDR_IN6 1
#define __UAPI_DEF_IPV6_MREQ 1 #define __UAPI_DEF_IPV6_MREQ 1
#define __UAPI_DEF_IPPROTO_V6 1 #define __UAPI_DEF_IPPROTO_V6 1
#define __UAPI_DEF_IPV6_OPTIONS 1
#endif /* _NETINET_IN_H */ #endif /* _NETINET_IN_H */
@ -103,6 +105,7 @@
#define __UAPI_DEF_SOCKADDR_IN6 1 #define __UAPI_DEF_SOCKADDR_IN6 1
#define __UAPI_DEF_IPV6_MREQ 1 #define __UAPI_DEF_IPV6_MREQ 1
#define __UAPI_DEF_IPPROTO_V6 1 #define __UAPI_DEF_IPPROTO_V6 1
#define __UAPI_DEF_IPV6_OPTIONS 1
/* Definitions for xattr.h */ /* Definitions for xattr.h */
#define __UAPI_DEF_XATTR 1 #define __UAPI_DEF_XATTR 1

2
linux-headers/include/linux/netfilter/xt_bpf.h

@ -6,6 +6,8 @@
#define XT_BPF_MAX_NUM_INSTR 64 #define XT_BPF_MAX_NUM_INSTR 64
struct sk_filter;
struct xt_bpf_info { struct xt_bpf_info {
__u16 bpf_program_num_elem; __u16 bpf_program_num_elem;
struct sock_filter bpf_program[XT_BPF_MAX_NUM_INSTR]; struct sock_filter bpf_program[XT_BPF_MAX_NUM_INSTR];

10
linux-headers/include/linux/usb/functionfs.h

@ -26,24 +26,18 @@ struct usb_endpoint_descriptor_no_audio {
__u8 bInterval; __u8 bInterval;
} __attribute__((packed)); } __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. * All numbers must be in little endian order.
*/ */
/* Legacy format, deprecated as of 3.14. */
struct usb_functionfs_descs_head { struct usb_functionfs_descs_head {
__le32 magic; __le32 magic;
__le32 length; __le32 length;
__le32 fs_count; __le32 fs_count;
__le32 hs_count; __le32 hs_count;
} __attribute__((packed)); } __attribute__((packed, deprecated));
/* /*
* Descriptors format: * Descriptors format:

2
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)) #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

2
linux-headers/include/linux/xattr.h

@ -13,7 +13,7 @@
#ifndef _LINUX_XATTR_H #ifndef _LINUX_XATTR_H
#define _LINUX_XATTR_H #define _LINUX_XATTR_H
#ifdef __UAPI_DEF_XATTR #if __UAPI_DEF_XATTR
#define __USE_KERNEL_XATTR_DEFS #define __USE_KERNEL_XATTR_DEFS
#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */

1
linux-headers/include/rdma/rdma_user_cm.h

@ -34,6 +34,7 @@
#define RDMA_USER_CM_H #define RDMA_USER_CM_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/socket.h>
#include <linux/in6.h> #include <linux/in6.h>
#include <rdma/ib_user_verbs.h> #include <rdma/ib_user_verbs.h>
#include <rdma/ib_user_sa.h> #include <rdma/ib_user_sa.h>

Loading…
Cancel
Save