Browse Source
This update removes definitions internal to kernel space from asm headers exported to user space.pull/21/head
17 changed files with 63 additions and 284 deletions
@ -1 +0,0 @@ |
|||||
#include <generated/asm-offsets.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 */ |
||||
|
|||||
@ -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 */ |
||||
|
|||||
@ -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 */ |
|
||||
@ -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 */ |
||||
|
|||||
@ -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 */ |
|
||||
@ -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 */ |
|
||||
@ -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)) |
||||
|
|||||
Loading…
Reference in new issue