/drivers/include/uapi/asm/bitsperlong.h |
---|
0,0 → 1,13 |
#ifndef __ASM_X86_BITSPERLONG_H |
#define __ASM_X86_BITSPERLONG_H |
#if defined(__x86_64__) && !defined(__ILP32__) |
# define __BITS_PER_LONG 64 |
#else |
# define __BITS_PER_LONG 32 |
#endif |
#include <asm-generic/bitsperlong.h> |
#endif /* __ASM_X86_BITSPERLONG_H */ |
/drivers/include/uapi/asm/byteorder.h |
---|
0,0 → 1,6 |
#ifndef _ASM_X86_BYTEORDER_H |
#define _ASM_X86_BYTEORDER_H |
#include <linux/byteorder/little_endian.h> |
#endif /* _ASM_X86_BYTEORDER_H */ |
/drivers/include/uapi/asm/posix_types_32.h |
---|
0,0 → 1,25 |
#ifndef _ASM_X86_POSIX_TYPES_32_H |
#define _ASM_X86_POSIX_TYPES_32_H |
/* |
* This file is generally used by user-level software, so you need to |
* be a little careful about namespace pollution etc. Also, we cannot |
* assume GCC is being used. |
*/ |
typedef unsigned short __kernel_mode_t; |
#define __kernel_mode_t __kernel_mode_t |
typedef unsigned short __kernel_ipc_pid_t; |
#define __kernel_ipc_pid_t __kernel_ipc_pid_t |
typedef unsigned short __kernel_uid_t; |
typedef unsigned short __kernel_gid_t; |
#define __kernel_uid_t __kernel_uid_t |
typedef unsigned short __kernel_old_dev_t; |
#define __kernel_old_dev_t __kernel_old_dev_t |
#include <asm-generic/posix_types.h> |
#endif /* _ASM_X86_POSIX_TYPES_32_H */ |
/drivers/include/uapi/asm/posix_types_64.h |
---|
0,0 → 1,19 |
#ifndef _ASM_X86_POSIX_TYPES_64_H |
#define _ASM_X86_POSIX_TYPES_64_H |
/* |
* This file is generally used by user-level software, so you need to |
* be a little careful about namespace pollution etc. Also, we cannot |
* assume GCC is being used. |
*/ |
typedef unsigned short __kernel_old_uid_t; |
typedef unsigned short __kernel_old_gid_t; |
#define __kernel_old_uid_t __kernel_old_uid_t |
typedef unsigned long __kernel_old_dev_t; |
#define __kernel_old_dev_t __kernel_old_dev_t |
#include <asm-generic/posix_types.h> |
#endif /* _ASM_X86_POSIX_TYPES_64_H */ |
/drivers/include/uapi/asm/posix_types_x32.h |
---|
0,0 → 1,19 |
#ifndef _ASM_X86_POSIX_TYPES_X32_H |
#define _ASM_X86_POSIX_TYPES_X32_H |
/* |
* This file is only used by user-level software, so you need to |
* be a little careful about namespace pollution etc. Also, we cannot |
* assume GCC is being used. |
* |
* These types should generally match the ones used by the 64-bit kernel, |
* |
*/ |
typedef long long __kernel_long_t; |
typedef unsigned long long __kernel_ulong_t; |
#define __kernel_long_t __kernel_long_t |
#include <asm/posix_types_64.h> |
#endif /* _ASM_X86_POSIX_TYPES_X32_H */ |
/drivers/include/uapi/asm/processor-flags.h |
---|
118,6 → 118,8 |
#define X86_CR4_SMEP _BITUL(X86_CR4_SMEP_BIT) |
#define X86_CR4_SMAP_BIT 21 /* enable SMAP support */ |
#define X86_CR4_SMAP _BITUL(X86_CR4_SMAP_BIT) |
#define X86_CR4_PKE_BIT 22 /* enable Protection Keys support */ |
#define X86_CR4_PKE _BITUL(X86_CR4_PKE_BIT) |
/* |
* x86-64 Task Priority Register, CR8 |
/drivers/include/uapi/asm/sigcontext.h |
---|
256,7 → 256,7 |
__u16 cs; |
__u16 gs; |
__u16 fs; |
__u16 __pad0; |
__u16 ss; |
__u64 err; |
__u64 trapno; |
__u64 oldmask; |
341,9 → 341,37 |
__u64 rip; |
__u64 eflags; /* RFLAGS */ |
__u16 cs; |
/* |
* Prior to 2.5.64 ("[PATCH] x86-64 updates for 2.5.64-bk3"), |
* Linux saved and restored fs and gs in these slots. This |
* was counterproductive, as fsbase and gsbase were never |
* saved, so arch_prctl was presumably unreliable. |
* |
* These slots should never be reused without extreme caution: |
* |
* - Some DOSEMU versions stash fs and gs in these slots manually, |
* thus overwriting anything the kernel expects to be preserved |
* in these slots. |
* |
* - If these slots are ever needed for any other purpose, |
* there is some risk that very old 64-bit binaries could get |
* confused. I doubt that many such binaries still work, |
* though, since the same patch in 2.5.64 also removed the |
* 64-bit set_thread_area syscall, so it appears that there |
* is no TLS API beyond modify_ldt that works in both pre- |
* and post-2.5.64 kernels. |
* |
* If the kernel ever adds explicit fs, gs, fsbase, and gsbase |
* save/restore, it will most likely need to be opt-in and use |
* different context slots. |
*/ |
__u16 gs; |
__u16 fs; |
__u16 __pad0; |
union { |
__u16 ss; /* If UC_SIGCONTEXT_SS */ |
__u16 __pad0; /* Alias name for old (!UC_SIGCONTEXT_SS) user-space */ |
}; |
__u64 err; |
__u64 trapno; |
__u64 oldmask; |
/drivers/include/uapi/asm/stat.h |
---|
0,0 → 1,137 |
#ifndef _ASM_X86_STAT_H |
#define _ASM_X86_STAT_H |
#include <asm/posix_types.h> |
#define STAT_HAVE_NSEC 1 |
#ifdef __i386__ |
struct stat { |
unsigned long st_dev; |
unsigned long st_ino; |
unsigned short st_mode; |
unsigned short st_nlink; |
unsigned short st_uid; |
unsigned short st_gid; |
unsigned long st_rdev; |
unsigned long st_size; |
unsigned long st_blksize; |
unsigned long st_blocks; |
unsigned long st_atime; |
unsigned long st_atime_nsec; |
unsigned long st_mtime; |
unsigned long st_mtime_nsec; |
unsigned long st_ctime; |
unsigned long st_ctime_nsec; |
unsigned long __unused4; |
unsigned long __unused5; |
}; |
/* We don't need to memset the whole thing just to initialize the padding */ |
#define INIT_STRUCT_STAT_PADDING(st) do { \ |
st.__unused4 = 0; \ |
st.__unused5 = 0; \ |
} while (0) |
#define STAT64_HAS_BROKEN_ST_INO 1 |
/* This matches struct stat64 in glibc2.1, hence the absolutely |
* insane amounts of padding around dev_t's. |
*/ |
struct stat64 { |
unsigned long long st_dev; |
unsigned char __pad0[4]; |
unsigned long __st_ino; |
unsigned int st_mode; |
unsigned int st_nlink; |
unsigned long st_uid; |
unsigned long st_gid; |
unsigned long long st_rdev; |
unsigned char __pad3[4]; |
long long st_size; |
unsigned long st_blksize; |
/* Number 512-byte blocks allocated. */ |
unsigned long long st_blocks; |
unsigned long st_atime; |
unsigned long st_atime_nsec; |
unsigned long st_mtime; |
unsigned int st_mtime_nsec; |
unsigned long st_ctime; |
unsigned long st_ctime_nsec; |
unsigned long long st_ino; |
}; |
/* We don't need to memset the whole thing just to initialize the padding */ |
#define INIT_STRUCT_STAT64_PADDING(st) do { \ |
memset(&st.__pad0, 0, sizeof(st.__pad0)); \ |
memset(&st.__pad3, 0, sizeof(st.__pad3)); \ |
} while (0) |
#else /* __i386__ */ |
struct stat { |
__kernel_ulong_t st_dev; |
__kernel_ulong_t st_ino; |
__kernel_ulong_t st_nlink; |
unsigned int st_mode; |
unsigned int st_uid; |
unsigned int st_gid; |
unsigned int __pad0; |
__kernel_ulong_t st_rdev; |
__kernel_long_t st_size; |
__kernel_long_t st_blksize; |
__kernel_long_t st_blocks; /* Number 512-byte blocks allocated. */ |
__kernel_ulong_t st_atime; |
__kernel_ulong_t st_atime_nsec; |
__kernel_ulong_t st_mtime; |
__kernel_ulong_t st_mtime_nsec; |
__kernel_ulong_t st_ctime; |
__kernel_ulong_t st_ctime_nsec; |
__kernel_long_t __unused[3]; |
}; |
/* We don't need to memset the whole thing just to initialize the padding */ |
#define INIT_STRUCT_STAT_PADDING(st) do { \ |
st.__pad0 = 0; \ |
st.__unused[0] = 0; \ |
st.__unused[1] = 0; \ |
st.__unused[2] = 0; \ |
} while (0) |
#endif |
/* for 32bit emulation and 32 bit kernels */ |
struct __old_kernel_stat { |
unsigned short st_dev; |
unsigned short st_ino; |
unsigned short st_mode; |
unsigned short st_nlink; |
unsigned short st_uid; |
unsigned short st_gid; |
unsigned short st_rdev; |
#ifdef __i386__ |
unsigned long st_size; |
unsigned long st_atime; |
unsigned long st_mtime; |
unsigned long st_ctime; |
#else |
unsigned int st_size; |
unsigned int st_atime; |
unsigned int st_mtime; |
unsigned int st_ctime; |
#endif |
}; |
#endif /* _ASM_X86_STAT_H */ |
/drivers/include/uapi/asm/swab.h |
---|
0,0 → 1,36 |
#ifndef _ASM_X86_SWAB_H |
#define _ASM_X86_SWAB_H |
#include <linux/types.h> |
#include <linux/compiler.h> |
static inline __attribute_const__ __u32 __arch_swab32(__u32 val) |
{ |
asm("bswapl %0" : "=r" (val) : "0" (val)); |
return val; |
} |
#define __arch_swab32 __arch_swab32 |
static inline __attribute_const__ __u64 __arch_swab64(__u64 val) |
{ |
#ifdef __i386__ |
union { |
struct { |
__u32 a; |
__u32 b; |
} s; |
__u64 u; |
} v; |
v.u = val; |
asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1" |
: "=r" (v.s.a), "=r" (v.s.b) |
: "0" (v.s.a), "1" (v.s.b)); |
return v.u; |
#else /* __i386__ */ |
asm("bswapq %0" : "=r" (val) : "0" (val)); |
return val; |
#endif |
} |
#define __arch_swab64 __arch_swab64 |
#endif /* _ASM_X86_SWAB_H */ |
/drivers/include/uapi/asm/types.h |
---|
0,0 → 1,6 |
#ifndef _ASM_X86_TYPES_H |
#define _ASM_X86_TYPES_H |
#include <asm-generic/types.h> |
#endif /* _ASM_X86_TYPES_H */ |
/drivers/include/uapi/drm/drm.h |
---|
669,6 → 669,7 |
__u64 value; |
}; |
#define DRM_RDWR O_RDWR |
#define DRM_CLOEXEC O_CLOEXEC |
struct drm_prime_handle { |
__u32 handle; |
/drivers/include/uapi/drm/drm_mode.h |
---|
487,6 → 487,21 |
__u64 blue; |
}; |
struct drm_color_ctm { |
/* Conversion matrix in S31.32 format. */ |
__s64 matrix[9]; |
}; |
struct drm_color_lut { |
/* |
* Data is U0.16 fixed point format. |
*/ |
__u16 red; |
__u16 green; |
__u16 blue; |
__u16 reserved; |
}; |
#define DRM_MODE_PAGE_FLIP_EVENT 0x01 |
#define DRM_MODE_PAGE_FLIP_ASYNC 0x02 |
#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT|DRM_MODE_PAGE_FLIP_ASYNC) |
/drivers/include/uapi/drm/i915_drm.h |
---|
772,10 → 772,12 |
#define I915_EXEC_HANDLE_LUT (1<<12) |
/** Used for switching BSD rings on the platforms with two BSD rings */ |
#define I915_EXEC_BSD_MASK (3<<13) |
#define I915_EXEC_BSD_DEFAULT (0<<13) /* default ping-pong mode */ |
#define I915_EXEC_BSD_RING1 (1<<13) |
#define I915_EXEC_BSD_RING2 (2<<13) |
#define I915_EXEC_BSD_SHIFT (13) |
#define I915_EXEC_BSD_MASK (3 << I915_EXEC_BSD_SHIFT) |
/* default ping-pong mode */ |
#define I915_EXEC_BSD_DEFAULT (0 << I915_EXEC_BSD_SHIFT) |
#define I915_EXEC_BSD_RING1 (1 << I915_EXEC_BSD_SHIFT) |
#define I915_EXEC_BSD_RING2 (2 << I915_EXEC_BSD_SHIFT) |
/** Tell the kernel that the batchbuffer is processed by |
* the resource streamer. |
812,10 → 814,35 |
/** Handle of the buffer to check for busy */ |
__u32 handle; |
/** Return busy status (1 if busy, 0 if idle). |
* The high word is used to indicate on which rings the object |
* currently resides: |
* 16:31 - busy (r or r/w) rings (16 render, 17 bsd, 18 blt, etc) |
/** Return busy status |
* |
* A return of 0 implies that the object is idle (after |
* having flushed any pending activity), and a non-zero return that |
* the object is still in-flight on the GPU. (The GPU has not yet |
* signaled completion for all pending requests that reference the |
* object.) |
* |
* The returned dword is split into two fields to indicate both |
* the engines on which the object is being read, and the |
* engine on which it is currently being written (if any). |
* |
* The low word (bits 0:15) indicate if the object is being written |
* to by any engine (there can only be one, as the GEM implicit |
* synchronisation rules force writes to be serialised). Only the |
* engine for the last write is reported. |
* |
* The high word (bits 16:31) are a bitmask of which engines are |
* currently reading from the object. Multiple engines may be |
* reading from the object simultaneously. |
* |
* The value of each engine is the same as specified in the |
* EXECBUFFER2 ioctl, i.e. I915_EXEC_RENDER, I915_EXEC_BSD etc. |
* Note I915_EXEC_DEFAULT is a symbolic value and is mapped to |
* the I915_EXEC_RENDER engine for execution, and so it is never |
* reported as active itself. Some hardware may have parallel |
* execution engines, e.g. multiple media engines, which are |
* mapped to the same identifier in the EXECBUFFER2 ioctl and |
* so are not separately reported for busyness. |
*/ |
__u32 busy; |
}; |
/drivers/include/uapi/linux/byteorder/little_endian.h |
---|
40,51 → 40,51 |
#define __cpu_to_be16(x) ((__force __be16)__swab16((x))) |
#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x)) |
static inline __le64 __cpu_to_le64p(const __u64 *p) |
static __always_inline __le64 __cpu_to_le64p(const __u64 *p) |
{ |
return (__force __le64)*p; |
} |
static inline __u64 __le64_to_cpup(const __le64 *p) |
static __always_inline __u64 __le64_to_cpup(const __le64 *p) |
{ |
return (__force __u64)*p; |
} |
static inline __le32 __cpu_to_le32p(const __u32 *p) |
static __always_inline __le32 __cpu_to_le32p(const __u32 *p) |
{ |
return (__force __le32)*p; |
} |
static inline __u32 __le32_to_cpup(const __le32 *p) |
static __always_inline __u32 __le32_to_cpup(const __le32 *p) |
{ |
return (__force __u32)*p; |
} |
static inline __le16 __cpu_to_le16p(const __u16 *p) |
static __always_inline __le16 __cpu_to_le16p(const __u16 *p) |
{ |
return (__force __le16)*p; |
} |
static inline __u16 __le16_to_cpup(const __le16 *p) |
static __always_inline __u16 __le16_to_cpup(const __le16 *p) |
{ |
return (__force __u16)*p; |
} |
static inline __be64 __cpu_to_be64p(const __u64 *p) |
static __always_inline __be64 __cpu_to_be64p(const __u64 *p) |
{ |
return (__force __be64)__swab64p(p); |
} |
static inline __u64 __be64_to_cpup(const __be64 *p) |
static __always_inline __u64 __be64_to_cpup(const __be64 *p) |
{ |
return __swab64p((__u64 *)p); |
} |
static inline __be32 __cpu_to_be32p(const __u32 *p) |
static __always_inline __be32 __cpu_to_be32p(const __u32 *p) |
{ |
return (__force __be32)__swab32p(p); |
} |
static inline __u32 __be32_to_cpup(const __be32 *p) |
static __always_inline __u32 __be32_to_cpup(const __be32 *p) |
{ |
return __swab32p((__u32 *)p); |
} |
static inline __be16 __cpu_to_be16p(const __u16 *p) |
static __always_inline __be16 __cpu_to_be16p(const __u16 *p) |
{ |
return (__force __be16)__swab16p(p); |
} |
static inline __u16 __be16_to_cpup(const __be16 *p) |
static __always_inline __u16 __be16_to_cpup(const __be16 *p) |
{ |
return __swab16p((__u16 *)p); |
} |
/drivers/include/uapi/linux/kernel.h |
---|
1,7 → 1,7 |
#ifndef _UAPI_LINUX_KERNEL_H |
#define _UAPI_LINUX_KERNEL_H |
//#include <linux/sysinfo.h> |
#include <linux/sysinfo.h> |
/* |
* 'kernel.h' contains some often-used function prototypes etc |
9,5 → 9,6 |
#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) |
#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) |
#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) |
#endif /* _UAPI_LINUX_KERNEL_H */ |
/drivers/include/uapi/linux/stat.h |
---|
0,0 → 1,45 |
#ifndef _UAPI_LINUX_STAT_H |
#define _UAPI_LINUX_STAT_H |
#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) |
#define S_IFMT 00170000 |
#define S_IFSOCK 0140000 |
#define S_IFLNK 0120000 |
#define S_IFREG 0100000 |
#define S_IFBLK 0060000 |
#define S_IFDIR 0040000 |
#define S_IFCHR 0020000 |
#define S_IFIFO 0010000 |
#define S_ISUID 0004000 |
#define S_ISGID 0002000 |
#define S_ISVTX 0001000 |
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) |
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) |
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) |
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) |
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) |
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) |
#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) |
#define S_IRWXU 00700 |
#define S_IRUSR 00400 |
#define S_IWUSR 00200 |
#define S_IXUSR 00100 |
#define S_IRWXG 00070 |
#define S_IRGRP 00040 |
#define S_IWGRP 00020 |
#define S_IXGRP 00010 |
#define S_IRWXO 00007 |
#define S_IROTH 00004 |
#define S_IWOTH 00002 |
#define S_IXOTH 00001 |
#endif |
#endif /* _UAPI_LINUX_STAT_H */ |
/drivers/include/uapi/linux/stddef.h |
---|
1,0 → 0,0 |
#include <linux/compiler.h> |
#ifndef __always_inline |
#define __always_inline inline |
#endif |
/drivers/include/uapi/linux/swab.h |
---|
45,9 → 45,7 |
static inline __attribute_const__ __u16 __fswab16(__u16 val) |
{ |
#ifdef __HAVE_BUILTIN_BSWAP16__ |
return __builtin_bswap16(val); |
#elif defined (__arch_swab16) |
#if defined (__arch_swab16) |
return __arch_swab16(val); |
#else |
return ___constant_swab16(val); |
56,9 → 54,7 |
static inline __attribute_const__ __u32 __fswab32(__u32 val) |
{ |
#ifdef __HAVE_BUILTIN_BSWAP32__ |
return __builtin_bswap32(val); |
#elif defined(__arch_swab32) |
#if defined(__arch_swab32) |
return __arch_swab32(val); |
#else |
return ___constant_swab32(val); |
67,9 → 63,7 |
static inline __attribute_const__ __u64 __fswab64(__u64 val) |
{ |
#ifdef __HAVE_BUILTIN_BSWAP64__ |
return __builtin_bswap64(val); |
#elif defined (__arch_swab64) |
#if defined (__arch_swab64) |
return __arch_swab64(val); |
#elif defined(__SWAB_64_THRU_32__) |
__u32 h = val >> 32; |
102,28 → 96,40 |
* __swab16 - return a byteswapped 16-bit value |
* @x: value to byteswap |
*/ |
#ifdef __HAVE_BUILTIN_BSWAP16__ |
#define __swab16(x) (__u16)__builtin_bswap16((__u16)(x)) |
#else |
#define __swab16(x) \ |
(__builtin_constant_p((__u16)(x)) ? \ |
___constant_swab16(x) : \ |
__fswab16(x)) |
#endif |
/** |
* __swab32 - return a byteswapped 32-bit value |
* @x: value to byteswap |
*/ |
#ifdef __HAVE_BUILTIN_BSWAP32__ |
#define __swab32(x) (__u32)__builtin_bswap32((__u32)(x)) |
#else |
#define __swab32(x) \ |
(__builtin_constant_p((__u32)(x)) ? \ |
___constant_swab32(x) : \ |
__fswab32(x)) |
#endif |
/** |
* __swab64 - return a byteswapped 64-bit value |
* @x: value to byteswap |
*/ |
#ifdef __HAVE_BUILTIN_BSWAP64__ |
#define __swab64(x) (__u64)__builtin_bswap64((__u64)(x)) |
#else |
#define __swab64(x) \ |
(__builtin_constant_p((__u64)(x)) ? \ |
___constant_swab64(x) : \ |
__fswab64(x)) |
#endif |
/** |
* __swahw32 - return a word-swapped 32-bit value |
151,7 → 157,7 |
* __swab16p - return a byteswapped 16-bit value from a pointer |
* @p: pointer to a naturally-aligned 16-bit value |
*/ |
static inline __u16 __swab16p(const __u16 *p) |
static __always_inline __u16 __swab16p(const __u16 *p) |
{ |
#ifdef __arch_swab16p |
return __arch_swab16p(p); |
164,7 → 170,7 |
* __swab32p - return a byteswapped 32-bit value from a pointer |
* @p: pointer to a naturally-aligned 32-bit value |
*/ |
static inline __u32 __swab32p(const __u32 *p) |
static __always_inline __u32 __swab32p(const __u32 *p) |
{ |
#ifdef __arch_swab32p |
return __arch_swab32p(p); |
177,7 → 183,7 |
* __swab64p - return a byteswapped 64-bit value from a pointer |
* @p: pointer to a naturally-aligned 64-bit value |
*/ |
static inline __u64 __swab64p(const __u64 *p) |
static __always_inline __u64 __swab64p(const __u64 *p) |
{ |
#ifdef __arch_swab64p |
return __arch_swab64p(p); |
232,7 → 238,7 |
* __swab32s - byteswap a 32-bit value in-place |
* @p: pointer to a naturally-aligned 32-bit value |
*/ |
static inline void __swab32s(__u32 *p) |
static __always_inline void __swab32s(__u32 *p) |
{ |
#ifdef __arch_swab32s |
__arch_swab32s(p); |
245,7 → 251,7 |
* __swab64s - byteswap a 64-bit value in-place |
* @p: pointer to a naturally-aligned 64-bit value |
*/ |
static inline void __swab64s(__u64 *p) |
static __always_inline void __swab64s(__u64 *p) |
{ |
#ifdef __arch_swab64s |
__arch_swab64s(p); |