auto import from //depot/cupcake/@135843
This commit is contained in:
220
libc/kernel/common/linux/a.out.h
Normal file
220
libc/kernel/common/linux/a.out.h
Normal file
@@ -0,0 +1,220 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __A_OUT_GNU_H__
|
||||
#define __A_OUT_GNU_H__
|
||||
|
||||
#define __GNU_EXEC_MACROS__
|
||||
|
||||
#ifndef __STRUCT_EXEC_OVERRIDE__
|
||||
|
||||
#include <asm/a.out.h>
|
||||
|
||||
#endif
|
||||
|
||||
enum machine_type {
|
||||
#ifdef M_OLDSUN2
|
||||
M__OLDSUN2 = M_OLDSUN2,
|
||||
#else
|
||||
M_OLDSUN2 = 0,
|
||||
#endif
|
||||
#ifdef M_68010
|
||||
M__68010 = M_68010,
|
||||
#else
|
||||
M_68010 = 1,
|
||||
#endif
|
||||
#ifdef M_68020
|
||||
M__68020 = M_68020,
|
||||
#else
|
||||
M_68020 = 2,
|
||||
#endif
|
||||
#ifdef M_SPARC
|
||||
M__SPARC = M_SPARC,
|
||||
#else
|
||||
M_SPARC = 3,
|
||||
#endif
|
||||
|
||||
M_386 = 100,
|
||||
M_MIPS1 = 151,
|
||||
M_MIPS2 = 152
|
||||
};
|
||||
|
||||
#ifndef N_MAGIC
|
||||
#define N_MAGIC(exec) ((exec).a_info & 0xffff)
|
||||
#endif
|
||||
#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
|
||||
#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
|
||||
#define N_SET_INFO(exec, magic, type, flags) ((exec).a_info = ((magic) & 0xffff) | (((int)(type) & 0xff) << 16) | (((flags) & 0xff) << 24))
|
||||
#define N_SET_MAGIC(exec, magic) ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff)))
|
||||
|
||||
#define N_SET_MACHTYPE(exec, machtype) ((exec).a_info = ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
|
||||
|
||||
#define N_SET_FLAGS(exec, flags) ((exec).a_info = ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
|
||||
|
||||
#define OMAGIC 0407
|
||||
|
||||
#define NMAGIC 0410
|
||||
|
||||
#define ZMAGIC 0413
|
||||
|
||||
#define QMAGIC 0314
|
||||
|
||||
#define CMAGIC 0421
|
||||
|
||||
#ifndef N_BADMAG
|
||||
#define N_BADMAG(x) (N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC && N_MAGIC(x) != ZMAGIC && N_MAGIC(x) != QMAGIC)
|
||||
#endif
|
||||
|
||||
#define _N_HDROFF(x) (1024 - sizeof (struct exec))
|
||||
|
||||
#ifndef N_TXTOFF
|
||||
#define N_TXTOFF(x) (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec)))
|
||||
#endif
|
||||
|
||||
#ifndef N_DATOFF
|
||||
#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text)
|
||||
#endif
|
||||
|
||||
#ifndef N_TRELOFF
|
||||
#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
|
||||
#endif
|
||||
|
||||
#ifndef N_DRELOFF
|
||||
#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x))
|
||||
#endif
|
||||
|
||||
#ifndef N_SYMOFF
|
||||
#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x))
|
||||
#endif
|
||||
|
||||
#ifndef N_STROFF
|
||||
#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x))
|
||||
#endif
|
||||
|
||||
#ifndef N_TXTADDR
|
||||
#define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? PAGE_SIZE : 0)
|
||||
#endif
|
||||
|
||||
#if defined(vax) || defined(hp300) || defined(pyr)
|
||||
#define SEGMENT_SIZE page_size
|
||||
#endif
|
||||
#ifdef sony
|
||||
#define SEGMENT_SIZE 0x2000
|
||||
#endif
|
||||
#ifdef is68k
|
||||
#define SEGMENT_SIZE 0x20000
|
||||
#endif
|
||||
#if defined(m68k) && defined(PORTAR)
|
||||
#define PAGE_SIZE 0x400
|
||||
#define SEGMENT_SIZE PAGE_SIZE
|
||||
#endif
|
||||
|
||||
#ifdef linux
|
||||
#include <asm/page.h>
|
||||
#if defined(__i386__) || defined(__mc68000__)
|
||||
#define SEGMENT_SIZE 1024
|
||||
#else
|
||||
#ifndef SEGMENT_SIZE
|
||||
#define SEGMENT_SIZE PAGE_SIZE
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
|
||||
|
||||
#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text)
|
||||
|
||||
#ifndef N_DATADDR
|
||||
#define N_DATADDR(x) (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
|
||||
#endif
|
||||
|
||||
#ifndef N_BSSADDR
|
||||
#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
|
||||
#endif
|
||||
|
||||
#ifndef N_NLIST_DECLARED
|
||||
struct nlist {
|
||||
union {
|
||||
char *n_name;
|
||||
struct nlist *n_next;
|
||||
long n_strx;
|
||||
} n_un;
|
||||
unsigned char n_type;
|
||||
char n_other;
|
||||
short n_desc;
|
||||
unsigned long n_value;
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef N_UNDF
|
||||
#define N_UNDF 0
|
||||
#endif
|
||||
#ifndef N_ABS
|
||||
#define N_ABS 2
|
||||
#endif
|
||||
#ifndef N_TEXT
|
||||
#define N_TEXT 4
|
||||
#endif
|
||||
#ifndef N_DATA
|
||||
#define N_DATA 6
|
||||
#endif
|
||||
#ifndef N_BSS
|
||||
#define N_BSS 8
|
||||
#endif
|
||||
#ifndef N_FN
|
||||
#define N_FN 15
|
||||
#endif
|
||||
|
||||
#ifndef N_EXT
|
||||
#define N_EXT 1
|
||||
#endif
|
||||
#ifndef N_TYPE
|
||||
#define N_TYPE 036
|
||||
#endif
|
||||
#ifndef N_STAB
|
||||
#define N_STAB 0340
|
||||
#endif
|
||||
|
||||
#define N_INDR 0xa
|
||||
|
||||
#define N_SETA 0x14
|
||||
#define N_SETT 0x16
|
||||
#define N_SETD 0x18
|
||||
#define N_SETB 0x1A
|
||||
|
||||
#define N_SETV 0x1C
|
||||
|
||||
#ifndef N_RELOCATION_INFO_DECLARED
|
||||
|
||||
struct relocation_info
|
||||
{
|
||||
|
||||
int r_address;
|
||||
|
||||
unsigned int r_symbolnum:24;
|
||||
|
||||
unsigned int r_pcrel:1;
|
||||
|
||||
unsigned int r_length:2;
|
||||
|
||||
unsigned int r_extern:1;
|
||||
|
||||
#ifdef NS32K
|
||||
unsigned r_bsr:1;
|
||||
unsigned r_disp:1;
|
||||
unsigned r_pad:2;
|
||||
#else
|
||||
unsigned int r_pad:4;
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
64
libc/kernel/common/linux/aio_abi.h
Normal file
64
libc/kernel/common/linux/aio_abi.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __LINUX__AIO_ABI_H
|
||||
#define __LINUX__AIO_ABI_H
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
typedef unsigned long aio_context_t;
|
||||
|
||||
enum {
|
||||
IOCB_CMD_PREAD = 0,
|
||||
IOCB_CMD_PWRITE = 1,
|
||||
IOCB_CMD_FSYNC = 2,
|
||||
IOCB_CMD_FDSYNC = 3,
|
||||
|
||||
IOCB_CMD_NOOP = 6,
|
||||
};
|
||||
|
||||
struct io_event {
|
||||
__u64 data;
|
||||
__u64 obj;
|
||||
__s64 res;
|
||||
__s64 res2;
|
||||
};
|
||||
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
#define PADDED(x,y) x, y
|
||||
#elif defined(__BIG_ENDIAN)
|
||||
#define PADDED(x,y) y, x
|
||||
#else
|
||||
#error edit for your odd byteorder.
|
||||
#endif
|
||||
|
||||
struct iocb {
|
||||
|
||||
__u64 aio_data;
|
||||
__u32 PADDED(aio_key, aio_reserved1);
|
||||
|
||||
__u16 aio_lio_opcode;
|
||||
__s16 aio_reqprio;
|
||||
__u32 aio_fildes;
|
||||
|
||||
__u64 aio_buf;
|
||||
__u64 aio_nbytes;
|
||||
__s64 aio_offset;
|
||||
|
||||
__u64 aio_reserved2;
|
||||
__u64 aio_reserved3;
|
||||
};
|
||||
|
||||
#undef IFBIG
|
||||
#undef IFLITTLE
|
||||
|
||||
#endif
|
||||
|
89
libc/kernel/common/linux/akm8976.h
Normal file
89
libc/kernel/common/linux/akm8976.h
Normal file
@@ -0,0 +1,89 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef AKM8976_H
|
||||
#define AKM8976_H
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define AKECS_MODE_MEASURE 0x00
|
||||
|
||||
#define AKECS_MODE_PFFD 0x01
|
||||
#define AKECS_MODE_E2P_READ 0x02
|
||||
#define AKECS_MODE_POWERDOWN 0x03
|
||||
|
||||
#define AKECS_MODE_MEASURE_SNG 0x10
|
||||
#define AKECS_MODE_MEASURE_SEQ 0x11
|
||||
|
||||
#define CSPEC_AINT 0x01
|
||||
#define CSPEC_SNG_NUM 0x01
|
||||
#define CSPEC_SEQ_NUM 0x02
|
||||
#define CSPEC_SFRQ_32 0x00
|
||||
#define CSPEC_SFRQ_64 0x01
|
||||
#define CSPEC_MCS 0x07
|
||||
#define CSPEC_MKS 0x01
|
||||
#define CSPEC_INTEN 0x01
|
||||
|
||||
#define RBUFF_SIZE 31
|
||||
#define MAX_CALI_SIZE 0x1000U
|
||||
|
||||
#define AKECS_REG_ST 0xC0
|
||||
#define AKECS_REG_TMPS 0xC1
|
||||
#define AKECS_REG_MS1 0xE0
|
||||
#define AKECS_REG_MS2 0xE1
|
||||
#define AKECS_REG_MS3 0xE2
|
||||
|
||||
#define AKMIO 0xA1
|
||||
|
||||
#define ECS_IOCTL_INIT _IO(AKMIO, 0x01)
|
||||
#define ECS_IOCTL_WRITE _IOW(AKMIO, 0x02, char[5])
|
||||
#define ECS_IOCTL_READ _IOWR(AKMIO, 0x03, char[5])
|
||||
#define ECS_IOCTL_RESET _IO(AKMIO, 0x04)
|
||||
#define ECS_IOCTL_INT_STATUS _IO(AKMIO, 0x05)
|
||||
#define ECS_IOCTL_FFD_STATUS _IO(AKMIO, 0x06)
|
||||
#define ECS_IOCTL_SET_MODE _IOW(AKMIO, 0x07, short)
|
||||
#define ECS_IOCTL_GETDATA _IOR(AKMIO, 0x08, char[RBUFF_SIZE+1])
|
||||
#define ECS_IOCTL_GET_NUMFRQ _IOR(AKMIO, 0x09, char[2])
|
||||
#define ECS_IOCTL_SET_PERST _IO(AKMIO, 0x0A)
|
||||
#define ECS_IOCTL_SET_G0RST _IO(AKMIO, 0x0B)
|
||||
#define ECS_IOCTL_SET_YPR _IOW(AKMIO, 0x0C, short[12])
|
||||
#define ECS_IOCTL_GET_OPEN_STATUS _IOR(AKMIO, 0x0D, int)
|
||||
#define ECS_IOCTL_GET_CLOSE_STATUS _IOR(AKMIO, 0x0E, int)
|
||||
#define ECS_IOCTL_GET_CALI_DATA _IOR(AKMIO, 0x0F, char[MAX_CALI_SIZE])
|
||||
#define ECS_IOCTL_GET_DELAY _IOR(AKMIO, 0x30, short)
|
||||
|
||||
#define ECS_IOCTL_APP_SET_MODE _IOW(AKMIO, 0x10, short)
|
||||
#define ECS_IOCTL_APP_SET_MFLAG _IOW(AKMIO, 0x11, short)
|
||||
#define ECS_IOCTL_APP_GET_MFLAG _IOW(AKMIO, 0x12, short)
|
||||
#define ECS_IOCTL_APP_SET_AFLAG _IOW(AKMIO, 0x13, short)
|
||||
#define ECS_IOCTL_APP_GET_AFLAG _IOR(AKMIO, 0x14, short)
|
||||
#define ECS_IOCTL_APP_SET_TFLAG _IOR(AKMIO, 0x15, short)
|
||||
#define ECS_IOCTL_APP_GET_TFLAG _IOR(AKMIO, 0x16, short)
|
||||
#define ECS_IOCTL_APP_RESET_PEDOMETER _IO(AKMIO, 0x17)
|
||||
#define ECS_IOCTL_APP_SET_DELAY _IOW(AKMIO, 0x18, short)
|
||||
#define ECS_IOCTL_APP_GET_DELAY ECS_IOCTL_GET_DELAY
|
||||
#define ECS_IOCTL_APP_SET_MVFLAG _IOW(AKMIO, 0x19, short)
|
||||
#define ECS_IOCTL_APP_GET_MVFLAG _IOR(AKMIO, 0x1A, short)
|
||||
|
||||
#define ECS_IOCTL_SET_STEP_CNT _IOW(AKMIO, 0x20, short)
|
||||
|
||||
#define ECS_RST 146
|
||||
#define ECS_CLK_ON 155
|
||||
#define ECS_INTR 161
|
||||
|
||||
struct akm8976_platform_data {
|
||||
int reset;
|
||||
int clk_on;
|
||||
int intr;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
50
libc/kernel/common/linux/android_alarm.h
Normal file
50
libc/kernel/common/linux/android_alarm.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ANDROID_ALARM_H
|
||||
#define _LINUX_ANDROID_ALARM_H
|
||||
|
||||
#include <asm/ioctl.h>
|
||||
#include <linux/time.h>
|
||||
|
||||
typedef enum {
|
||||
|
||||
ANDROID_ALARM_RTC_WAKEUP,
|
||||
ANDROID_ALARM_RTC,
|
||||
ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP,
|
||||
ANDROID_ALARM_ELAPSED_REALTIME,
|
||||
ANDROID_ALARM_SYSTEMTIME,
|
||||
|
||||
ANDROID_ALARM_TYPE_COUNT,
|
||||
|
||||
} android_alarm_type_t;
|
||||
|
||||
typedef enum {
|
||||
ANDROID_ALARM_RTC_WAKEUP_MASK = 1U << ANDROID_ALARM_RTC_WAKEUP,
|
||||
ANDROID_ALARM_RTC_MASK = 1U << ANDROID_ALARM_RTC,
|
||||
ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP_MASK = 1U << ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP,
|
||||
ANDROID_ALARM_ELAPSED_REALTIME_MASK = 1U << ANDROID_ALARM_ELAPSED_REALTIME,
|
||||
ANDROID_ALARM_SYSTEMTIME_MASK = 1U << ANDROID_ALARM_SYSTEMTIME,
|
||||
ANDROID_ALARM_TIME_CHANGE_MASK = 1U << 16
|
||||
} android_alarm_return_flags_t;
|
||||
|
||||
#define ANDROID_ALARM_CLEAR(type) _IO('a', 0 | ((type) << 4))
|
||||
#define ANDROID_ALARM_WAIT _IO('a', 1)
|
||||
#define ANDROID_ALARM_SET(type) _IOW('a', 2 | ((type) << 4), struct timespec)
|
||||
#define ANDROID_ALARM_SET_AND_WAIT(type) _IOW('a', 3 | ((type) << 4), struct timespec)
|
||||
#define ANDROID_ALARM_GET_TIME(type) _IOW('a', 4 | ((type) << 4), struct timespec)
|
||||
#define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec)
|
||||
#define ANDROID_ALARM_SET_TIMEZONE _IOW('a', 6, struct timezone)
|
||||
|
||||
#define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0)))
|
||||
#define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4)
|
||||
|
||||
#endif
|
52
libc/kernel/common/linux/android_pmem.h
Normal file
52
libc/kernel/common/linux/android_pmem.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _ANDROID_PMEM_H_
|
||||
#define _ANDROID_PMEM_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef __user
|
||||
#define __user
|
||||
#endif
|
||||
|
||||
struct pmem_region {
|
||||
unsigned long offset;
|
||||
unsigned long len;
|
||||
};
|
||||
|
||||
#define PMEM_IOCTL_MAGIC 'p'
|
||||
#define PMEM_GET_PHYS _IOW(PMEM_IOCTL_MAGIC, 1, struct pmem_region *)
|
||||
#define PMEM_MAP _IOW(PMEM_IOCTL_MAGIC, 2, struct pmem_region *)
|
||||
#define PMEM_GET_SIZE _IOW(PMEM_IOCTL_MAGIC, 3, struct pmem_region *)
|
||||
#define PMEM_UNMAP _IOW(PMEM_IOCTL_MAGIC, 4, struct pmem_region *)
|
||||
|
||||
#define PMEM_ALLOCATE _IOW(PMEM_IOCTL_MAGIC, 5, unsigned int)
|
||||
|
||||
#define PMEM_CONNECT _IOW(PMEM_IOCTL_MAGIC, 6, unsigned int)
|
||||
|
||||
#define PMEM_GET_TOTAL_SIZE _IOW(PMEM_IOCTL_MAGIC, 7, struct pmem_region *)
|
||||
|
||||
#define HW3D_REVOKE_GPU _IOW(PMEM_IOCTL_MAGIC, 8, unsigned int)
|
||||
#define HW3D_GRANT_GPU _IOW(PMEM_IOCTL_MAGIC, 9, unsigned int)
|
||||
#define HW3D_WAIT_IRQ _IOW(PMEM_IOCTL_MAGIC,10, unsigned int)
|
||||
|
||||
struct android_pmem_platform_data;
|
||||
struct pmem_file_operations {
|
||||
int (*mmap) (struct file *, struct vm_area_struct *);
|
||||
int (*open) (struct inode *, struct file *);
|
||||
ssize_t (*read) (struct file *, char __user *, size_t, long long *);
|
||||
int (*release) (struct inode *, struct file *);
|
||||
long (*ioctl) (struct file *, unsigned int, unsigned long);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
55
libc/kernel/common/linux/android_power.h
Normal file
55
libc/kernel/common/linux/android_power.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ANDROID_POWER_H
|
||||
#define _LINUX_ANDROID_POWER_H
|
||||
|
||||
#include <linux/list.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct list_head link;
|
||||
int lock_count;
|
||||
int flags;
|
||||
const char *name;
|
||||
int expires;
|
||||
} android_suspend_lock_t;
|
||||
|
||||
#define ANDROID_SUSPEND_LOCK_FLAG_COUNTED (1U << 0)
|
||||
#define ANDROID_SUSPEND_LOCK_FLAG_USER_READABLE (1U << 1)
|
||||
#define ANDROID_SUSPEND_LOCK_FLAG_USER_SET (1U << 2)
|
||||
#define ANDROID_SUSPEND_LOCK_FLAG_USER_CLEAR (1U << 3)
|
||||
#define ANDROID_SUSPEND_LOCK_FLAG_USER_INC (1U << 4)
|
||||
#define ANDROID_SUSPEND_LOCK_FLAG_USER_DEC (1U << 5)
|
||||
#define ANDROID_SUSPEND_LOCK_FLAG_USER_VISIBLE_MASK (0x1fU << 1)
|
||||
#define ANDROID_SUSPEND_LOCK_AUTO_EXPIRE (1U << 6)
|
||||
|
||||
typedef struct android_early_suspend android_early_suspend_t;
|
||||
struct android_early_suspend
|
||||
{
|
||||
struct list_head link;
|
||||
int level;
|
||||
void (*suspend)(android_early_suspend_t *h);
|
||||
void (*resume)(android_early_suspend_t *h);
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
ANDROID_CHARGING_STATE_UNKNOWN,
|
||||
ANDROID_CHARGING_STATE_DISCHARGE,
|
||||
ANDROID_CHARGING_STATE_MAINTAIN,
|
||||
ANDROID_CHARGING_STATE_SLOW,
|
||||
ANDROID_CHARGING_STATE_NORMAL,
|
||||
ANDROID_CHARGING_STATE_FAST,
|
||||
ANDROID_CHARGING_STATE_OVERHEAT
|
||||
} android_charging_state_t;
|
||||
|
||||
#endif
|
||||
|
94
libc/kernel/common/linux/apm_bios.h
Normal file
94
libc/kernel/common/linux/apm_bios.h
Normal file
@@ -0,0 +1,94 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_APM_H
|
||||
#define _LINUX_APM_H
|
||||
|
||||
typedef unsigned short apm_event_t;
|
||||
typedef unsigned short apm_eventinfo_t;
|
||||
|
||||
#define APM_STATE_READY 0x0000
|
||||
#define APM_STATE_STANDBY 0x0001
|
||||
#define APM_STATE_SUSPEND 0x0002
|
||||
#define APM_STATE_OFF 0x0003
|
||||
#define APM_STATE_BUSY 0x0004
|
||||
#define APM_STATE_REJECT 0x0005
|
||||
#define APM_STATE_OEM_SYS 0x0020
|
||||
#define APM_STATE_OEM_DEV 0x0040
|
||||
|
||||
#define APM_STATE_DISABLE 0x0000
|
||||
#define APM_STATE_ENABLE 0x0001
|
||||
|
||||
#define APM_STATE_DISENGAGE 0x0000
|
||||
#define APM_STATE_ENGAGE 0x0001
|
||||
|
||||
#define APM_SYS_STANDBY 0x0001
|
||||
#define APM_SYS_SUSPEND 0x0002
|
||||
#define APM_NORMAL_RESUME 0x0003
|
||||
#define APM_CRITICAL_RESUME 0x0004
|
||||
#define APM_LOW_BATTERY 0x0005
|
||||
#define APM_POWER_STATUS_CHANGE 0x0006
|
||||
#define APM_UPDATE_TIME 0x0007
|
||||
#define APM_CRITICAL_SUSPEND 0x0008
|
||||
#define APM_USER_STANDBY 0x0009
|
||||
#define APM_USER_SUSPEND 0x000a
|
||||
#define APM_STANDBY_RESUME 0x000b
|
||||
#define APM_CAPABILITY_CHANGE 0x000c
|
||||
|
||||
#define APM_SUCCESS 0x00
|
||||
#define APM_DISABLED 0x01
|
||||
#define APM_CONNECTED 0x02
|
||||
#define APM_NOT_CONNECTED 0x03
|
||||
#define APM_16_CONNECTED 0x05
|
||||
#define APM_16_UNSUPPORTED 0x06
|
||||
#define APM_32_CONNECTED 0x07
|
||||
#define APM_32_UNSUPPORTED 0x08
|
||||
#define APM_BAD_DEVICE 0x09
|
||||
#define APM_BAD_PARAM 0x0a
|
||||
#define APM_NOT_ENGAGED 0x0b
|
||||
#define APM_BAD_FUNCTION 0x0c
|
||||
#define APM_RESUME_DISABLED 0x0d
|
||||
#define APM_NO_ERROR 0x53
|
||||
#define APM_BAD_STATE 0x60
|
||||
#define APM_NO_EVENTS 0x80
|
||||
#define APM_NOT_PRESENT 0x86
|
||||
|
||||
#define APM_DEVICE_BIOS 0x0000
|
||||
#define APM_DEVICE_ALL 0x0001
|
||||
#define APM_DEVICE_DISPLAY 0x0100
|
||||
#define APM_DEVICE_STORAGE 0x0200
|
||||
#define APM_DEVICE_PARALLEL 0x0300
|
||||
#define APM_DEVICE_SERIAL 0x0400
|
||||
#define APM_DEVICE_NETWORK 0x0500
|
||||
#define APM_DEVICE_PCMCIA 0x0600
|
||||
#define APM_DEVICE_BATTERY 0x8000
|
||||
#define APM_DEVICE_OEM 0xe000
|
||||
#define APM_DEVICE_OLD_ALL 0xffff
|
||||
#define APM_DEVICE_CLASS 0x00ff
|
||||
#define APM_DEVICE_MASK 0xff00
|
||||
|
||||
#define APM_MAX_BATTERIES 2
|
||||
|
||||
#define APM_CAP_GLOBAL_STANDBY 0x0001
|
||||
#define APM_CAP_GLOBAL_SUSPEND 0x0002
|
||||
#define APM_CAP_RESUME_STANDBY_TIMER 0x0004
|
||||
#define APM_CAP_RESUME_SUSPEND_TIMER 0x0008
|
||||
#define APM_CAP_RESUME_STANDBY_RING 0x0010
|
||||
#define APM_CAP_RESUME_SUSPEND_RING 0x0020
|
||||
#define APM_CAP_RESUME_STANDBY_PCMCIA 0x0040
|
||||
#define APM_CAP_RESUME_SUSPEND_PCMCIA 0x0080
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define APM_IOC_STANDBY _IO('A', 1)
|
||||
#define APM_IOC_SUSPEND _IO('A', 2)
|
||||
|
||||
#endif
|
46
libc/kernel/common/linux/ashmem.h
Normal file
46
libc/kernel/common/linux/ashmem.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ASHMEM_H
|
||||
#define _LINUX_ASHMEM_H
|
||||
|
||||
#include <linux/limits.h>
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define ASHMEM_NAME_LEN 256
|
||||
|
||||
#define ASHMEM_NAME_DEF "dev/ashmem"
|
||||
|
||||
#define ASHMEM_NOT_PURGED 0
|
||||
#define ASHMEM_WAS_PURGED 1
|
||||
|
||||
#define ASHMEM_IS_UNPINNED 0
|
||||
#define ASHMEM_IS_PINNED 1
|
||||
|
||||
struct ashmem_pin {
|
||||
__u32 offset;
|
||||
__u32 len;
|
||||
};
|
||||
|
||||
#define __ASHMEMIOC 0x77
|
||||
|
||||
#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN])
|
||||
#define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN])
|
||||
#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t)
|
||||
#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4)
|
||||
#define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long)
|
||||
#define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6)
|
||||
#define ASHMEM_PIN _IOW(__ASHMEMIOC, 7, struct ashmem_pin)
|
||||
#define ASHMEM_UNPIN _IOW(__ASHMEMIOC, 8, struct ashmem_pin)
|
||||
#define ASHMEM_GET_PIN_STATUS _IO(__ASHMEMIOC, 9)
|
||||
#define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10)
|
||||
|
||||
#endif
|
265
libc/kernel/common/linux/ata.h
Normal file
265
libc/kernel/common/linux/ata.h
Normal file
@@ -0,0 +1,265 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __LINUX_ATA_H__
|
||||
#define __LINUX_ATA_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define ATA_DMA_BOUNDARY 0xffffUL
|
||||
#define ATA_DMA_MASK 0xffffffffULL
|
||||
|
||||
enum {
|
||||
|
||||
ATA_MAX_DEVICES = 2,
|
||||
ATA_MAX_PRD = 256,
|
||||
ATA_SECT_SIZE = 512,
|
||||
|
||||
ATA_ID_WORDS = 256,
|
||||
ATA_ID_SERNO_OFS = 10,
|
||||
ATA_ID_FW_REV_OFS = 23,
|
||||
ATA_ID_PROD_OFS = 27,
|
||||
ATA_ID_OLD_PIO_MODES = 51,
|
||||
ATA_ID_FIELD_VALID = 53,
|
||||
ATA_ID_MWDMA_MODES = 63,
|
||||
ATA_ID_PIO_MODES = 64,
|
||||
ATA_ID_EIDE_DMA_MIN = 65,
|
||||
ATA_ID_EIDE_PIO = 67,
|
||||
ATA_ID_EIDE_PIO_IORDY = 68,
|
||||
ATA_ID_UDMA_MODES = 88,
|
||||
ATA_ID_MAJOR_VER = 80,
|
||||
ATA_ID_PIO4 = (1 << 1),
|
||||
|
||||
ATA_PCI_CTL_OFS = 2,
|
||||
ATA_SERNO_LEN = 20,
|
||||
ATA_UDMA0 = (1 << 0),
|
||||
ATA_UDMA1 = ATA_UDMA0 | (1 << 1),
|
||||
ATA_UDMA2 = ATA_UDMA1 | (1 << 2),
|
||||
ATA_UDMA3 = ATA_UDMA2 | (1 << 3),
|
||||
ATA_UDMA4 = ATA_UDMA3 | (1 << 4),
|
||||
ATA_UDMA5 = ATA_UDMA4 | (1 << 5),
|
||||
ATA_UDMA6 = ATA_UDMA5 | (1 << 6),
|
||||
ATA_UDMA7 = ATA_UDMA6 | (1 << 7),
|
||||
|
||||
ATA_UDMA_MASK_40C = ATA_UDMA2,
|
||||
|
||||
ATA_PRD_SZ = 8,
|
||||
ATA_PRD_TBL_SZ = (ATA_MAX_PRD * ATA_PRD_SZ),
|
||||
ATA_PRD_EOT = (1 << 31),
|
||||
|
||||
ATA_DMA_TABLE_OFS = 4,
|
||||
ATA_DMA_STATUS = 2,
|
||||
ATA_DMA_CMD = 0,
|
||||
ATA_DMA_WR = (1 << 3),
|
||||
ATA_DMA_START = (1 << 0),
|
||||
ATA_DMA_INTR = (1 << 2),
|
||||
ATA_DMA_ERR = (1 << 1),
|
||||
ATA_DMA_ACTIVE = (1 << 0),
|
||||
|
||||
ATA_HOB = (1 << 7),
|
||||
ATA_NIEN = (1 << 1),
|
||||
ATA_LBA = (1 << 6),
|
||||
ATA_DEV1 = (1 << 4),
|
||||
ATA_DEVICE_OBS = (1 << 7) | (1 << 5),
|
||||
ATA_DEVCTL_OBS = (1 << 3),
|
||||
ATA_BUSY = (1 << 7),
|
||||
ATA_DRDY = (1 << 6),
|
||||
ATA_DF = (1 << 5),
|
||||
ATA_DRQ = (1 << 3),
|
||||
ATA_ERR = (1 << 0),
|
||||
ATA_SRST = (1 << 2),
|
||||
ATA_ICRC = (1 << 7),
|
||||
ATA_UNC = (1 << 6),
|
||||
ATA_IDNF = (1 << 4),
|
||||
ATA_ABORTED = (1 << 2),
|
||||
|
||||
ATA_REG_DATA = 0x00,
|
||||
ATA_REG_ERR = 0x01,
|
||||
ATA_REG_NSECT = 0x02,
|
||||
ATA_REG_LBAL = 0x03,
|
||||
ATA_REG_LBAM = 0x04,
|
||||
ATA_REG_LBAH = 0x05,
|
||||
ATA_REG_DEVICE = 0x06,
|
||||
ATA_REG_STATUS = 0x07,
|
||||
|
||||
ATA_REG_FEATURE = ATA_REG_ERR,
|
||||
ATA_REG_CMD = ATA_REG_STATUS,
|
||||
ATA_REG_BYTEL = ATA_REG_LBAM,
|
||||
ATA_REG_BYTEH = ATA_REG_LBAH,
|
||||
ATA_REG_DEVSEL = ATA_REG_DEVICE,
|
||||
ATA_REG_IRQ = ATA_REG_NSECT,
|
||||
|
||||
ATA_CMD_CHK_POWER = 0xE5,
|
||||
ATA_CMD_STANDBY = 0xE2,
|
||||
ATA_CMD_IDLE = 0xE3,
|
||||
ATA_CMD_EDD = 0x90,
|
||||
ATA_CMD_FLUSH = 0xE7,
|
||||
ATA_CMD_FLUSH_EXT = 0xEA,
|
||||
ATA_CMD_ID_ATA = 0xEC,
|
||||
ATA_CMD_ID_ATAPI = 0xA1,
|
||||
ATA_CMD_READ = 0xC8,
|
||||
ATA_CMD_READ_EXT = 0x25,
|
||||
ATA_CMD_WRITE = 0xCA,
|
||||
ATA_CMD_WRITE_EXT = 0x35,
|
||||
ATA_CMD_WRITE_FUA_EXT = 0x3D,
|
||||
ATA_CMD_FPDMA_READ = 0x60,
|
||||
ATA_CMD_FPDMA_WRITE = 0x61,
|
||||
ATA_CMD_PIO_READ = 0x20,
|
||||
ATA_CMD_PIO_READ_EXT = 0x24,
|
||||
ATA_CMD_PIO_WRITE = 0x30,
|
||||
ATA_CMD_PIO_WRITE_EXT = 0x34,
|
||||
ATA_CMD_READ_MULTI = 0xC4,
|
||||
ATA_CMD_READ_MULTI_EXT = 0x29,
|
||||
ATA_CMD_WRITE_MULTI = 0xC5,
|
||||
ATA_CMD_WRITE_MULTI_EXT = 0x39,
|
||||
ATA_CMD_WRITE_MULTI_FUA_EXT = 0xCE,
|
||||
ATA_CMD_SET_FEATURES = 0xEF,
|
||||
ATA_CMD_PACKET = 0xA0,
|
||||
ATA_CMD_VERIFY = 0x40,
|
||||
ATA_CMD_VERIFY_EXT = 0x42,
|
||||
ATA_CMD_STANDBYNOW1 = 0xE0,
|
||||
ATA_CMD_IDLEIMMEDIATE = 0xE1,
|
||||
ATA_CMD_INIT_DEV_PARAMS = 0x91,
|
||||
ATA_CMD_READ_NATIVE_MAX = 0xF8,
|
||||
ATA_CMD_READ_NATIVE_MAX_EXT = 0x27,
|
||||
ATA_CMD_READ_LOG_EXT = 0x2f,
|
||||
|
||||
ATA_LOG_SATA_NCQ = 0x10,
|
||||
|
||||
SETFEATURES_XFER = 0x03,
|
||||
XFER_UDMA_7 = 0x47,
|
||||
XFER_UDMA_6 = 0x46,
|
||||
XFER_UDMA_5 = 0x45,
|
||||
XFER_UDMA_4 = 0x44,
|
||||
XFER_UDMA_3 = 0x43,
|
||||
XFER_UDMA_2 = 0x42,
|
||||
XFER_UDMA_1 = 0x41,
|
||||
XFER_UDMA_0 = 0x40,
|
||||
XFER_MW_DMA_2 = 0x22,
|
||||
XFER_MW_DMA_1 = 0x21,
|
||||
XFER_MW_DMA_0 = 0x20,
|
||||
XFER_SW_DMA_2 = 0x12,
|
||||
XFER_SW_DMA_1 = 0x11,
|
||||
XFER_SW_DMA_0 = 0x10,
|
||||
XFER_PIO_4 = 0x0C,
|
||||
XFER_PIO_3 = 0x0B,
|
||||
XFER_PIO_2 = 0x0A,
|
||||
XFER_PIO_1 = 0x09,
|
||||
XFER_PIO_0 = 0x08,
|
||||
XFER_PIO_SLOW = 0x00,
|
||||
|
||||
SETFEATURES_WC_ON = 0x02,
|
||||
SETFEATURES_WC_OFF = 0x82,
|
||||
|
||||
ATAPI_PKT_DMA = (1 << 0),
|
||||
ATAPI_DMADIR = (1 << 2),
|
||||
ATAPI_CDB_LEN = 16,
|
||||
|
||||
ATA_CBL_NONE = 0,
|
||||
ATA_CBL_PATA40 = 1,
|
||||
ATA_CBL_PATA80 = 2,
|
||||
ATA_CBL_PATA_UNK = 3,
|
||||
ATA_CBL_SATA = 4,
|
||||
|
||||
SCR_STATUS = 0,
|
||||
SCR_ERROR = 1,
|
||||
SCR_CONTROL = 2,
|
||||
SCR_ACTIVE = 3,
|
||||
SCR_NOTIFICATION = 4,
|
||||
|
||||
SERR_DATA_RECOVERED = (1 << 0),
|
||||
SERR_COMM_RECOVERED = (1 << 1),
|
||||
SERR_DATA = (1 << 8),
|
||||
SERR_PERSISTENT = (1 << 9),
|
||||
SERR_PROTOCOL = (1 << 10),
|
||||
SERR_INTERNAL = (1 << 11),
|
||||
SERR_PHYRDY_CHG = (1 << 16),
|
||||
SERR_DEV_XCHG = (1 << 26),
|
||||
|
||||
ATA_TFLAG_LBA48 = (1 << 0),
|
||||
ATA_TFLAG_ISADDR = (1 << 1),
|
||||
ATA_TFLAG_DEVICE = (1 << 2),
|
||||
ATA_TFLAG_WRITE = (1 << 3),
|
||||
ATA_TFLAG_LBA = (1 << 4),
|
||||
ATA_TFLAG_FUA = (1 << 5),
|
||||
ATA_TFLAG_POLLING = (1 << 6),
|
||||
};
|
||||
|
||||
enum ata_tf_protocols {
|
||||
|
||||
ATA_PROT_UNKNOWN,
|
||||
ATA_PROT_NODATA,
|
||||
ATA_PROT_PIO,
|
||||
ATA_PROT_DMA,
|
||||
ATA_PROT_NCQ,
|
||||
ATA_PROT_ATAPI,
|
||||
ATA_PROT_ATAPI_NODATA,
|
||||
ATA_PROT_ATAPI_DMA,
|
||||
};
|
||||
|
||||
enum ata_ioctls {
|
||||
ATA_IOC_GET_IO32 = 0x309,
|
||||
ATA_IOC_SET_IO32 = 0x324,
|
||||
};
|
||||
|
||||
struct ata_prd {
|
||||
u32 addr;
|
||||
u32 flags_len;
|
||||
};
|
||||
|
||||
struct ata_taskfile {
|
||||
unsigned long flags;
|
||||
u8 protocol;
|
||||
|
||||
u8 ctl;
|
||||
|
||||
u8 hob_feature;
|
||||
u8 hob_nsect;
|
||||
u8 hob_lbal;
|
||||
u8 hob_lbam;
|
||||
u8 hob_lbah;
|
||||
|
||||
u8 feature;
|
||||
u8 nsect;
|
||||
u8 lbal;
|
||||
u8 lbam;
|
||||
u8 lbah;
|
||||
|
||||
u8 device;
|
||||
|
||||
u8 command;
|
||||
};
|
||||
|
||||
#define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0)
|
||||
#define ata_id_is_cfa(id) ((id)[0] == 0x848A)
|
||||
#define ata_id_is_sata(id) ((id)[93] == 0)
|
||||
#define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6))
|
||||
#define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5))
|
||||
#define ata_id_hpa_enabled(id) ((id)[85] & (1 << 10))
|
||||
#define ata_id_has_fua(id) ((id)[84] & (1 << 6))
|
||||
#define ata_id_has_flush(id) ((id)[83] & (1 << 12))
|
||||
#define ata_id_has_flush_ext(id) ((id)[83] & (1 << 13))
|
||||
#define ata_id_has_lba48(id) ((id)[83] & (1 << 10))
|
||||
#define ata_id_has_hpa(id) ((id)[82] & (1 << 10))
|
||||
#define ata_id_has_wcache(id) ((id)[82] & (1 << 5))
|
||||
#define ata_id_has_pm(id) ((id)[82] & (1 << 3))
|
||||
#define ata_id_has_lba(id) ((id)[49] & (1 << 9))
|
||||
#define ata_id_has_dma(id) ((id)[49] & (1 << 8))
|
||||
#define ata_id_has_ncq(id) ((id)[76] & (1 << 8))
|
||||
#define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1)
|
||||
#define ata_id_removeable(id) ((id)[0] & (1 << 7))
|
||||
#define ata_id_has_dword_io(id) ((id)[50] & (1 << 0))
|
||||
#define ata_id_u32(id,n) (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)]))
|
||||
#define ata_id_u64(id,n) ( ((u64) (id)[(n) + 3] << 48) | ((u64) (id)[(n) + 2] << 32) | ((u64) (id)[(n) + 1] << 16) | ((u64) (id)[(n) + 0]) )
|
||||
|
||||
#define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20)
|
||||
|
||||
#endif
|
161
libc/kernel/common/linux/atm.h
Normal file
161
libc/kernel/common/linux/atm.h
Normal file
@@ -0,0 +1,161 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ATM_H
|
||||
#define _LINUX_ATM_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/atmapi.h>
|
||||
#include <linux/atmsap.h>
|
||||
#include <linux/atmioc.h>
|
||||
|
||||
#define ATM_CELL_SIZE 53
|
||||
#define ATM_CELL_PAYLOAD 48
|
||||
#define ATM_AAL0_SDU 52
|
||||
#define ATM_MAX_AAL34_PDU 65535
|
||||
#define ATM_AAL5_TRAILER 8
|
||||
#define ATM_MAX_AAL5_PDU 65535
|
||||
#define ATM_MAX_CDV 9999
|
||||
#define ATM_NOT_RSV_VCI 32
|
||||
|
||||
#define ATM_MAX_VPI 255
|
||||
#define ATM_MAX_VPI_NNI 4096
|
||||
#define ATM_MAX_VCI 65535
|
||||
|
||||
#define ATM_NO_AAL 0
|
||||
#define ATM_AAL0 13
|
||||
#define ATM_AAL1 1
|
||||
#define ATM_AAL2 2
|
||||
#define ATM_AAL34 3
|
||||
#define ATM_AAL5 5
|
||||
|
||||
#define __SO_ENCODE(l,n,t) ((((l) & 0x1FF) << 22) | ((n) << 16) | sizeof(t))
|
||||
#define __SO_LEVEL_MATCH(c,m) (((c) >> 22) == ((m) & 0x1FF))
|
||||
#define __SO_NUMBER(c) (((c) >> 16) & 0x3f)
|
||||
#define __SO_SIZE(c) ((c) & 0x3fff)
|
||||
|
||||
#define SO_SETCLP __SO_ENCODE(SOL_ATM,0,int)
|
||||
|
||||
#define SO_CIRANGE __SO_ENCODE(SOL_ATM,1,struct atm_cirange)
|
||||
|
||||
#define SO_ATMQOS __SO_ENCODE(SOL_ATM,2,struct atm_qos)
|
||||
|
||||
#define SO_ATMSAP __SO_ENCODE(SOL_ATM,3,struct atm_sap)
|
||||
|
||||
#define SO_ATMPVC __SO_ENCODE(SOL_ATM,4,struct sockaddr_atmpvc)
|
||||
|
||||
#define SO_MULTIPOINT __SO_ENCODE(SOL_ATM, 5, int)
|
||||
|
||||
#define ATM_HDR_GFC_MASK 0xf0000000
|
||||
#define ATM_HDR_GFC_SHIFT 28
|
||||
#define ATM_HDR_VPI_MASK 0x0ff00000
|
||||
#define ATM_HDR_VPI_SHIFT 20
|
||||
#define ATM_HDR_VCI_MASK 0x000ffff0
|
||||
#define ATM_HDR_VCI_SHIFT 4
|
||||
#define ATM_HDR_PTI_MASK 0x0000000e
|
||||
#define ATM_HDR_PTI_SHIFT 1
|
||||
#define ATM_HDR_CLP 0x00000001
|
||||
|
||||
#define ATM_PTI_US0 0
|
||||
#define ATM_PTI_US1 1
|
||||
#define ATM_PTI_UCES0 2
|
||||
#define ATM_PTI_UCES1 3
|
||||
#define ATM_PTI_SEGF5 4
|
||||
#define ATM_PTI_E2EF5 5
|
||||
#define ATM_PTI_RSV_RM 6
|
||||
#define ATM_PTI_RSV 7
|
||||
|
||||
#define ATM_NONE 0
|
||||
#define ATM_UBR 1
|
||||
#define ATM_CBR 2
|
||||
#define ATM_VBR 3
|
||||
#define ATM_ABR 4
|
||||
#define ATM_ANYCLASS 5
|
||||
|
||||
#define ATM_MAX_PCR -1
|
||||
|
||||
struct atm_trafprm {
|
||||
unsigned char traffic_class;
|
||||
int max_pcr;
|
||||
int pcr;
|
||||
int min_pcr;
|
||||
int max_cdv;
|
||||
int max_sdu;
|
||||
|
||||
unsigned int icr;
|
||||
unsigned int tbe;
|
||||
unsigned int frtt : 24;
|
||||
unsigned int rif : 4;
|
||||
unsigned int rdf : 4;
|
||||
unsigned int nrm_pres :1;
|
||||
unsigned int trm_pres :1;
|
||||
unsigned int adtf_pres :1;
|
||||
unsigned int cdf_pres :1;
|
||||
unsigned int nrm :3;
|
||||
unsigned int trm :3;
|
||||
unsigned int adtf :10;
|
||||
unsigned int cdf :3;
|
||||
unsigned int spare :9;
|
||||
};
|
||||
|
||||
struct atm_qos {
|
||||
struct atm_trafprm txtp;
|
||||
struct atm_trafprm rxtp __ATM_API_ALIGN;
|
||||
|
||||
unsigned char aal __ATM_API_ALIGN;
|
||||
};
|
||||
|
||||
#define ATM_ITF_ANY -1
|
||||
#define ATM_VPI_ANY -1
|
||||
#define ATM_VCI_ANY -1
|
||||
#define ATM_VPI_UNSPEC -2
|
||||
#define ATM_VCI_UNSPEC -2
|
||||
|
||||
struct sockaddr_atmpvc {
|
||||
unsigned short sap_family;
|
||||
struct {
|
||||
short itf;
|
||||
short vpi;
|
||||
int vci;
|
||||
} sap_addr __ATM_API_ALIGN;
|
||||
};
|
||||
|
||||
#define ATM_ESA_LEN 20
|
||||
#define ATM_E164_LEN 12
|
||||
|
||||
#define ATM_AFI_DCC 0x39
|
||||
#define ATM_AFI_ICD 0x47
|
||||
#define ATM_AFI_E164 0x45
|
||||
#define ATM_AFI_LOCAL 0x49
|
||||
|
||||
#define ATM_AFI_DCC_GROUP 0xBD
|
||||
#define ATM_AFI_ICD_GROUP 0xC5
|
||||
#define ATM_AFI_E164_GROUP 0xC3
|
||||
#define ATM_AFI_LOCAL_GROUP 0xC7
|
||||
|
||||
#define ATM_LIJ_NONE 0
|
||||
#define ATM_LIJ 1
|
||||
#define ATM_LIJ_RPJ 2
|
||||
#define ATM_LIJ_NJ 3
|
||||
|
||||
struct sockaddr_atmsvc {
|
||||
unsigned short sas_family;
|
||||
struct {
|
||||
unsigned char prv[ATM_ESA_LEN];
|
||||
char pub[ATM_E164_LEN+1];
|
||||
|
||||
char lij_type;
|
||||
uint32_t lij_id;
|
||||
} sas_addr __ATM_API_ALIGN;
|
||||
};
|
||||
|
||||
typedef unsigned short atm_backend_t;
|
||||
#endif
|
24
libc/kernel/common/linux/atmapi.h
Normal file
24
libc/kernel/common/linux/atmapi.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ATMAPI_H
|
||||
#define _LINUX_ATMAPI_H
|
||||
|
||||
#if defined(__sparc__) || defined(__ia64__)
|
||||
|
||||
#define __ATM_API_ALIGN __attribute__((aligned(8)))
|
||||
#else
|
||||
#define __ATM_API_ALIGN
|
||||
#endif
|
||||
|
||||
typedef struct { unsigned char _[8]; } __ATM_API_ALIGN atm_kptr_t;
|
||||
|
||||
#endif
|
161
libc/kernel/common/linux/atmdev.h
Normal file
161
libc/kernel/common/linux/atmdev.h
Normal file
@@ -0,0 +1,161 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef LINUX_ATMDEV_H
|
||||
#define LINUX_ATMDEV_H
|
||||
|
||||
#include <linux/atmapi.h>
|
||||
#include <linux/atm.h>
|
||||
#include <linux/atmioc.h>
|
||||
|
||||
#define ESI_LEN 6
|
||||
|
||||
#define ATM_OC3_PCR (155520000/270*260/8/53)
|
||||
|
||||
#define ATM_25_PCR ((25600000/8-8000)/54)
|
||||
|
||||
#define ATM_OC12_PCR (622080000/1080*1040/8/53)
|
||||
|
||||
#define ATM_DS3_PCR (8000*12)
|
||||
|
||||
#define __AAL_STAT_ITEMS __HANDLE_ITEM(tx); __HANDLE_ITEM(tx_err); __HANDLE_ITEM(rx); __HANDLE_ITEM(rx_err); __HANDLE_ITEM(rx_drop);
|
||||
|
||||
struct atm_aal_stats {
|
||||
#define __HANDLE_ITEM(i) int i
|
||||
__AAL_STAT_ITEMS
|
||||
#undef __HANDLE_ITEM
|
||||
};
|
||||
|
||||
struct atm_dev_stats {
|
||||
struct atm_aal_stats aal0;
|
||||
struct atm_aal_stats aal34;
|
||||
struct atm_aal_stats aal5;
|
||||
} __ATM_API_ALIGN;
|
||||
|
||||
#define ATM_GETLINKRATE _IOW('a',ATMIOC_ITF+1,struct atmif_sioc)
|
||||
|
||||
#define ATM_GETNAMES _IOW('a',ATMIOC_ITF+3,struct atm_iobuf)
|
||||
|
||||
#define ATM_GETTYPE _IOW('a',ATMIOC_ITF+4,struct atmif_sioc)
|
||||
|
||||
#define ATM_GETESI _IOW('a',ATMIOC_ITF+5,struct atmif_sioc)
|
||||
|
||||
#define ATM_GETADDR _IOW('a',ATMIOC_ITF+6,struct atmif_sioc)
|
||||
|
||||
#define ATM_RSTADDR _IOW('a',ATMIOC_ITF+7,struct atmif_sioc)
|
||||
|
||||
#define ATM_ADDADDR _IOW('a',ATMIOC_ITF+8,struct atmif_sioc)
|
||||
|
||||
#define ATM_DELADDR _IOW('a',ATMIOC_ITF+9,struct atmif_sioc)
|
||||
|
||||
#define ATM_GETCIRANGE _IOW('a',ATMIOC_ITF+10,struct atmif_sioc)
|
||||
|
||||
#define ATM_SETCIRANGE _IOW('a',ATMIOC_ITF+11,struct atmif_sioc)
|
||||
|
||||
#define ATM_SETESI _IOW('a',ATMIOC_ITF+12,struct atmif_sioc)
|
||||
|
||||
#define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc)
|
||||
|
||||
#define ATM_ADDLECSADDR _IOW('a', ATMIOC_ITF+14, struct atmif_sioc)
|
||||
|
||||
#define ATM_DELLECSADDR _IOW('a', ATMIOC_ITF+15, struct atmif_sioc)
|
||||
|
||||
#define ATM_GETLECSADDR _IOW('a', ATMIOC_ITF+16, struct atmif_sioc)
|
||||
|
||||
#define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc)
|
||||
|
||||
#define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc)
|
||||
|
||||
#define ATM_GETLOOP _IOW('a',ATMIOC_SARCOM+2,struct atmif_sioc)
|
||||
|
||||
#define ATM_SETLOOP _IOW('a',ATMIOC_SARCOM+3,struct atmif_sioc)
|
||||
|
||||
#define ATM_QUERYLOOP _IOW('a',ATMIOC_SARCOM+4,struct atmif_sioc)
|
||||
|
||||
#define ATM_SETSC _IOW('a',ATMIOC_SPECIAL+1,int)
|
||||
|
||||
#define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t)
|
||||
|
||||
#define ATM_NEWBACKENDIF _IOW('a',ATMIOC_SPECIAL+3,atm_backend_t)
|
||||
|
||||
#define ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct atm_iobuf)
|
||||
|
||||
#define ATM_DROPPARTY _IOW('a', ATMIOC_SPECIAL+5,int)
|
||||
|
||||
#define ATM_BACKEND_RAW 0
|
||||
#define ATM_BACKEND_PPP 1
|
||||
#define ATM_BACKEND_BR2684 2
|
||||
|
||||
#define ATM_ITFTYP_LEN 8
|
||||
|
||||
#define __ATM_LM_NONE 0
|
||||
#define __ATM_LM_AAL 1
|
||||
#define __ATM_LM_ATM 2
|
||||
|
||||
#define __ATM_LM_PHY 8
|
||||
#define __ATM_LM_ANALOG 16
|
||||
|
||||
#define __ATM_LM_MKLOC(n) ((n))
|
||||
#define __ATM_LM_MKRMT(n) ((n) << 8)
|
||||
|
||||
#define __ATM_LM_XTLOC(n) ((n) & 0xff)
|
||||
#define __ATM_LM_XTRMT(n) (((n) >> 8) & 0xff)
|
||||
|
||||
#define ATM_LM_NONE 0
|
||||
|
||||
#define ATM_LM_LOC_AAL __ATM_LM_MKLOC(__ATM_LM_AAL)
|
||||
#define ATM_LM_LOC_ATM __ATM_LM_MKLOC(__ATM_LM_ATM)
|
||||
#define ATM_LM_LOC_PHY __ATM_LM_MKLOC(__ATM_LM_PHY)
|
||||
#define ATM_LM_LOC_ANALOG __ATM_LM_MKLOC(__ATM_LM_ANALOG)
|
||||
|
||||
#define ATM_LM_RMT_AAL __ATM_LM_MKRMT(__ATM_LM_AAL)
|
||||
#define ATM_LM_RMT_ATM __ATM_LM_MKRMT(__ATM_LM_ATM)
|
||||
#define ATM_LM_RMT_PHY __ATM_LM_MKRMT(__ATM_LM_PHY)
|
||||
#define ATM_LM_RMT_ANALOG __ATM_LM_MKRMT(__ATM_LM_ANALOG)
|
||||
|
||||
struct atm_iobuf {
|
||||
int length;
|
||||
void __user *buffer;
|
||||
};
|
||||
|
||||
#define ATM_CI_MAX -1
|
||||
|
||||
struct atm_cirange {
|
||||
signed char vpi_bits;
|
||||
signed char vci_bits;
|
||||
};
|
||||
|
||||
#define ATM_SC_RX 1024
|
||||
#define ATM_SC_TX 2048
|
||||
|
||||
#define ATM_BACKLOG_DEFAULT 32
|
||||
|
||||
#define ATM_MF_IMMED 1
|
||||
#define ATM_MF_INC_RSV 2
|
||||
#define ATM_MF_INC_SHP 4
|
||||
#define ATM_MF_DEC_RSV 8
|
||||
#define ATM_MF_DEC_SHP 16
|
||||
#define ATM_MF_BWD 32
|
||||
|
||||
#define ATM_MF_SET (ATM_MF_INC_RSV | ATM_MF_INC_SHP | ATM_MF_DEC_RSV | ATM_MF_DEC_SHP | ATM_MF_BWD)
|
||||
|
||||
#define ATM_VS_IDLE 0
|
||||
#define ATM_VS_CONNECTED 1
|
||||
#define ATM_VS_CLOSING 2
|
||||
#define ATM_VS_LISTEN 3
|
||||
#define ATM_VS_INUSE 4
|
||||
#define ATM_VS_BOUND 5
|
||||
|
||||
#define ATM_VS2TXT_MAP "IDLE", "CONNECTED", "CLOSING", "LISTEN", "INUSE", "BOUND"
|
||||
|
||||
#define ATM_VF2TXT_MAP "ADDR", "READY", "PARTIAL", "REGIS", "RELEASED", "HASQOS", "LISTEN", "META", "256", "512", "1024", "2048", "SESSION", "HASSAP", "BOUND", "CLOSE"
|
||||
|
||||
#endif
|
40
libc/kernel/common/linux/atmioc.h
Normal file
40
libc/kernel/common/linux/atmioc.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ATMIOC_H
|
||||
#define _LINUX_ATMIOC_H
|
||||
|
||||
#include <asm/ioctl.h>
|
||||
|
||||
#define ATMIOC_PHYCOM 0x00
|
||||
#define ATMIOC_PHYCOM_END 0x0f
|
||||
#define ATMIOC_PHYTYP 0x10
|
||||
#define ATMIOC_PHYTYP_END 0x2f
|
||||
#define ATMIOC_PHYPRV 0x30
|
||||
#define ATMIOC_PHYPRV_END 0x4f
|
||||
#define ATMIOC_SARCOM 0x50
|
||||
#define ATMIOC_SARCOM_END 0x50
|
||||
#define ATMIOC_SARPRV 0x60
|
||||
#define ATMIOC_SARPRV_END 0x7f
|
||||
#define ATMIOC_ITF 0x80
|
||||
#define ATMIOC_ITF_END 0x8f
|
||||
#define ATMIOC_BACKEND 0x90
|
||||
#define ATMIOC_BACKEND_END 0xaf
|
||||
|
||||
#define ATMIOC_AREQUIPA 0xc0
|
||||
#define ATMIOC_LANE 0xd0
|
||||
#define ATMIOC_MPOA 0xd8
|
||||
#define ATMIOC_CLIP 0xe0
|
||||
#define ATMIOC_CLIP_END 0xef
|
||||
#define ATMIOC_SPECIAL 0xf0
|
||||
#define ATMIOC_SPECIAL_END 0xff
|
||||
|
||||
#endif
|
26
libc/kernel/common/linux/atmppp.h
Normal file
26
libc/kernel/common/linux/atmppp.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ATMPPP_H
|
||||
#define _LINUX_ATMPPP_H
|
||||
|
||||
#include <linux/atm.h>
|
||||
|
||||
#define PPPOATM_ENCAPS_AUTODETECT (0)
|
||||
#define PPPOATM_ENCAPS_VC (1)
|
||||
#define PPPOATM_ENCAPS_LLC (2)
|
||||
|
||||
struct atm_backend_ppp {
|
||||
atm_backend_t backend_num;
|
||||
int encaps;
|
||||
};
|
||||
|
||||
#endif
|
117
libc/kernel/common/linux/atmsap.h
Normal file
117
libc/kernel/common/linux/atmsap.h
Normal file
@@ -0,0 +1,117 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ATMSAP_H
|
||||
#define _LINUX_ATMSAP_H
|
||||
|
||||
#include <linux/atmapi.h>
|
||||
|
||||
#define ATM_L2_NONE 0
|
||||
#define ATM_L2_ISO1745 0x01
|
||||
#define ATM_L2_Q291 0x02
|
||||
#define ATM_L2_X25_LL 0x06
|
||||
#define ATM_L2_X25_ML 0x07
|
||||
#define ATM_L2_LAPB 0x08
|
||||
#define ATM_L2_HDLC_ARM 0x09
|
||||
#define ATM_L2_HDLC_NRM 0x0a
|
||||
#define ATM_L2_HDLC_ABM 0x0b
|
||||
#define ATM_L2_ISO8802 0x0c
|
||||
#define ATM_L2_X75 0x0d
|
||||
#define ATM_L2_Q922 0x0e
|
||||
#define ATM_L2_USER 0x10
|
||||
#define ATM_L2_ISO7776 0x11
|
||||
|
||||
#define ATM_L3_NONE 0
|
||||
#define ATM_L3_X25 0x06
|
||||
#define ATM_L3_ISO8208 0x07
|
||||
#define ATM_L3_X223 0x08
|
||||
#define ATM_L3_ISO8473 0x09
|
||||
#define ATM_L3_T70 0x0a
|
||||
#define ATM_L3_TR9577 0x0b
|
||||
#define ATM_L3_H310 0x0c
|
||||
#define ATM_L3_H321 0x0d
|
||||
#define ATM_L3_USER 0x10
|
||||
|
||||
#define ATM_HL_NONE 0
|
||||
#define ATM_HL_ISO 0x01
|
||||
#define ATM_HL_USER 0x02
|
||||
#define ATM_HL_HLP 0x03
|
||||
#define ATM_HL_VENDOR 0x04
|
||||
|
||||
#define ATM_IMD_NONE 0
|
||||
#define ATM_IMD_NORMAL 1
|
||||
#define ATM_IMD_EXTENDED 2
|
||||
|
||||
#define ATM_TT_NONE 0
|
||||
#define ATM_TT_RX 1
|
||||
#define ATM_TT_TX 2
|
||||
#define ATM_TT_RXTX 3
|
||||
|
||||
#define ATM_MC_NONE 0
|
||||
#define ATM_MC_TS 1
|
||||
#define ATM_MC_TS_FEC 2
|
||||
#define ATM_MC_PS 3
|
||||
#define ATM_MC_PS_FEC 4
|
||||
#define ATM_MC_H221 5
|
||||
|
||||
#define ATM_MAX_HLI 8
|
||||
|
||||
struct atm_blli {
|
||||
unsigned char l2_proto;
|
||||
union {
|
||||
struct {
|
||||
unsigned char mode;
|
||||
|
||||
unsigned char window;
|
||||
} itu;
|
||||
unsigned char user;
|
||||
} l2;
|
||||
unsigned char l3_proto;
|
||||
union {
|
||||
struct {
|
||||
unsigned char mode;
|
||||
|
||||
unsigned char def_size;
|
||||
|
||||
unsigned char window;
|
||||
} itu;
|
||||
unsigned char user;
|
||||
struct {
|
||||
unsigned char term_type;
|
||||
unsigned char fw_mpx_cap;
|
||||
|
||||
unsigned char bw_mpx_cap;
|
||||
|
||||
} h310;
|
||||
struct {
|
||||
unsigned char ipi;
|
||||
unsigned char snap[5];
|
||||
|
||||
} tr9577;
|
||||
} l3;
|
||||
} __ATM_API_ALIGN;
|
||||
|
||||
struct atm_bhli {
|
||||
unsigned char hl_type;
|
||||
unsigned char hl_length;
|
||||
|
||||
unsigned char hl_info[ATM_MAX_HLI];
|
||||
};
|
||||
|
||||
#define ATM_MAX_BLLI 3
|
||||
|
||||
struct atm_sap {
|
||||
struct atm_bhli bhli;
|
||||
struct atm_blli blli[ATM_MAX_BLLI] __ATM_API_ALIGN;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
34
libc/kernel/common/linux/attribute_container.h
Normal file
34
libc/kernel/common/linux/attribute_container.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _ATTRIBUTE_CONTAINER_H_
|
||||
#define _ATTRIBUTE_CONTAINER_H_
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/klist.h>
|
||||
#include <linux/spinlock.h>
|
||||
|
||||
struct attribute_container {
|
||||
struct list_head node;
|
||||
struct klist containers;
|
||||
struct class *class;
|
||||
struct class_device_attribute **attrs;
|
||||
int (*match)(struct attribute_container *, struct device *);
|
||||
#define ATTRIBUTE_CONTAINER_NO_CLASSDEVS 0x01
|
||||
unsigned long flags;
|
||||
};
|
||||
|
||||
struct attribute_container *attribute_container_classdev_to_container(struct class_device *);
|
||||
struct class_device *attribute_container_find_class_device(struct attribute_container *, struct device *);
|
||||
struct class_device_attribute **attribute_container_classdev_to_attrs(const struct class_device *classdev);
|
||||
|
||||
#endif
|
56
libc/kernel/common/linux/auto_fs.h
Normal file
56
libc/kernel/common/linux/auto_fs.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_AUTO_FS_H
|
||||
#define _LINUX_AUTO_FS_H
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define AUTOFS_PROTO_VERSION 3
|
||||
|
||||
#define AUTOFS_MAX_PROTO_VERSION AUTOFS_PROTO_VERSION
|
||||
#define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION
|
||||
|
||||
#if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) || defined(__powerpc__) || defined(__s390__)
|
||||
typedef unsigned int autofs_wqt_t;
|
||||
#else
|
||||
typedef unsigned long autofs_wqt_t;
|
||||
#endif
|
||||
|
||||
#define autofs_ptype_missing 0
|
||||
#define autofs_ptype_expire 1
|
||||
|
||||
struct autofs_packet_hdr {
|
||||
int proto_version;
|
||||
int type;
|
||||
};
|
||||
|
||||
struct autofs_packet_missing {
|
||||
struct autofs_packet_hdr hdr;
|
||||
autofs_wqt_t wait_queue_token;
|
||||
int len;
|
||||
char name[NAME_MAX+1];
|
||||
};
|
||||
|
||||
struct autofs_packet_expire {
|
||||
struct autofs_packet_hdr hdr;
|
||||
int len;
|
||||
char name[NAME_MAX+1];
|
||||
};
|
||||
|
||||
#define AUTOFS_IOC_READY _IO(0x93,0x60)
|
||||
#define AUTOFS_IOC_FAIL _IO(0x93,0x61)
|
||||
#define AUTOFS_IOC_CATATONIC _IO(0x93,0x62)
|
||||
#define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int)
|
||||
#define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long)
|
||||
#define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire)
|
||||
|
||||
#endif
|
17
libc/kernel/common/linux/autoconf.h
Normal file
17
libc/kernel/common/linux/autoconf.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef LINUX_AUTOCONF_CRAP_GOES_HERE
|
||||
#define LINUX_AUTOCONF_CRAP_GOES_HERE
|
||||
|
||||
#define AUTOCONF_INCLUDED
|
||||
|
||||
#endif
|
40
libc/kernel/common/linux/auxvec.h
Normal file
40
libc/kernel/common/linux/auxvec.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_AUXVEC_H
|
||||
#define _LINUX_AUXVEC_H
|
||||
|
||||
#include <asm/auxvec.h>
|
||||
|
||||
#define AT_NULL 0
|
||||
#define AT_IGNORE 1
|
||||
#define AT_EXECFD 2
|
||||
#define AT_PHDR 3
|
||||
#define AT_PHENT 4
|
||||
#define AT_PHNUM 5
|
||||
#define AT_PAGESZ 6
|
||||
#define AT_BASE 7
|
||||
#define AT_FLAGS 8
|
||||
#define AT_ENTRY 9
|
||||
#define AT_NOTELF 10
|
||||
#define AT_UID 11
|
||||
#define AT_EUID 12
|
||||
#define AT_GID 13
|
||||
#define AT_EGID 14
|
||||
#define AT_PLATFORM 15
|
||||
#define AT_HWCAP 16
|
||||
#define AT_CLKTCK 17
|
||||
|
||||
#define AT_SECURE 23
|
||||
|
||||
#define AT_VECTOR_SIZE 44
|
||||
|
||||
#endif
|
53
libc/kernel/common/linux/backing-dev.h
Normal file
53
libc/kernel/common/linux/backing-dev.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_BACKING_DEV_H
|
||||
#define _LINUX_BACKING_DEV_H
|
||||
|
||||
#include <asm/atomic.h>
|
||||
|
||||
enum bdi_state {
|
||||
BDI_pdflush,
|
||||
BDI_write_congested,
|
||||
BDI_read_congested,
|
||||
BDI_unused,
|
||||
};
|
||||
|
||||
typedef int (congested_fn)(void *, int);
|
||||
|
||||
struct backing_dev_info {
|
||||
unsigned long ra_pages;
|
||||
unsigned long state;
|
||||
unsigned int capabilities;
|
||||
congested_fn *congested_fn;
|
||||
void *congested_data;
|
||||
void (*unplug_io_fn)(struct backing_dev_info *, struct page *);
|
||||
void *unplug_io_data;
|
||||
};
|
||||
|
||||
#define BDI_CAP_NO_ACCT_DIRTY 0x00000001
|
||||
#define BDI_CAP_NO_WRITEBACK 0x00000002
|
||||
#define BDI_CAP_MAP_COPY 0x00000004
|
||||
#define BDI_CAP_MAP_DIRECT 0x00000008
|
||||
#define BDI_CAP_READ_MAP 0x00000010
|
||||
#define BDI_CAP_WRITE_MAP 0x00000020
|
||||
#define BDI_CAP_EXEC_MAP 0x00000040
|
||||
#define BDI_CAP_VMFLAGS (BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP)
|
||||
|
||||
#if defined(VM_MAYREAD) && BDI_CAP_READ_MAP != (VM_MAYREAD || BDI_CAP_WRITE_MAP != (VM_MAYWRITE || BDI_CAP_EXEC_MAP != VM_MAYEXEC))
|
||||
#error please change backing_dev_info::capabilities flags
|
||||
#endif
|
||||
|
||||
#define bdi_cap_writeback_dirty(bdi) (!((bdi)->capabilities & BDI_CAP_NO_WRITEBACK))
|
||||
#define bdi_cap_account_dirty(bdi) (!((bdi)->capabilities & BDI_CAP_NO_ACCT_DIRTY))
|
||||
#define mapping_cap_writeback_dirty(mapping) bdi_cap_writeback_dirty((mapping)->backing_dev_info)
|
||||
#define mapping_cap_account_dirty(mapping) bdi_cap_account_dirty((mapping)->backing_dev_info)
|
||||
#endif
|
186
libc/kernel/common/linux/binder.h
Normal file
186
libc/kernel/common/linux/binder.h
Normal file
@@ -0,0 +1,186 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_BINDER_H
|
||||
#define _LINUX_BINDER_H
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define B_PACK_CHARS(c1, c2, c3, c4) ((((c1)<<24)) | (((c2)<<16)) | (((c3)<<8)) | (c4))
|
||||
#define B_TYPE_LARGE 0x85
|
||||
|
||||
enum {
|
||||
BINDER_TYPE_BINDER = B_PACK_CHARS('s', 'b', '*', B_TYPE_LARGE),
|
||||
BINDER_TYPE_WEAK_BINDER = B_PACK_CHARS('w', 'b', '*', B_TYPE_LARGE),
|
||||
BINDER_TYPE_HANDLE = B_PACK_CHARS('s', 'h', '*', B_TYPE_LARGE),
|
||||
BINDER_TYPE_WEAK_HANDLE = B_PACK_CHARS('w', 'h', '*', B_TYPE_LARGE),
|
||||
BINDER_TYPE_FD = B_PACK_CHARS('f', 'd', '*', B_TYPE_LARGE),
|
||||
};
|
||||
|
||||
enum {
|
||||
FLAT_BINDER_FLAG_PRIORITY_MASK = 0xff,
|
||||
FLAT_BINDER_FLAG_ACCEPTS_FDS = 0x100,
|
||||
};
|
||||
|
||||
struct flat_binder_object {
|
||||
|
||||
unsigned long type;
|
||||
unsigned long flags;
|
||||
|
||||
union {
|
||||
void *binder;
|
||||
signed long handle;
|
||||
};
|
||||
|
||||
void *cookie;
|
||||
};
|
||||
|
||||
struct binder_write_read {
|
||||
signed long write_size;
|
||||
signed long write_consumed;
|
||||
unsigned long write_buffer;
|
||||
signed long read_size;
|
||||
signed long read_consumed;
|
||||
unsigned long read_buffer;
|
||||
};
|
||||
|
||||
struct binder_version {
|
||||
|
||||
signed long protocol_version;
|
||||
};
|
||||
|
||||
#define BINDER_CURRENT_PROTOCOL_VERSION 7
|
||||
|
||||
#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
|
||||
#define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, int64_t)
|
||||
#define BINDER_SET_MAX_THREADS _IOW('b', 5, size_t)
|
||||
#define BINDER_SET_IDLE_PRIORITY _IOW('b', 6, int)
|
||||
#define BINDER_SET_CONTEXT_MGR _IOW('b', 7, int)
|
||||
#define BINDER_THREAD_EXIT _IOW('b', 8, int)
|
||||
#define BINDER_VERSION _IOWR('b', 9, struct binder_version)
|
||||
|
||||
enum transaction_flags {
|
||||
TF_ONE_WAY = 0x01,
|
||||
TF_ROOT_OBJECT = 0x04,
|
||||
TF_STATUS_CODE = 0x08,
|
||||
TF_ACCEPT_FDS = 0x10,
|
||||
};
|
||||
|
||||
struct binder_transaction_data {
|
||||
|
||||
union {
|
||||
size_t handle;
|
||||
void *ptr;
|
||||
} target;
|
||||
void *cookie;
|
||||
unsigned int code;
|
||||
|
||||
unsigned int flags;
|
||||
pid_t sender_pid;
|
||||
uid_t sender_euid;
|
||||
size_t data_size;
|
||||
size_t offsets_size;
|
||||
|
||||
union {
|
||||
struct {
|
||||
|
||||
const void *buffer;
|
||||
|
||||
const void *offsets;
|
||||
} ptr;
|
||||
uint8_t buf[8];
|
||||
} data;
|
||||
};
|
||||
|
||||
struct binder_ptr_cookie {
|
||||
void *ptr;
|
||||
void *cookie;
|
||||
};
|
||||
|
||||
struct binder_pri_desc {
|
||||
int priority;
|
||||
int desc;
|
||||
};
|
||||
|
||||
struct binder_pri_ptr_cookie {
|
||||
int priority;
|
||||
void *ptr;
|
||||
void *cookie;
|
||||
};
|
||||
|
||||
enum BinderDriverReturnProtocol {
|
||||
BR_ERROR = _IOR_BAD('r', 0, int),
|
||||
|
||||
BR_OK = _IO('r', 1),
|
||||
|
||||
BR_TRANSACTION = _IOR_BAD('r', 2, struct binder_transaction_data),
|
||||
BR_REPLY = _IOR_BAD('r', 3, struct binder_transaction_data),
|
||||
|
||||
BR_ACQUIRE_RESULT = _IOR_BAD('r', 4, int),
|
||||
|
||||
BR_DEAD_REPLY = _IO('r', 5),
|
||||
|
||||
BR_TRANSACTION_COMPLETE = _IO('r', 6),
|
||||
|
||||
BR_INCREFS = _IOR_BAD('r', 7, struct binder_ptr_cookie),
|
||||
BR_ACQUIRE = _IOR_BAD('r', 8, struct binder_ptr_cookie),
|
||||
BR_RELEASE = _IOR_BAD('r', 9, struct binder_ptr_cookie),
|
||||
BR_DECREFS = _IOR_BAD('r', 10, struct binder_ptr_cookie),
|
||||
|
||||
BR_ATTEMPT_ACQUIRE = _IOR_BAD('r', 11, struct binder_pri_ptr_cookie),
|
||||
|
||||
BR_NOOP = _IO('r', 12),
|
||||
|
||||
BR_SPAWN_LOOPER = _IO('r', 13),
|
||||
|
||||
BR_FINISHED = _IO('r', 14),
|
||||
|
||||
BR_DEAD_BINDER = _IOR_BAD('r', 15, void *),
|
||||
|
||||
BR_CLEAR_DEATH_NOTIFICATION_DONE = _IOR_BAD('r', 16, void *),
|
||||
|
||||
BR_FAILED_REPLY = _IO('r', 17),
|
||||
|
||||
};
|
||||
|
||||
enum BinderDriverCommandProtocol {
|
||||
BC_TRANSACTION = _IOW_BAD('c', 0, struct binder_transaction_data),
|
||||
BC_REPLY = _IOW_BAD('c', 1, struct binder_transaction_data),
|
||||
|
||||
BC_ACQUIRE_RESULT = _IOW_BAD('c', 2, int),
|
||||
|
||||
BC_FREE_BUFFER = _IOW_BAD('c', 3, int),
|
||||
|
||||
BC_INCREFS = _IOW_BAD('c', 4, int),
|
||||
BC_ACQUIRE = _IOW_BAD('c', 5, int),
|
||||
BC_RELEASE = _IOW_BAD('c', 6, int),
|
||||
BC_DECREFS = _IOW_BAD('c', 7, int),
|
||||
|
||||
BC_INCREFS_DONE = _IOW_BAD('c', 8, struct binder_ptr_cookie),
|
||||
BC_ACQUIRE_DONE = _IOW_BAD('c', 9, struct binder_ptr_cookie),
|
||||
|
||||
BC_ATTEMPT_ACQUIRE = _IOW_BAD('c', 10, struct binder_pri_desc),
|
||||
|
||||
BC_REGISTER_LOOPER = _IO('c', 11),
|
||||
|
||||
BC_ENTER_LOOPER = _IO('c', 12),
|
||||
BC_EXIT_LOOPER = _IO('c', 13),
|
||||
|
||||
BC_REQUEST_DEATH_NOTIFICATION = _IOW_BAD('c', 14, struct binder_ptr_cookie),
|
||||
|
||||
BC_CLEAR_DEATH_NOTIFICATION = _IOW_BAD('c', 15, struct binder_ptr_cookie),
|
||||
|
||||
BC_DEAD_BINDER_DONE = _IOW_BAD('c', 16, void *),
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
23
libc/kernel/common/linux/binfmts.h
Normal file
23
libc/kernel/common/linux/binfmts.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_BINFMTS_H
|
||||
#define _LINUX_BINFMTS_H
|
||||
|
||||
#include <linux/capability.h>
|
||||
|
||||
struct pt_regs;
|
||||
|
||||
#define MAX_ARG_PAGES 32
|
||||
|
||||
#define BINPRM_BUF_SIZE 128
|
||||
|
||||
#endif
|
171
libc/kernel/common/linux/bio.h
Normal file
171
libc/kernel/common/linux/bio.h
Normal file
@@ -0,0 +1,171 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __LINUX_BIO_H
|
||||
#define __LINUX_BIO_H
|
||||
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/mempool.h>
|
||||
#include <linux/ioprio.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
|
||||
#if defined(BIO_VMERGE_MAX_SIZE) && defined(BIO_VMERGE_BOUNDARY)
|
||||
#define BIOVEC_VIRT_START_SIZE(x) (bvec_to_phys(x) & (BIO_VMERGE_BOUNDARY - 1))
|
||||
#define BIOVEC_VIRT_OVERSIZE(x) ((x) > BIO_VMERGE_MAX_SIZE)
|
||||
#else
|
||||
#define BIOVEC_VIRT_START_SIZE(x) 0
|
||||
#define BIOVEC_VIRT_OVERSIZE(x) 0
|
||||
#endif
|
||||
|
||||
#ifndef BIO_VMERGE_BOUNDARY
|
||||
#define BIO_VMERGE_BOUNDARY 0
|
||||
#endif
|
||||
|
||||
#define BIO_DEBUG
|
||||
|
||||
#ifdef BIO_DEBUG
|
||||
#define BIO_BUG_ON BUG_ON
|
||||
#else
|
||||
#define BIO_BUG_ON
|
||||
#endif
|
||||
|
||||
#define BIO_MAX_PAGES 256
|
||||
#define BIO_MAX_SIZE (BIO_MAX_PAGES << PAGE_CACHE_SHIFT)
|
||||
#define BIO_MAX_SECTORS (BIO_MAX_SIZE >> 9)
|
||||
|
||||
struct bio_vec {
|
||||
struct page *bv_page;
|
||||
unsigned int bv_len;
|
||||
unsigned int bv_offset;
|
||||
};
|
||||
|
||||
struct bio_set;
|
||||
struct bio;
|
||||
typedef int (bio_end_io_t) (struct bio *, unsigned int, int);
|
||||
typedef void (bio_destructor_t) (struct bio *);
|
||||
|
||||
struct bio {
|
||||
sector_t bi_sector;
|
||||
struct bio *bi_next;
|
||||
struct block_device *bi_bdev;
|
||||
unsigned long bi_flags;
|
||||
unsigned long bi_rw;
|
||||
|
||||
unsigned short bi_vcnt;
|
||||
unsigned short bi_idx;
|
||||
|
||||
unsigned short bi_phys_segments;
|
||||
|
||||
unsigned short bi_hw_segments;
|
||||
|
||||
unsigned int bi_size;
|
||||
|
||||
unsigned int bi_hw_front_size;
|
||||
unsigned int bi_hw_back_size;
|
||||
|
||||
unsigned int bi_max_vecs;
|
||||
|
||||
struct bio_vec *bi_io_vec;
|
||||
|
||||
bio_end_io_t *bi_end_io;
|
||||
atomic_t bi_cnt;
|
||||
|
||||
void *bi_private;
|
||||
|
||||
bio_destructor_t *bi_destructor;
|
||||
};
|
||||
|
||||
#define BIO_UPTODATE 0
|
||||
#define BIO_RW_BLOCK 1
|
||||
#define BIO_EOF 2
|
||||
#define BIO_SEG_VALID 3
|
||||
#define BIO_CLONED 4
|
||||
#define BIO_BOUNCED 5
|
||||
#define BIO_USER_MAPPED 6
|
||||
#define BIO_EOPNOTSUPP 7
|
||||
#define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag)))
|
||||
|
||||
#define BIO_POOL_BITS (4)
|
||||
#define BIO_POOL_OFFSET (BITS_PER_LONG - BIO_POOL_BITS)
|
||||
#define BIO_POOL_MASK (1UL << BIO_POOL_OFFSET)
|
||||
#define BIO_POOL_IDX(bio) ((bio)->bi_flags >> BIO_POOL_OFFSET)
|
||||
|
||||
#define BIO_RW 0
|
||||
#define BIO_RW_AHEAD 1
|
||||
#define BIO_RW_BARRIER 2
|
||||
#define BIO_RW_FAILFAST 3
|
||||
#define BIO_RW_SYNC 4
|
||||
|
||||
#define BIO_PRIO_SHIFT (8 * sizeof(unsigned long) - IOPRIO_BITS)
|
||||
#define bio_prio(bio) ((bio)->bi_rw >> BIO_PRIO_SHIFT)
|
||||
#define bio_prio_valid(bio) ioprio_valid(bio_prio(bio))
|
||||
|
||||
#define bio_set_prio(bio, prio) do { WARN_ON(prio >= (1 << IOPRIO_BITS)); (bio)->bi_rw &= ((1UL << BIO_PRIO_SHIFT) - 1); (bio)->bi_rw |= ((unsigned long) (prio) << BIO_PRIO_SHIFT); } while (0)
|
||||
|
||||
#define bio_iovec_idx(bio, idx) (&((bio)->bi_io_vec[(idx)]))
|
||||
#define bio_iovec(bio) bio_iovec_idx((bio), (bio)->bi_idx)
|
||||
#define bio_page(bio) bio_iovec((bio))->bv_page
|
||||
#define bio_offset(bio) bio_iovec((bio))->bv_offset
|
||||
#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx)
|
||||
#define bio_sectors(bio) ((bio)->bi_size >> 9)
|
||||
#define bio_cur_sectors(bio) (bio_iovec(bio)->bv_len >> 9)
|
||||
#define bio_data(bio) (page_address(bio_page((bio))) + bio_offset((bio)))
|
||||
#define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER))
|
||||
#define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC))
|
||||
#define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST))
|
||||
#define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD))
|
||||
|
||||
#define bio_to_phys(bio) (page_to_phys(bio_page((bio))) + (unsigned long) bio_offset((bio)))
|
||||
#define bvec_to_phys(bv) (page_to_phys((bv)->bv_page) + (unsigned long) (bv)->bv_offset)
|
||||
|
||||
#define __bio_kmap_atomic(bio, idx, kmtype) (kmap_atomic(bio_iovec_idx((bio), (idx))->bv_page, kmtype) + bio_iovec_idx((bio), (idx))->bv_offset)
|
||||
|
||||
#define __bio_kunmap_atomic(addr, kmtype) kunmap_atomic(addr, kmtype)
|
||||
|
||||
#define __BVEC_END(bio) bio_iovec_idx((bio), (bio)->bi_vcnt - 1)
|
||||
#define __BVEC_START(bio) bio_iovec_idx((bio), (bio)->bi_idx)
|
||||
|
||||
#ifndef BIOVEC_PHYS_MERGEABLE
|
||||
#define BIOVEC_PHYS_MERGEABLE(vec1, vec2) ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))
|
||||
#endif
|
||||
|
||||
#define BIOVEC_VIRT_MERGEABLE(vec1, vec2) ((((bvec_to_phys((vec1)) + (vec1)->bv_len) | bvec_to_phys((vec2))) & (BIO_VMERGE_BOUNDARY - 1)) == 0)
|
||||
#define __BIO_SEG_BOUNDARY(addr1, addr2, mask) (((addr1) | (mask)) == (((addr2) - 1) | (mask)))
|
||||
#define BIOVEC_SEG_BOUNDARY(q, b1, b2) __BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, (q)->seg_boundary_mask)
|
||||
#define BIO_SEG_BOUNDARY(q, b1, b2) BIOVEC_SEG_BOUNDARY((q), __BVEC_END((b1)), __BVEC_START((b2)))
|
||||
|
||||
#define bio_io_error(bio, bytes) bio_endio((bio), (bytes), -EIO)
|
||||
|
||||
#define __bio_for_each_segment(bvl, bio, i, start_idx) for (bvl = bio_iovec_idx((bio), (start_idx)), i = (start_idx); i < (bio)->bi_vcnt; bvl++, i++)
|
||||
|
||||
#define bio_for_each_segment(bvl, bio, i) __bio_for_each_segment(bvl, bio, i, (bio)->bi_idx)
|
||||
|
||||
#define bio_get(bio) atomic_inc(&(bio)->bi_cnt)
|
||||
|
||||
struct bio_pair {
|
||||
struct bio bio1, bio2;
|
||||
struct bio_vec bv1, bv2;
|
||||
atomic_t cnt;
|
||||
int error;
|
||||
};
|
||||
|
||||
struct request_queue;
|
||||
|
||||
struct sg_iovec;
|
||||
|
||||
#define bvec_kmap_irq(bvec, flags) (page_address((bvec)->bv_page) + (bvec)->bv_offset)
|
||||
#define bvec_kunmap_irq(buf, flags) do { *(flags) = 0; } while (0)
|
||||
|
||||
#define __bio_kunmap_irq(buf, flags) bvec_kunmap_irq(buf, flags)
|
||||
#define bio_kmap_irq(bio, flags) __bio_kmap_irq((bio), (bio)->bi_idx, (flags))
|
||||
#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags)
|
||||
#endif
|
24
libc/kernel/common/linux/bitmap.h
Normal file
24
libc/kernel/common/linux/bitmap.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __LINUX_BITMAP_H
|
||||
#define __LINUX_BITMAP_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/string.h>
|
||||
|
||||
#define BITMAP_LAST_WORD_MASK(nbits) ( ((nbits) % BITS_PER_LONG) ? (1UL<<((nbits) % BITS_PER_LONG))-1 : ~0UL )
|
||||
|
||||
#endif
|
||||
#endif
|
18
libc/kernel/common/linux/bitops.h
Normal file
18
libc/kernel/common/linux/bitops.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_BITOPS_H
|
||||
#define _LINUX_BITOPS_H
|
||||
#include <asm/types.h>
|
||||
|
||||
#include <asm/bitops.h>
|
||||
|
||||
#endif
|
461
libc/kernel/common/linux/blkdev.h
Normal file
461
libc/kernel/common/linux/blkdev.h
Normal file
@@ -0,0 +1,461 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_BLKDEV_H
|
||||
#define _LINUX_BLKDEV_H
|
||||
|
||||
#include <linux/major.h>
|
||||
#include <linux/genhd.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/backing-dev.h>
|
||||
#include <linux/wait.h>
|
||||
#include <linux/mempool.h>
|
||||
#include <linux/bio.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/stringify.h>
|
||||
|
||||
#include <asm/scatterlist.h>
|
||||
|
||||
struct scsi_ioctl_command;
|
||||
|
||||
struct request_queue;
|
||||
typedef struct request_queue request_queue_t;
|
||||
struct elevator_queue;
|
||||
typedef struct elevator_queue elevator_t;
|
||||
struct request_pm_state;
|
||||
struct blk_trace;
|
||||
|
||||
#define BLKDEV_MIN_RQ 4
|
||||
#define BLKDEV_MAX_RQ 128
|
||||
|
||||
struct as_io_context {
|
||||
spinlock_t lock;
|
||||
|
||||
void (*dtor)(struct as_io_context *aic);
|
||||
void (*exit)(struct as_io_context *aic);
|
||||
|
||||
unsigned long state;
|
||||
atomic_t nr_queued;
|
||||
atomic_t nr_dispatched;
|
||||
|
||||
unsigned long last_end_request;
|
||||
unsigned long ttime_total;
|
||||
unsigned long ttime_samples;
|
||||
unsigned long ttime_mean;
|
||||
|
||||
unsigned int seek_samples;
|
||||
sector_t last_request_pos;
|
||||
u64 seek_total;
|
||||
sector_t seek_mean;
|
||||
};
|
||||
|
||||
struct cfq_queue;
|
||||
struct cfq_io_context {
|
||||
struct rb_node rb_node;
|
||||
void *key;
|
||||
|
||||
struct cfq_queue *cfqq[2];
|
||||
|
||||
struct io_context *ioc;
|
||||
|
||||
unsigned long last_end_request;
|
||||
sector_t last_request_pos;
|
||||
unsigned long last_queue;
|
||||
|
||||
unsigned long ttime_total;
|
||||
unsigned long ttime_samples;
|
||||
unsigned long ttime_mean;
|
||||
|
||||
unsigned int seek_samples;
|
||||
u64 seek_total;
|
||||
sector_t seek_mean;
|
||||
|
||||
struct list_head queue_list;
|
||||
|
||||
void (*dtor)(struct io_context *);
|
||||
void (*exit)(struct io_context *);
|
||||
};
|
||||
|
||||
struct io_context {
|
||||
atomic_t refcount;
|
||||
struct task_struct *task;
|
||||
|
||||
int (*set_ioprio)(struct io_context *, unsigned int);
|
||||
|
||||
unsigned long last_waited;
|
||||
int nr_batch_requests;
|
||||
|
||||
struct as_io_context *aic;
|
||||
struct rb_root cic_root;
|
||||
};
|
||||
|
||||
struct io_context *current_io_context(gfp_t gfp_flags);
|
||||
struct io_context *get_io_context(gfp_t gfp_flags);
|
||||
|
||||
struct request;
|
||||
typedef void (rq_end_io_fn)(struct request *, int);
|
||||
|
||||
struct request_list {
|
||||
int count[2];
|
||||
int starved[2];
|
||||
int elvpriv;
|
||||
mempool_t *rq_pool;
|
||||
wait_queue_head_t wait[2];
|
||||
};
|
||||
|
||||
#define BLK_MAX_CDB 16
|
||||
|
||||
struct request {
|
||||
struct list_head queuelist;
|
||||
struct list_head donelist;
|
||||
|
||||
unsigned long flags;
|
||||
|
||||
sector_t sector;
|
||||
unsigned long nr_sectors;
|
||||
|
||||
unsigned int current_nr_sectors;
|
||||
|
||||
sector_t hard_sector;
|
||||
unsigned long hard_nr_sectors;
|
||||
|
||||
unsigned int hard_cur_sectors;
|
||||
|
||||
struct bio *bio;
|
||||
struct bio *biotail;
|
||||
|
||||
void *elevator_private;
|
||||
void *completion_data;
|
||||
|
||||
int rq_status;
|
||||
int errors;
|
||||
struct gendisk *rq_disk;
|
||||
unsigned long start_time;
|
||||
|
||||
unsigned short nr_phys_segments;
|
||||
|
||||
unsigned short nr_hw_segments;
|
||||
|
||||
unsigned short ioprio;
|
||||
|
||||
int tag;
|
||||
|
||||
int ref_count;
|
||||
request_queue_t *q;
|
||||
struct request_list *rl;
|
||||
|
||||
struct completion *waiting;
|
||||
void *special;
|
||||
char *buffer;
|
||||
|
||||
unsigned int cmd_len;
|
||||
unsigned char cmd[BLK_MAX_CDB];
|
||||
|
||||
unsigned int data_len;
|
||||
unsigned int sense_len;
|
||||
void *data;
|
||||
void *sense;
|
||||
|
||||
unsigned int timeout;
|
||||
int retries;
|
||||
|
||||
rq_end_io_fn *end_io;
|
||||
void *end_io_data;
|
||||
};
|
||||
|
||||
enum rq_flag_bits {
|
||||
__REQ_RW,
|
||||
__REQ_FAILFAST,
|
||||
__REQ_SORTED,
|
||||
__REQ_SOFTBARRIER,
|
||||
__REQ_HARDBARRIER,
|
||||
__REQ_FUA,
|
||||
__REQ_CMD,
|
||||
__REQ_NOMERGE,
|
||||
__REQ_STARTED,
|
||||
__REQ_DONTPREP,
|
||||
__REQ_QUEUED,
|
||||
__REQ_ELVPRIV,
|
||||
|
||||
__REQ_PC,
|
||||
__REQ_BLOCK_PC,
|
||||
__REQ_SENSE,
|
||||
|
||||
__REQ_FAILED,
|
||||
__REQ_QUIET,
|
||||
__REQ_SPECIAL,
|
||||
__REQ_DRIVE_CMD,
|
||||
__REQ_DRIVE_TASK,
|
||||
__REQ_DRIVE_TASKFILE,
|
||||
__REQ_PREEMPT,
|
||||
__REQ_PM_SUSPEND,
|
||||
__REQ_PM_RESUME,
|
||||
__REQ_PM_SHUTDOWN,
|
||||
__REQ_ORDERED_COLOR,
|
||||
__REQ_RW_SYNC,
|
||||
__REQ_NR_BITS,
|
||||
};
|
||||
|
||||
#define REQ_RW (1 << __REQ_RW)
|
||||
#define REQ_FAILFAST (1 << __REQ_FAILFAST)
|
||||
#define REQ_SORTED (1 << __REQ_SORTED)
|
||||
#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER)
|
||||
#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER)
|
||||
#define REQ_FUA (1 << __REQ_FUA)
|
||||
#define REQ_CMD (1 << __REQ_CMD)
|
||||
#define REQ_NOMERGE (1 << __REQ_NOMERGE)
|
||||
#define REQ_STARTED (1 << __REQ_STARTED)
|
||||
#define REQ_DONTPREP (1 << __REQ_DONTPREP)
|
||||
#define REQ_QUEUED (1 << __REQ_QUEUED)
|
||||
#define REQ_ELVPRIV (1 << __REQ_ELVPRIV)
|
||||
#define REQ_PC (1 << __REQ_PC)
|
||||
#define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC)
|
||||
#define REQ_SENSE (1 << __REQ_SENSE)
|
||||
#define REQ_FAILED (1 << __REQ_FAILED)
|
||||
#define REQ_QUIET (1 << __REQ_QUIET)
|
||||
#define REQ_SPECIAL (1 << __REQ_SPECIAL)
|
||||
#define REQ_DRIVE_CMD (1 << __REQ_DRIVE_CMD)
|
||||
#define REQ_DRIVE_TASK (1 << __REQ_DRIVE_TASK)
|
||||
#define REQ_DRIVE_TASKFILE (1 << __REQ_DRIVE_TASKFILE)
|
||||
#define REQ_PREEMPT (1 << __REQ_PREEMPT)
|
||||
#define REQ_PM_SUSPEND (1 << __REQ_PM_SUSPEND)
|
||||
#define REQ_PM_RESUME (1 << __REQ_PM_RESUME)
|
||||
#define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN)
|
||||
#define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR)
|
||||
#define REQ_RW_SYNC (1 << __REQ_RW_SYNC)
|
||||
|
||||
struct request_pm_state
|
||||
{
|
||||
|
||||
int pm_step;
|
||||
|
||||
u32 pm_state;
|
||||
void* data;
|
||||
};
|
||||
|
||||
#include <linux/elevator.h>
|
||||
|
||||
typedef int (merge_request_fn) (request_queue_t *, struct request *,
|
||||
struct bio *);
|
||||
typedef int (merge_requests_fn) (request_queue_t *, struct request *,
|
||||
struct request *);
|
||||
typedef void (request_fn_proc) (request_queue_t *q);
|
||||
typedef int (make_request_fn) (request_queue_t *q, struct bio *bio);
|
||||
typedef int (prep_rq_fn) (request_queue_t *, struct request *);
|
||||
typedef void (unplug_fn) (request_queue_t *);
|
||||
|
||||
struct bio_vec;
|
||||
typedef int (merge_bvec_fn) (request_queue_t *, struct bio *, struct bio_vec *);
|
||||
typedef void (activity_fn) (void *data, int rw);
|
||||
typedef int (issue_flush_fn) (request_queue_t *, struct gendisk *, sector_t *);
|
||||
typedef void (prepare_flush_fn) (request_queue_t *, struct request *);
|
||||
typedef void (softirq_done_fn)(struct request *);
|
||||
|
||||
enum blk_queue_state {
|
||||
Queue_down,
|
||||
Queue_up,
|
||||
};
|
||||
|
||||
struct blk_queue_tag {
|
||||
struct request **tag_index;
|
||||
unsigned long *tag_map;
|
||||
struct list_head busy_list;
|
||||
int busy;
|
||||
int max_depth;
|
||||
int real_max_depth;
|
||||
atomic_t refcnt;
|
||||
};
|
||||
|
||||
struct request_queue
|
||||
{
|
||||
|
||||
struct list_head queue_head;
|
||||
struct request *last_merge;
|
||||
elevator_t *elevator;
|
||||
|
||||
struct request_list rq;
|
||||
|
||||
request_fn_proc *request_fn;
|
||||
merge_request_fn *back_merge_fn;
|
||||
merge_request_fn *front_merge_fn;
|
||||
merge_requests_fn *merge_requests_fn;
|
||||
make_request_fn *make_request_fn;
|
||||
prep_rq_fn *prep_rq_fn;
|
||||
unplug_fn *unplug_fn;
|
||||
merge_bvec_fn *merge_bvec_fn;
|
||||
activity_fn *activity_fn;
|
||||
issue_flush_fn *issue_flush_fn;
|
||||
prepare_flush_fn *prepare_flush_fn;
|
||||
softirq_done_fn *softirq_done_fn;
|
||||
|
||||
sector_t end_sector;
|
||||
struct request *boundary_rq;
|
||||
|
||||
struct timer_list unplug_timer;
|
||||
int unplug_thresh;
|
||||
unsigned long unplug_delay;
|
||||
struct work_struct unplug_work;
|
||||
|
||||
struct backing_dev_info backing_dev_info;
|
||||
|
||||
void *queuedata;
|
||||
|
||||
void *activity_data;
|
||||
|
||||
unsigned long bounce_pfn;
|
||||
gfp_t bounce_gfp;
|
||||
|
||||
unsigned long queue_flags;
|
||||
|
||||
spinlock_t __queue_lock;
|
||||
spinlock_t *queue_lock;
|
||||
|
||||
struct kobject kobj;
|
||||
|
||||
unsigned long nr_requests;
|
||||
unsigned int nr_congestion_on;
|
||||
unsigned int nr_congestion_off;
|
||||
unsigned int nr_batching;
|
||||
|
||||
unsigned int max_sectors;
|
||||
unsigned int max_hw_sectors;
|
||||
unsigned short max_phys_segments;
|
||||
unsigned short max_hw_segments;
|
||||
unsigned short hardsect_size;
|
||||
unsigned int max_segment_size;
|
||||
|
||||
unsigned long seg_boundary_mask;
|
||||
unsigned int dma_alignment;
|
||||
|
||||
struct blk_queue_tag *queue_tags;
|
||||
|
||||
unsigned int nr_sorted;
|
||||
unsigned int in_flight;
|
||||
|
||||
unsigned int sg_timeout;
|
||||
unsigned int sg_reserved_size;
|
||||
int node;
|
||||
|
||||
struct blk_trace *blk_trace;
|
||||
|
||||
unsigned int ordered, next_ordered, ordseq;
|
||||
int orderr, ordcolor;
|
||||
struct request pre_flush_rq, bar_rq, post_flush_rq;
|
||||
struct request *orig_bar_rq;
|
||||
unsigned int bi_size;
|
||||
|
||||
struct mutex sysfs_lock;
|
||||
};
|
||||
|
||||
#define RQ_INACTIVE (-1)
|
||||
#define RQ_ACTIVE 1
|
||||
|
||||
#define QUEUE_FLAG_CLUSTER 0
|
||||
#define QUEUE_FLAG_QUEUED 1
|
||||
#define QUEUE_FLAG_STOPPED 2
|
||||
#define QUEUE_FLAG_READFULL 3
|
||||
#define QUEUE_FLAG_WRITEFULL 4
|
||||
#define QUEUE_FLAG_DEAD 5
|
||||
#define QUEUE_FLAG_REENTER 6
|
||||
#define QUEUE_FLAG_PLUGGED 7
|
||||
#define QUEUE_FLAG_ELVSWITCH 8
|
||||
|
||||
enum {
|
||||
|
||||
QUEUE_ORDERED_NONE = 0x00,
|
||||
QUEUE_ORDERED_DRAIN = 0x01,
|
||||
QUEUE_ORDERED_TAG = 0x02,
|
||||
|
||||
QUEUE_ORDERED_PREFLUSH = 0x10,
|
||||
QUEUE_ORDERED_POSTFLUSH = 0x20,
|
||||
QUEUE_ORDERED_FUA = 0x40,
|
||||
|
||||
QUEUE_ORDERED_DRAIN_FLUSH = QUEUE_ORDERED_DRAIN |
|
||||
QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_POSTFLUSH,
|
||||
QUEUE_ORDERED_DRAIN_FUA = QUEUE_ORDERED_DRAIN |
|
||||
QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_FUA,
|
||||
QUEUE_ORDERED_TAG_FLUSH = QUEUE_ORDERED_TAG |
|
||||
QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_POSTFLUSH,
|
||||
QUEUE_ORDERED_TAG_FUA = QUEUE_ORDERED_TAG |
|
||||
QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_FUA,
|
||||
|
||||
QUEUE_ORDSEQ_STARTED = 0x01,
|
||||
QUEUE_ORDSEQ_DRAIN = 0x02,
|
||||
QUEUE_ORDSEQ_PREFLUSH = 0x04,
|
||||
QUEUE_ORDSEQ_BAR = 0x08,
|
||||
QUEUE_ORDSEQ_POSTFLUSH = 0x10,
|
||||
QUEUE_ORDSEQ_DONE = 0x20,
|
||||
};
|
||||
|
||||
#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags)
|
||||
#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags)
|
||||
#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
|
||||
#define blk_queue_flushing(q) ((q)->ordseq)
|
||||
|
||||
#define blk_fs_request(rq) ((rq)->flags & REQ_CMD)
|
||||
#define blk_pc_request(rq) ((rq)->flags & REQ_BLOCK_PC)
|
||||
#define blk_noretry_request(rq) ((rq)->flags & REQ_FAILFAST)
|
||||
#define blk_rq_started(rq) ((rq)->flags & REQ_STARTED)
|
||||
|
||||
#define blk_account_rq(rq) (blk_rq_started(rq) && blk_fs_request(rq))
|
||||
|
||||
#define blk_pm_suspend_request(rq) ((rq)->flags & REQ_PM_SUSPEND)
|
||||
#define blk_pm_resume_request(rq) ((rq)->flags & REQ_PM_RESUME)
|
||||
#define blk_pm_request(rq) ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME))
|
||||
|
||||
#define blk_sorted_rq(rq) ((rq)->flags & REQ_SORTED)
|
||||
#define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER)
|
||||
#define blk_fua_rq(rq) ((rq)->flags & REQ_FUA)
|
||||
|
||||
#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist)
|
||||
|
||||
#define rq_data_dir(rq) ((rq)->flags & 1)
|
||||
|
||||
#define RQ_NOMERGE_FLAGS (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER)
|
||||
#define rq_mergeable(rq) (!((rq)->flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq)))
|
||||
#define blk_queue_headactive(q, head_active)
|
||||
#define BLKPREP_OK 0
|
||||
#define BLKPREP_KILL 1
|
||||
#define BLKPREP_DEFER 2
|
||||
|
||||
#define BLK_BOUNCE_HIGH ((u64)blk_max_low_pfn << PAGE_SHIFT)
|
||||
#define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT)
|
||||
#define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD)
|
||||
|
||||
#define rq_for_each_bio(_bio, rq) if ((rq->bio)) for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next)
|
||||
|
||||
#define end_io_error(uptodate) (unlikely((uptodate) <= 0))
|
||||
|
||||
#define blk_queue_tag_depth(q) ((q)->queue_tags->busy)
|
||||
#define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth)
|
||||
#define blk_rq_tagged(rq) ((rq)->flags & REQ_QUEUED)
|
||||
|
||||
#define MAX_PHYS_SEGMENTS 128
|
||||
#define MAX_HW_SEGMENTS 128
|
||||
#define SAFE_MAX_SECTORS 255
|
||||
#define BLK_DEF_MAX_SECTORS 1024
|
||||
|
||||
#define MAX_SEGMENT_SIZE 65536
|
||||
|
||||
#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist)
|
||||
|
||||
#define blk_finished_io(nsects) do { } while (0)
|
||||
#define blk_started_io(nsects) do { } while (0)
|
||||
|
||||
#define sector_div(n, b)( { int _res; _res = (n) % (b); (n) /= (b); _res; } )
|
||||
|
||||
#define MODULE_ALIAS_BLOCKDEV(major,minor) MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
|
||||
#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) MODULE_ALIAS("block-major-" __stringify(major) "-*")
|
||||
|
||||
#endif
|
41
libc/kernel/common/linux/blkpg.h
Normal file
41
libc/kernel/common/linux/blkpg.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_BLKPG_H
|
||||
#define _LINUX_BLKPG_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define BLKPG _IO(0x12,105)
|
||||
|
||||
struct blkpg_ioctl_arg {
|
||||
int op;
|
||||
int flags;
|
||||
int datalen;
|
||||
void __user *data;
|
||||
};
|
||||
|
||||
#define BLKPG_ADD_PARTITION 1
|
||||
#define BLKPG_DEL_PARTITION 2
|
||||
|
||||
#define BLKPG_DEVNAMELTH 64
|
||||
#define BLKPG_VOLNAMELTH 64
|
||||
|
||||
struct blkpg_partition {
|
||||
long long start;
|
||||
long long length;
|
||||
int pno;
|
||||
char devname[BLKPG_DEVNAMELTH];
|
||||
char volname[BLKPG_VOLNAMELTH];
|
||||
};
|
||||
|
||||
#endif
|
29
libc/kernel/common/linux/blockgroup_lock.h
Normal file
29
libc/kernel/common/linux/blockgroup_lock.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_BLOCKGROUP_LOCK_H
|
||||
#define _LINUX_BLOCKGROUP_LOCK_H
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/cache.h>
|
||||
|
||||
#define NR_BG_LOCKS 1
|
||||
|
||||
struct bgl_lock {
|
||||
spinlock_t lock;
|
||||
} ____cacheline_aligned_in_smp;
|
||||
|
||||
struct blockgroup_lock {
|
||||
struct bgl_lock locks[NR_BG_LOCKS];
|
||||
};
|
||||
|
||||
#define sb_bgl_lock(sb, block_group) (&(sb)->s_blockgroup_lock.locks[(block_group) & (NR_BG_LOCKS-1)].lock)
|
||||
#endif
|
67
libc/kernel/common/linux/byteorder/big_endian.h
Normal file
67
libc/kernel/common/linux/byteorder/big_endian.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H
|
||||
#define _LINUX_BYTEORDER_BIG_ENDIAN_H
|
||||
|
||||
#ifndef __BIG_ENDIAN
|
||||
#define __BIG_ENDIAN 4321
|
||||
#endif
|
||||
#ifndef __BIG_ENDIAN_BITFIELD
|
||||
#define __BIG_ENDIAN_BITFIELD
|
||||
#endif
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/byteorder/swab.h>
|
||||
|
||||
#define __constant_htonl(x) ((__force __be32)(__u32)(x))
|
||||
#define __constant_ntohl(x) ((__force __u32)(__be32)(x))
|
||||
#define __constant_htons(x) ((__force __be16)(__u16)(x))
|
||||
#define __constant_ntohs(x) ((__force __u16)(__be16)(x))
|
||||
#define __constant_cpu_to_le64(x) ((__force __le64)___constant_swab64((x)))
|
||||
#define __constant_le64_to_cpu(x) ___constant_swab64((__force __u64)(__le64)(x))
|
||||
#define __constant_cpu_to_le32(x) ((__force __le32)___constant_swab32((x)))
|
||||
#define __constant_le32_to_cpu(x) ___constant_swab32((__force __u32)(__le32)(x))
|
||||
#define __constant_cpu_to_le16(x) ((__force __le16)___constant_swab16((x)))
|
||||
#define __constant_le16_to_cpu(x) ___constant_swab16((__force __u16)(__le16)(x))
|
||||
#define __constant_cpu_to_be64(x) ((__force __be64)(__u64)(x))
|
||||
#define __constant_be64_to_cpu(x) ((__force __u64)(__be64)(x))
|
||||
#define __constant_cpu_to_be32(x) ((__force __be32)(__u32)(x))
|
||||
#define __constant_be32_to_cpu(x) ((__force __u32)(__be32)(x))
|
||||
#define __constant_cpu_to_be16(x) ((__force __be16)(__u16)(x))
|
||||
#define __constant_be16_to_cpu(x) ((__force __u16)(__be16)(x))
|
||||
#define __cpu_to_le64(x) ((__force __le64)__swab64((x)))
|
||||
#define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x))
|
||||
#define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
|
||||
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
|
||||
#define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
|
||||
#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
|
||||
#define __cpu_to_be64(x) ((__force __be64)(__u64)(x))
|
||||
#define __be64_to_cpu(x) ((__force __u64)(__be64)(x))
|
||||
#define __cpu_to_be32(x) ((__force __be32)(__u32)(x))
|
||||
#define __be32_to_cpu(x) ((__force __u32)(__be32)(x))
|
||||
#define __cpu_to_be16(x) ((__force __be16)(__u16)(x))
|
||||
#define __be16_to_cpu(x) ((__force __u16)(__be16)(x))
|
||||
|
||||
#define __cpu_to_le64s(x) __swab64s((x))
|
||||
#define __le64_to_cpus(x) __swab64s((x))
|
||||
#define __cpu_to_le32s(x) __swab32s((x))
|
||||
#define __le32_to_cpus(x) __swab32s((x))
|
||||
#define __cpu_to_le16s(x) __swab16s((x))
|
||||
#define __le16_to_cpus(x) __swab16s((x))
|
||||
#define __cpu_to_be64s(x) do {} while (0)
|
||||
#define __be64_to_cpus(x) do {} while (0)
|
||||
#define __cpu_to_be32s(x) do {} while (0)
|
||||
#define __be32_to_cpus(x) do {} while (0)
|
||||
#define __cpu_to_be16s(x) do {} while (0)
|
||||
#define __be16_to_cpus(x) do {} while (0)
|
||||
#include <linux/byteorder/generic.h>
|
||||
#endif
|
15
libc/kernel/common/linux/byteorder/generic.h
Normal file
15
libc/kernel/common/linux/byteorder/generic.h
Normal file
@@ -0,0 +1,15 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_BYTEORDER_GENERIC_H
|
||||
#define _LINUX_BYTEORDER_GENERIC_H
|
||||
|
||||
#endif
|
67
libc/kernel/common/linux/byteorder/little_endian.h
Normal file
67
libc/kernel/common/linux/byteorder/little_endian.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_BYTEORDER_LITTLE_ENDIAN_H
|
||||
#define _LINUX_BYTEORDER_LITTLE_ENDIAN_H
|
||||
|
||||
#ifndef __LITTLE_ENDIAN
|
||||
#define __LITTLE_ENDIAN 1234
|
||||
#endif
|
||||
#ifndef __LITTLE_ENDIAN_BITFIELD
|
||||
#define __LITTLE_ENDIAN_BITFIELD
|
||||
#endif
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/byteorder/swab.h>
|
||||
|
||||
#define __constant_htonl(x) ((__force __be32)___constant_swab32((x)))
|
||||
#define __constant_ntohl(x) ___constant_swab32((__force __be32)(x))
|
||||
#define __constant_htons(x) ((__force __be16)___constant_swab16((x)))
|
||||
#define __constant_ntohs(x) ___constant_swab16((__force __be16)(x))
|
||||
#define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x))
|
||||
#define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x))
|
||||
#define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x))
|
||||
#define __constant_le32_to_cpu(x) ((__force __u32)(__le32)(x))
|
||||
#define __constant_cpu_to_le16(x) ((__force __le16)(__u16)(x))
|
||||
#define __constant_le16_to_cpu(x) ((__force __u16)(__le16)(x))
|
||||
#define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x)))
|
||||
#define __constant_be64_to_cpu(x) ___constant_swab64((__force __u64)(__be64)(x))
|
||||
#define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x)))
|
||||
#define __constant_be32_to_cpu(x) ___constant_swab32((__force __u32)(__be32)(x))
|
||||
#define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x)))
|
||||
#define __constant_be16_to_cpu(x) ___constant_swab16((__force __u16)(__be16)(x))
|
||||
#define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
|
||||
#define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
|
||||
#define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
|
||||
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
|
||||
#define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
|
||||
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
|
||||
#define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
|
||||
#define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
|
||||
#define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
|
||||
#define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x))
|
||||
#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
|
||||
#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
|
||||
|
||||
#define __cpu_to_le64s(x) do {} while (0)
|
||||
#define __le64_to_cpus(x) do {} while (0)
|
||||
#define __cpu_to_le32s(x) do {} while (0)
|
||||
#define __le32_to_cpus(x) do {} while (0)
|
||||
#define __cpu_to_le16s(x) do {} while (0)
|
||||
#define __le16_to_cpus(x) do {} while (0)
|
||||
#define __cpu_to_be64s(x) __swab64s((x))
|
||||
#define __be64_to_cpus(x) __swab64s((x))
|
||||
#define __cpu_to_be32s(x) __swab32s((x))
|
||||
#define __be32_to_cpus(x) __swab32s((x))
|
||||
#define __cpu_to_be16s(x) __swab16s((x))
|
||||
#define __be16_to_cpus(x) __swab16s((x))
|
||||
#include <linux/byteorder/generic.h>
|
||||
#endif
|
72
libc/kernel/common/linux/byteorder/swab.h
Normal file
72
libc/kernel/common/linux/byteorder/swab.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_BYTEORDER_SWAB_H
|
||||
#define _LINUX_BYTEORDER_SWAB_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#define ___swab16(x) ({ __u16 __x = (x); ((__u16)( (((__u16)(__x) & (__u16)0x00ffU) << 8) | (((__u16)(__x) & (__u16)0xff00U) >> 8) )); })
|
||||
|
||||
#define ___swab32(x) ({ __u32 __x = (x); ((__u32)( (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); })
|
||||
|
||||
#define ___swab64(x) ({ __u64 __x = (x); ((__u64)( (__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | (__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | (__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | (__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) | (__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) | (__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | (__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | (__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); })
|
||||
|
||||
#define ___constant_swab16(x) ((__u16)( (((__u16)(x) & (__u16)0x00ffU) << 8) | (((__u16)(x) & (__u16)0xff00U) >> 8) ))
|
||||
#define ___constant_swab32(x) ((__u32)( (((__u32)(x) & (__u32)0x000000ffUL) << 24) | (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
|
||||
#define ___constant_swab64(x) ((__u64)( (__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | (__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | (__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | (__u64)(((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | (__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | (__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | (__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | (__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) ))
|
||||
|
||||
#ifndef __arch__swab16
|
||||
#define __arch__swab16(x) ({ __u16 __tmp = (x) ; ___swab16(__tmp); })
|
||||
#endif
|
||||
#ifndef __arch__swab32
|
||||
#define __arch__swab32(x) ({ __u32 __tmp = (x) ; ___swab32(__tmp); })
|
||||
#endif
|
||||
#ifndef __arch__swab64
|
||||
#define __arch__swab64(x) ({ __u64 __tmp = (x) ; ___swab64(__tmp); })
|
||||
#endif
|
||||
|
||||
#ifndef __arch__swab16p
|
||||
#define __arch__swab16p(x) __arch__swab16(*(x))
|
||||
#endif
|
||||
#ifndef __arch__swab32p
|
||||
#define __arch__swab32p(x) __arch__swab32(*(x))
|
||||
#endif
|
||||
#ifndef __arch__swab64p
|
||||
#define __arch__swab64p(x) __arch__swab64(*(x))
|
||||
#endif
|
||||
|
||||
#ifndef __arch__swab16s
|
||||
#define __arch__swab16s(x) do { *(x) = __arch__swab16p((x)); } while (0)
|
||||
#endif
|
||||
#ifndef __arch__swab32s
|
||||
#define __arch__swab32s(x) do { *(x) = __arch__swab32p((x)); } while (0)
|
||||
#endif
|
||||
#ifndef __arch__swab64s
|
||||
#define __arch__swab64s(x) do { *(x) = __arch__swab64p((x)); } while (0)
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__OPTIMIZE__)
|
||||
#define __swab16(x) (__builtin_constant_p((__u16)(x)) ? ___swab16((x)) : __fswab16((x)))
|
||||
#define __swab32(x) (__builtin_constant_p((__u32)(x)) ? ___swab32((x)) : __fswab32((x)))
|
||||
#define __swab64(x) (__builtin_constant_p((__u64)(x)) ? ___swab64((x)) : __fswab64((x)))
|
||||
#else
|
||||
#define __swab16(x) __fswab16(x)
|
||||
#define __swab32(x) __fswab32(x)
|
||||
#define __swab64(x) __fswab64(x)
|
||||
#endif
|
||||
|
||||
#ifdef __BYTEORDER_HAS_U64__
|
||||
#ifdef __SWAB_64_THRU_32__
|
||||
#else
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
52
libc/kernel/common/linux/byteorder/swabb.h
Normal file
52
libc/kernel/common/linux/byteorder/swabb.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_BYTEORDER_SWABB_H
|
||||
#define _LINUX_BYTEORDER_SWABB_H
|
||||
|
||||
#define ___swahw32(x) ({ __u32 __x = (x); ((__u32)( (((__u32)(__x) & (__u32)0x0000ffffUL) << 16) | (((__u32)(__x) & (__u32)0xffff0000UL) >> 16) )); })
|
||||
#define ___swahb32(x) ({ __u32 __x = (x); ((__u32)( (((__u32)(__x) & (__u32)0x00ff00ffUL) << 8) | (((__u32)(__x) & (__u32)0xff00ff00UL) >> 8) )); })
|
||||
|
||||
#define ___constant_swahw32(x) ((__u32)( (((__u32)(x) & (__u32)0x0000ffffUL) << 16) | (((__u32)(x) & (__u32)0xffff0000UL) >> 16) ))
|
||||
#define ___constant_swahb32(x) ((__u32)( (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | (((__u32)(x) & (__u32)0xff00ff00UL) >> 8) ))
|
||||
|
||||
#ifndef __arch__swahw32
|
||||
#define __arch__swahw32(x) ___swahw32(x)
|
||||
#endif
|
||||
#ifndef __arch__swahb32
|
||||
#define __arch__swahb32(x) ___swahb32(x)
|
||||
#endif
|
||||
|
||||
#ifndef __arch__swahw32p
|
||||
#define __arch__swahw32p(x) __swahw32(*(x))
|
||||
#endif
|
||||
#ifndef __arch__swahb32p
|
||||
#define __arch__swahb32p(x) __swahb32(*(x))
|
||||
#endif
|
||||
|
||||
#ifndef __arch__swahw32s
|
||||
#define __arch__swahw32s(x) do { *(x) = __swahw32p((x)); } while (0)
|
||||
#endif
|
||||
#ifndef __arch__swahb32s
|
||||
#define __arch__swahb32s(x) do { *(x) = __swahb32p((x)); } while (0)
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__OPTIMIZE__)
|
||||
#define __swahw32(x) (__builtin_constant_p((__u32)(x)) ? ___swahw32((x)) : __fswahw32((x)))
|
||||
#define __swahb32(x) (__builtin_constant_p((__u32)(x)) ? ___swahb32((x)) : __fswahb32((x)))
|
||||
#else
|
||||
#define __swahw32(x) __fswahw32(x)
|
||||
#define __swahb32(x) __fswahb32(x)
|
||||
#endif
|
||||
|
||||
#ifdef __BYTEORDER_HAS_U64__
|
||||
#endif
|
||||
#endif
|
54
libc/kernel/common/linux/cache.h
Normal file
54
libc/kernel/common/linux/cache.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __LINUX_CACHE_H
|
||||
#define __LINUX_CACHE_H
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <asm/cache.h>
|
||||
|
||||
#ifndef L1_CACHE_ALIGN
|
||||
#define L1_CACHE_ALIGN(x) ALIGN(x, L1_CACHE_BYTES)
|
||||
#endif
|
||||
|
||||
#ifndef SMP_CACHE_BYTES
|
||||
#define SMP_CACHE_BYTES L1_CACHE_BYTES
|
||||
#endif
|
||||
|
||||
#ifndef __read_mostly
|
||||
#define __read_mostly
|
||||
#endif
|
||||
|
||||
#ifndef ____cacheline_aligned
|
||||
#define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
|
||||
#endif
|
||||
|
||||
#ifndef ____cacheline_aligned_in_smp
|
||||
#define ____cacheline_aligned_in_smp
|
||||
#endif
|
||||
|
||||
#ifndef __cacheline_aligned
|
||||
#define __cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES), __section__(".data.cacheline_aligned")))
|
||||
#endif
|
||||
|
||||
#ifndef __cacheline_aligned_in_smp
|
||||
#define __cacheline_aligned_in_smp
|
||||
#endif
|
||||
|
||||
#ifndef INTERNODE_CACHE_SHIFT
|
||||
#define INTERNODE_CACHE_SHIFT L1_CACHE_SHIFT
|
||||
#endif
|
||||
|
||||
#ifndef ____cacheline_internodealigned_in_smp
|
||||
#define ____cacheline_internodealigned_in_smp
|
||||
#endif
|
||||
|
||||
#endif
|
22
libc/kernel/common/linux/calc64.h
Normal file
22
libc/kernel/common/linux/calc64.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_CALC64_H
|
||||
#define _LINUX_CALC64_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/div64.h>
|
||||
|
||||
#ifndef div_long_long_rem
|
||||
#define div_long_long_rem(dividend, divisor, remainder) do_div_llr((dividend), divisor, remainder)
|
||||
|
||||
#endif
|
||||
#endif
|
95
libc/kernel/common/linux/capability.h
Normal file
95
libc/kernel/common/linux/capability.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_CAPABILITY_H
|
||||
#define _LINUX_CAPABILITY_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#define _LINUX_CAPABILITY_VERSION 0x19980330
|
||||
|
||||
typedef struct __user_cap_header_struct {
|
||||
__u32 version;
|
||||
int pid;
|
||||
} __user *cap_user_header_t;
|
||||
|
||||
typedef struct __user_cap_data_struct {
|
||||
__u32 effective;
|
||||
__u32 permitted;
|
||||
__u32 inheritable;
|
||||
} __user *cap_user_data_t;
|
||||
|
||||
#define CAP_CHOWN 0
|
||||
|
||||
#define CAP_DAC_OVERRIDE 1
|
||||
|
||||
#define CAP_DAC_READ_SEARCH 2
|
||||
|
||||
#define CAP_FOWNER 3
|
||||
|
||||
#define CAP_FSETID 4
|
||||
|
||||
#define CAP_FS_MASK 0x1f
|
||||
|
||||
#define CAP_KILL 5
|
||||
|
||||
#define CAP_SETGID 6
|
||||
|
||||
#define CAP_SETUID 7
|
||||
|
||||
#define CAP_SETPCAP 8
|
||||
|
||||
#define CAP_LINUX_IMMUTABLE 9
|
||||
|
||||
#define CAP_NET_BIND_SERVICE 10
|
||||
|
||||
#define CAP_NET_BROADCAST 11
|
||||
|
||||
#define CAP_NET_ADMIN 12
|
||||
|
||||
#define CAP_NET_RAW 13
|
||||
|
||||
#define CAP_IPC_LOCK 14
|
||||
|
||||
#define CAP_IPC_OWNER 15
|
||||
|
||||
#define CAP_SYS_MODULE 16
|
||||
|
||||
#define CAP_SYS_RAWIO 17
|
||||
|
||||
#define CAP_SYS_CHROOT 18
|
||||
|
||||
#define CAP_SYS_PTRACE 19
|
||||
|
||||
#define CAP_SYS_PACCT 20
|
||||
|
||||
#define CAP_SYS_ADMIN 21
|
||||
|
||||
#define CAP_SYS_BOOT 22
|
||||
|
||||
#define CAP_SYS_NICE 23
|
||||
|
||||
#define CAP_SYS_RESOURCE 24
|
||||
|
||||
#define CAP_SYS_TIME 25
|
||||
|
||||
#define CAP_SYS_TTY_CONFIG 26
|
||||
|
||||
#define CAP_MKNOD 27
|
||||
|
||||
#define CAP_LEASE 28
|
||||
|
||||
#define CAP_AUDIT_WRITE 29
|
||||
|
||||
#define CAP_AUDIT_CONTROL 30
|
||||
|
||||
#endif
|
88
libc/kernel/common/linux/capi.h
Normal file
88
libc/kernel/common/linux/capi.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __LINUX_CAPI_H__
|
||||
#define __LINUX_CAPI_H__
|
||||
|
||||
#include <asm/types.h>
|
||||
#include <linux/ioctl.h>
|
||||
#include <linux/kernelcapi.h>
|
||||
|
||||
typedef struct capi_register_params {
|
||||
__u32 level3cnt;
|
||||
__u32 datablkcnt;
|
||||
__u32 datablklen;
|
||||
} capi_register_params;
|
||||
|
||||
#define CAPI_REGISTER _IOW('C',0x01,struct capi_register_params)
|
||||
|
||||
#define CAPI_MANUFACTURER_LEN 64
|
||||
|
||||
#define CAPI_GET_MANUFACTURER _IOWR('C',0x06,int)
|
||||
|
||||
typedef struct capi_version {
|
||||
__u32 majorversion;
|
||||
__u32 minorversion;
|
||||
__u32 majormanuversion;
|
||||
__u32 minormanuversion;
|
||||
} capi_version;
|
||||
|
||||
#define CAPI_GET_VERSION _IOWR('C',0x07,struct capi_version)
|
||||
|
||||
#define CAPI_SERIAL_LEN 8
|
||||
#define CAPI_GET_SERIAL _IOWR('C',0x08,int)
|
||||
|
||||
typedef struct capi_profile {
|
||||
__u16 ncontroller;
|
||||
__u16 nbchannel;
|
||||
__u32 goptions;
|
||||
__u32 support1;
|
||||
__u32 support2;
|
||||
__u32 support3;
|
||||
__u32 reserved[6];
|
||||
__u32 manu[5];
|
||||
} capi_profile;
|
||||
|
||||
#define CAPI_GET_PROFILE _IOWR('C',0x09,struct capi_profile)
|
||||
|
||||
typedef struct capi_manufacturer_cmd {
|
||||
unsigned long cmd;
|
||||
void __user *data;
|
||||
} capi_manufacturer_cmd;
|
||||
|
||||
#define CAPI_MANUFACTURER_CMD _IOWR('C',0x20, struct capi_manufacturer_cmd)
|
||||
|
||||
#define CAPI_GET_ERRCODE _IOR('C',0x21, __u16)
|
||||
|
||||
#define CAPI_INSTALLED _IOR('C',0x22, __u16)
|
||||
|
||||
typedef union capi_ioctl_struct {
|
||||
__u32 contr;
|
||||
capi_register_params rparams;
|
||||
__u8 manufacturer[CAPI_MANUFACTURER_LEN];
|
||||
capi_version version;
|
||||
__u8 serial[CAPI_SERIAL_LEN];
|
||||
capi_profile profile;
|
||||
capi_manufacturer_cmd cmd;
|
||||
__u16 errcode;
|
||||
} capi_ioctl_struct;
|
||||
|
||||
#define CAPIFLAG_HIGHJACKING 0x0001
|
||||
|
||||
#define CAPI_GET_FLAGS _IOR('C',0x23, unsigned)
|
||||
#define CAPI_SET_FLAGS _IOR('C',0x24, unsigned)
|
||||
#define CAPI_CLR_FLAGS _IOR('C',0x25, unsigned)
|
||||
|
||||
#define CAPI_NCCI_OPENCOUNT _IOR('C',0x26, unsigned)
|
||||
|
||||
#define CAPI_NCCI_GETUNIT _IOR('C',0x27, unsigned)
|
||||
|
||||
#endif
|
14
libc/kernel/common/linux/cdev.h
Normal file
14
libc/kernel/common/linux/cdev.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_CDEV_H
|
||||
#define _LINUX_CDEV_H
|
||||
#endif
|
718
libc/kernel/common/linux/cdrom.h
Normal file
718
libc/kernel/common/linux/cdrom.h
Normal file
@@ -0,0 +1,718 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_CDROM_H
|
||||
#define _LINUX_CDROM_H
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#define EDRIVE_CANT_DO_THIS EOPNOTSUPP
|
||||
|
||||
#define CDROMPAUSE 0x5301
|
||||
#define CDROMRESUME 0x5302
|
||||
#define CDROMPLAYMSF 0x5303
|
||||
#define CDROMPLAYTRKIND 0x5304
|
||||
#define CDROMREADTOCHDR 0x5305
|
||||
#define CDROMREADTOCENTRY 0x5306
|
||||
#define CDROMSTOP 0x5307
|
||||
#define CDROMSTART 0x5308
|
||||
#define CDROMEJECT 0x5309
|
||||
#define CDROMVOLCTRL 0x530a
|
||||
#define CDROMSUBCHNL 0x530b
|
||||
#define CDROMREADMODE2 0x530c
|
||||
#define CDROMREADMODE1 0x530d
|
||||
#define CDROMREADAUDIO 0x530e
|
||||
#define CDROMEJECT_SW 0x530f
|
||||
#define CDROMMULTISESSION 0x5310
|
||||
#define CDROM_GET_MCN 0x5311
|
||||
#define CDROM_GET_UPC CDROM_GET_MCN
|
||||
#define CDROMRESET 0x5312
|
||||
#define CDROMVOLREAD 0x5313
|
||||
#define CDROMREADRAW 0x5314
|
||||
|
||||
#define CDROMREADCOOKED 0x5315
|
||||
#define CDROMSEEK 0x5316
|
||||
|
||||
#define CDROMPLAYBLK 0x5317
|
||||
|
||||
#define CDROMREADALL 0x5318
|
||||
|
||||
#define CDROMGETSPINDOWN 0x531d
|
||||
#define CDROMSETSPINDOWN 0x531e
|
||||
|
||||
#define CDROMCLOSETRAY 0x5319
|
||||
#define CDROM_SET_OPTIONS 0x5320
|
||||
#define CDROM_CLEAR_OPTIONS 0x5321
|
||||
#define CDROM_SELECT_SPEED 0x5322
|
||||
#define CDROM_SELECT_DISC 0x5323
|
||||
#define CDROM_MEDIA_CHANGED 0x5325
|
||||
#define CDROM_DRIVE_STATUS 0x5326
|
||||
#define CDROM_DISC_STATUS 0x5327
|
||||
#define CDROM_CHANGER_NSLOTS 0x5328
|
||||
#define CDROM_LOCKDOOR 0x5329
|
||||
#define CDROM_DEBUG 0x5330
|
||||
#define CDROM_GET_CAPABILITY 0x5331
|
||||
|
||||
#define CDROMAUDIOBUFSIZ 0x5382
|
||||
|
||||
#define DVD_READ_STRUCT 0x5390
|
||||
#define DVD_WRITE_STRUCT 0x5391
|
||||
#define DVD_AUTH 0x5392
|
||||
|
||||
#define CDROM_SEND_PACKET 0x5393
|
||||
#define CDROM_NEXT_WRITABLE 0x5394
|
||||
#define CDROM_LAST_WRITTEN 0x5395
|
||||
|
||||
struct cdrom_msf0
|
||||
{
|
||||
__u8 minute;
|
||||
__u8 second;
|
||||
__u8 frame;
|
||||
};
|
||||
|
||||
union cdrom_addr
|
||||
{
|
||||
struct cdrom_msf0 msf;
|
||||
int lba;
|
||||
};
|
||||
|
||||
struct cdrom_msf
|
||||
{
|
||||
__u8 cdmsf_min0;
|
||||
__u8 cdmsf_sec0;
|
||||
__u8 cdmsf_frame0;
|
||||
__u8 cdmsf_min1;
|
||||
__u8 cdmsf_sec1;
|
||||
__u8 cdmsf_frame1;
|
||||
};
|
||||
|
||||
struct cdrom_ti
|
||||
{
|
||||
__u8 cdti_trk0;
|
||||
__u8 cdti_ind0;
|
||||
__u8 cdti_trk1;
|
||||
__u8 cdti_ind1;
|
||||
};
|
||||
|
||||
struct cdrom_tochdr
|
||||
{
|
||||
__u8 cdth_trk0;
|
||||
__u8 cdth_trk1;
|
||||
};
|
||||
|
||||
struct cdrom_volctrl
|
||||
{
|
||||
__u8 channel0;
|
||||
__u8 channel1;
|
||||
__u8 channel2;
|
||||
__u8 channel3;
|
||||
};
|
||||
|
||||
struct cdrom_subchnl
|
||||
{
|
||||
__u8 cdsc_format;
|
||||
__u8 cdsc_audiostatus;
|
||||
__u8 cdsc_adr: 4;
|
||||
__u8 cdsc_ctrl: 4;
|
||||
__u8 cdsc_trk;
|
||||
__u8 cdsc_ind;
|
||||
union cdrom_addr cdsc_absaddr;
|
||||
union cdrom_addr cdsc_reladdr;
|
||||
};
|
||||
|
||||
struct cdrom_tocentry
|
||||
{
|
||||
__u8 cdte_track;
|
||||
__u8 cdte_adr :4;
|
||||
__u8 cdte_ctrl :4;
|
||||
__u8 cdte_format;
|
||||
union cdrom_addr cdte_addr;
|
||||
__u8 cdte_datamode;
|
||||
};
|
||||
|
||||
struct cdrom_read
|
||||
{
|
||||
int cdread_lba;
|
||||
char *cdread_bufaddr;
|
||||
int cdread_buflen;
|
||||
};
|
||||
|
||||
struct cdrom_read_audio
|
||||
{
|
||||
union cdrom_addr addr;
|
||||
__u8 addr_format;
|
||||
int nframes;
|
||||
__u8 __user *buf;
|
||||
};
|
||||
|
||||
struct cdrom_multisession
|
||||
{
|
||||
union cdrom_addr addr;
|
||||
__u8 xa_flag;
|
||||
__u8 addr_format;
|
||||
};
|
||||
|
||||
struct cdrom_mcn
|
||||
{
|
||||
__u8 medium_catalog_number[14];
|
||||
};
|
||||
|
||||
struct cdrom_blk
|
||||
{
|
||||
unsigned from;
|
||||
unsigned short len;
|
||||
};
|
||||
|
||||
#define CDROM_PACKET_SIZE 12
|
||||
|
||||
#define CGC_DATA_UNKNOWN 0
|
||||
#define CGC_DATA_WRITE 1
|
||||
#define CGC_DATA_READ 2
|
||||
#define CGC_DATA_NONE 3
|
||||
|
||||
struct cdrom_generic_command
|
||||
{
|
||||
unsigned char cmd[CDROM_PACKET_SIZE];
|
||||
unsigned char __user *buffer;
|
||||
unsigned int buflen;
|
||||
int stat;
|
||||
struct request_sense __user *sense;
|
||||
unsigned char data_direction;
|
||||
int quiet;
|
||||
int timeout;
|
||||
void __user *reserved[1];
|
||||
};
|
||||
|
||||
#define CD_MINS 74
|
||||
#define CD_SECS 60
|
||||
#define CD_FRAMES 75
|
||||
#define CD_SYNC_SIZE 12
|
||||
#define CD_MSF_OFFSET 150
|
||||
#define CD_CHUNK_SIZE 24
|
||||
#define CD_NUM_OF_CHUNKS 98
|
||||
#define CD_FRAMESIZE_SUB 96
|
||||
#define CD_HEAD_SIZE 4
|
||||
#define CD_SUBHEAD_SIZE 8
|
||||
#define CD_EDC_SIZE 4
|
||||
#define CD_ZERO_SIZE 8
|
||||
#define CD_ECC_SIZE 276
|
||||
#define CD_FRAMESIZE 2048
|
||||
#define CD_FRAMESIZE_RAW 2352
|
||||
#define CD_FRAMESIZE_RAWER 2646
|
||||
|
||||
#define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE)
|
||||
#define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE)
|
||||
|
||||
#define CD_XA_HEAD (CD_HEAD_SIZE+CD_SUBHEAD_SIZE)
|
||||
#define CD_XA_TAIL (CD_EDC_SIZE+CD_ECC_SIZE)
|
||||
#define CD_XA_SYNC_HEAD (CD_SYNC_SIZE+CD_XA_HEAD)
|
||||
|
||||
#define CDROM_LBA 0x01
|
||||
#define CDROM_MSF 0x02
|
||||
|
||||
#define CDROM_DATA_TRACK 0x04
|
||||
|
||||
#define CDROM_LEADOUT 0xAA
|
||||
|
||||
#define CDROM_AUDIO_INVALID 0x00
|
||||
#define CDROM_AUDIO_PLAY 0x11
|
||||
#define CDROM_AUDIO_PAUSED 0x12
|
||||
#define CDROM_AUDIO_COMPLETED 0x13
|
||||
#define CDROM_AUDIO_ERROR 0x14
|
||||
#define CDROM_AUDIO_NO_STATUS 0x15
|
||||
|
||||
#define CDC_CLOSE_TRAY 0x1
|
||||
#define CDC_OPEN_TRAY 0x2
|
||||
#define CDC_LOCK 0x4
|
||||
#define CDC_SELECT_SPEED 0x8
|
||||
#define CDC_SELECT_DISC 0x10
|
||||
#define CDC_MULTI_SESSION 0x20
|
||||
#define CDC_MCN 0x40
|
||||
#define CDC_MEDIA_CHANGED 0x80
|
||||
#define CDC_PLAY_AUDIO 0x100
|
||||
#define CDC_RESET 0x200
|
||||
#define CDC_DRIVE_STATUS 0x800
|
||||
#define CDC_GENERIC_PACKET 0x1000
|
||||
#define CDC_CD_R 0x2000
|
||||
#define CDC_CD_RW 0x4000
|
||||
#define CDC_DVD 0x8000
|
||||
#define CDC_DVD_R 0x10000
|
||||
#define CDC_DVD_RAM 0x20000
|
||||
#define CDC_MO_DRIVE 0x40000
|
||||
#define CDC_MRW 0x80000
|
||||
#define CDC_MRW_W 0x100000
|
||||
#define CDC_RAM 0x200000
|
||||
|
||||
#define CDS_NO_INFO 0
|
||||
#define CDS_NO_DISC 1
|
||||
#define CDS_TRAY_OPEN 2
|
||||
#define CDS_DRIVE_NOT_READY 3
|
||||
#define CDS_DISC_OK 4
|
||||
|
||||
#define CDS_AUDIO 100
|
||||
#define CDS_DATA_1 101
|
||||
#define CDS_DATA_2 102
|
||||
#define CDS_XA_2_1 103
|
||||
#define CDS_XA_2_2 104
|
||||
#define CDS_MIXED 105
|
||||
|
||||
#define CDO_AUTO_CLOSE 0x1
|
||||
#define CDO_AUTO_EJECT 0x2
|
||||
#define CDO_USE_FFLAGS 0x4
|
||||
#define CDO_LOCK 0x8
|
||||
#define CDO_CHECK_TYPE 0x10
|
||||
|
||||
#define CDSL_NONE ((int) (~0U>>1)-1)
|
||||
#define CDSL_CURRENT ((int) (~0U>>1))
|
||||
|
||||
#define CD_PART_MAX 64
|
||||
#define CD_PART_MASK (CD_PART_MAX - 1)
|
||||
|
||||
#define GPCMD_BLANK 0xa1
|
||||
#define GPCMD_CLOSE_TRACK 0x5b
|
||||
#define GPCMD_FLUSH_CACHE 0x35
|
||||
#define GPCMD_FORMAT_UNIT 0x04
|
||||
#define GPCMD_GET_CONFIGURATION 0x46
|
||||
#define GPCMD_GET_EVENT_STATUS_NOTIFICATION 0x4a
|
||||
#define GPCMD_GET_PERFORMANCE 0xac
|
||||
#define GPCMD_INQUIRY 0x12
|
||||
#define GPCMD_LOAD_UNLOAD 0xa6
|
||||
#define GPCMD_MECHANISM_STATUS 0xbd
|
||||
#define GPCMD_MODE_SELECT_10 0x55
|
||||
#define GPCMD_MODE_SENSE_10 0x5a
|
||||
#define GPCMD_PAUSE_RESUME 0x4b
|
||||
#define GPCMD_PLAY_AUDIO_10 0x45
|
||||
#define GPCMD_PLAY_AUDIO_MSF 0x47
|
||||
#define GPCMD_PLAY_AUDIO_TI 0x48
|
||||
#define GPCMD_PLAY_CD 0xbc
|
||||
#define GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1e
|
||||
#define GPCMD_READ_10 0x28
|
||||
#define GPCMD_READ_12 0xa8
|
||||
#define GPCMD_READ_BUFFER_CAPACITY 0x5c
|
||||
#define GPCMD_READ_CDVD_CAPACITY 0x25
|
||||
#define GPCMD_READ_CD 0xbe
|
||||
#define GPCMD_READ_CD_MSF 0xb9
|
||||
#define GPCMD_READ_DISC_INFO 0x51
|
||||
#define GPCMD_READ_DVD_STRUCTURE 0xad
|
||||
#define GPCMD_READ_FORMAT_CAPACITIES 0x23
|
||||
#define GPCMD_READ_HEADER 0x44
|
||||
#define GPCMD_READ_TRACK_RZONE_INFO 0x52
|
||||
#define GPCMD_READ_SUBCHANNEL 0x42
|
||||
#define GPCMD_READ_TOC_PMA_ATIP 0x43
|
||||
#define GPCMD_REPAIR_RZONE_TRACK 0x58
|
||||
#define GPCMD_REPORT_KEY 0xa4
|
||||
#define GPCMD_REQUEST_SENSE 0x03
|
||||
#define GPCMD_RESERVE_RZONE_TRACK 0x53
|
||||
#define GPCMD_SEND_CUE_SHEET 0x5d
|
||||
#define GPCMD_SCAN 0xba
|
||||
#define GPCMD_SEEK 0x2b
|
||||
#define GPCMD_SEND_DVD_STRUCTURE 0xbf
|
||||
#define GPCMD_SEND_EVENT 0xa2
|
||||
#define GPCMD_SEND_KEY 0xa3
|
||||
#define GPCMD_SEND_OPC 0x54
|
||||
#define GPCMD_SET_READ_AHEAD 0xa7
|
||||
#define GPCMD_SET_STREAMING 0xb6
|
||||
#define GPCMD_START_STOP_UNIT 0x1b
|
||||
#define GPCMD_STOP_PLAY_SCAN 0x4e
|
||||
#define GPCMD_TEST_UNIT_READY 0x00
|
||||
#define GPCMD_VERIFY_10 0x2f
|
||||
#define GPCMD_WRITE_10 0x2a
|
||||
#define GPCMD_WRITE_AND_VERIFY_10 0x2e
|
||||
|
||||
#define GPCMD_SET_SPEED 0xbb
|
||||
|
||||
#define GPCMD_PLAYAUDIO_TI 0x48
|
||||
|
||||
#define GPCMD_GET_MEDIA_STATUS 0xda
|
||||
|
||||
#define GPMODE_VENDOR_PAGE 0x00
|
||||
#define GPMODE_R_W_ERROR_PAGE 0x01
|
||||
#define GPMODE_WRITE_PARMS_PAGE 0x05
|
||||
#define GPMODE_WCACHING_PAGE 0x08
|
||||
#define GPMODE_AUDIO_CTL_PAGE 0x0e
|
||||
#define GPMODE_POWER_PAGE 0x1a
|
||||
#define GPMODE_FAULT_FAIL_PAGE 0x1c
|
||||
#define GPMODE_TO_PROTECT_PAGE 0x1d
|
||||
#define GPMODE_CAPABILITIES_PAGE 0x2a
|
||||
#define GPMODE_ALL_PAGES 0x3f
|
||||
|
||||
#define GPMODE_CDROM_PAGE 0x0d
|
||||
|
||||
#define DVD_STRUCT_PHYSICAL 0x00
|
||||
#define DVD_STRUCT_COPYRIGHT 0x01
|
||||
#define DVD_STRUCT_DISCKEY 0x02
|
||||
#define DVD_STRUCT_BCA 0x03
|
||||
#define DVD_STRUCT_MANUFACT 0x04
|
||||
|
||||
struct dvd_layer {
|
||||
__u8 book_version : 4;
|
||||
__u8 book_type : 4;
|
||||
__u8 min_rate : 4;
|
||||
__u8 disc_size : 4;
|
||||
__u8 layer_type : 4;
|
||||
__u8 track_path : 1;
|
||||
__u8 nlayers : 2;
|
||||
__u8 track_density : 4;
|
||||
__u8 linear_density : 4;
|
||||
__u8 bca : 1;
|
||||
__u32 start_sector;
|
||||
__u32 end_sector;
|
||||
__u32 end_sector_l0;
|
||||
};
|
||||
|
||||
#define DVD_LAYERS 4
|
||||
|
||||
struct dvd_physical {
|
||||
__u8 type;
|
||||
__u8 layer_num;
|
||||
struct dvd_layer layer[DVD_LAYERS];
|
||||
};
|
||||
|
||||
struct dvd_copyright {
|
||||
__u8 type;
|
||||
|
||||
__u8 layer_num;
|
||||
__u8 cpst;
|
||||
__u8 rmi;
|
||||
};
|
||||
|
||||
struct dvd_disckey {
|
||||
__u8 type;
|
||||
|
||||
unsigned agid : 2;
|
||||
__u8 value[2048];
|
||||
};
|
||||
|
||||
struct dvd_bca {
|
||||
__u8 type;
|
||||
|
||||
int len;
|
||||
__u8 value[188];
|
||||
};
|
||||
|
||||
struct dvd_manufact {
|
||||
__u8 type;
|
||||
|
||||
__u8 layer_num;
|
||||
int len;
|
||||
__u8 value[2048];
|
||||
};
|
||||
|
||||
typedef union {
|
||||
__u8 type;
|
||||
|
||||
struct dvd_physical physical;
|
||||
struct dvd_copyright copyright;
|
||||
struct dvd_disckey disckey;
|
||||
struct dvd_bca bca;
|
||||
struct dvd_manufact manufact;
|
||||
} dvd_struct;
|
||||
|
||||
#define DVD_LU_SEND_AGID 0
|
||||
#define DVD_HOST_SEND_CHALLENGE 1
|
||||
#define DVD_LU_SEND_KEY1 2
|
||||
#define DVD_LU_SEND_CHALLENGE 3
|
||||
#define DVD_HOST_SEND_KEY2 4
|
||||
|
||||
#define DVD_AUTH_ESTABLISHED 5
|
||||
#define DVD_AUTH_FAILURE 6
|
||||
|
||||
#define DVD_LU_SEND_TITLE_KEY 7
|
||||
#define DVD_LU_SEND_ASF 8
|
||||
#define DVD_INVALIDATE_AGID 9
|
||||
#define DVD_LU_SEND_RPC_STATE 10
|
||||
#define DVD_HOST_SEND_RPC_STATE 11
|
||||
|
||||
typedef __u8 dvd_key[5];
|
||||
typedef __u8 dvd_challenge[10];
|
||||
|
||||
struct dvd_lu_send_agid {
|
||||
__u8 type;
|
||||
unsigned agid : 2;
|
||||
};
|
||||
|
||||
struct dvd_host_send_challenge {
|
||||
__u8 type;
|
||||
unsigned agid : 2;
|
||||
|
||||
dvd_challenge chal;
|
||||
};
|
||||
|
||||
struct dvd_send_key {
|
||||
__u8 type;
|
||||
unsigned agid : 2;
|
||||
|
||||
dvd_key key;
|
||||
};
|
||||
|
||||
struct dvd_lu_send_challenge {
|
||||
__u8 type;
|
||||
unsigned agid : 2;
|
||||
|
||||
dvd_challenge chal;
|
||||
};
|
||||
|
||||
#define DVD_CPM_NO_COPYRIGHT 0
|
||||
#define DVD_CPM_COPYRIGHTED 1
|
||||
|
||||
#define DVD_CP_SEC_NONE 0
|
||||
#define DVD_CP_SEC_EXIST 1
|
||||
|
||||
#define DVD_CGMS_UNRESTRICTED 0
|
||||
#define DVD_CGMS_SINGLE 2
|
||||
#define DVD_CGMS_RESTRICTED 3
|
||||
|
||||
struct dvd_lu_send_title_key {
|
||||
__u8 type;
|
||||
unsigned agid : 2;
|
||||
|
||||
dvd_key title_key;
|
||||
int lba;
|
||||
unsigned cpm : 1;
|
||||
unsigned cp_sec : 1;
|
||||
unsigned cgms : 2;
|
||||
};
|
||||
|
||||
struct dvd_lu_send_asf {
|
||||
__u8 type;
|
||||
unsigned agid : 2;
|
||||
|
||||
unsigned asf : 1;
|
||||
};
|
||||
|
||||
struct dvd_host_send_rpcstate {
|
||||
__u8 type;
|
||||
__u8 pdrc;
|
||||
};
|
||||
|
||||
struct dvd_lu_send_rpcstate {
|
||||
__u8 type : 2;
|
||||
__u8 vra : 3;
|
||||
__u8 ucca : 3;
|
||||
__u8 region_mask;
|
||||
__u8 rpc_scheme;
|
||||
};
|
||||
|
||||
typedef union {
|
||||
__u8 type;
|
||||
|
||||
struct dvd_lu_send_agid lsa;
|
||||
struct dvd_host_send_challenge hsc;
|
||||
struct dvd_send_key lsk;
|
||||
struct dvd_lu_send_challenge lsc;
|
||||
struct dvd_send_key hsk;
|
||||
struct dvd_lu_send_title_key lstk;
|
||||
struct dvd_lu_send_asf lsasf;
|
||||
struct dvd_host_send_rpcstate hrpcs;
|
||||
struct dvd_lu_send_rpcstate lrpcs;
|
||||
} dvd_authinfo;
|
||||
|
||||
struct request_sense {
|
||||
#ifdef __BIG_ENDIAN_BITFIELD
|
||||
__u8 valid : 1;
|
||||
__u8 error_code : 7;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 error_code : 7;
|
||||
__u8 valid : 1;
|
||||
#endif
|
||||
__u8 segment_number;
|
||||
#ifdef __BIG_ENDIAN_BITFIELD
|
||||
__u8 reserved1 : 2;
|
||||
__u8 ili : 1;
|
||||
__u8 reserved2 : 1;
|
||||
__u8 sense_key : 4;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 sense_key : 4;
|
||||
__u8 reserved2 : 1;
|
||||
__u8 ili : 1;
|
||||
__u8 reserved1 : 2;
|
||||
#endif
|
||||
__u8 information[4];
|
||||
__u8 add_sense_len;
|
||||
__u8 command_info[4];
|
||||
__u8 asc;
|
||||
__u8 ascq;
|
||||
__u8 fruc;
|
||||
__u8 sks[3];
|
||||
__u8 asb[46];
|
||||
};
|
||||
|
||||
#define CDF_RWRT 0x0020
|
||||
#define CDF_HWDM 0x0024
|
||||
#define CDF_MRW 0x0028
|
||||
|
||||
#define CDM_MRW_NOTMRW 0
|
||||
#define CDM_MRW_BGFORMAT_INACTIVE 1
|
||||
#define CDM_MRW_BGFORMAT_ACTIVE 2
|
||||
#define CDM_MRW_BGFORMAT_COMPLETE 3
|
||||
|
||||
#define MRW_LBA_DMA 0
|
||||
#define MRW_LBA_GAA 1
|
||||
|
||||
#define MRW_MODE_PC_PRE1 0x2c
|
||||
#define MRW_MODE_PC 0x03
|
||||
|
||||
struct mrw_feature_desc {
|
||||
__u16 feature_code;
|
||||
#ifdef __BIG_ENDIAN_BITFIELD
|
||||
__u8 reserved1 : 2;
|
||||
__u8 feature_version : 4;
|
||||
__u8 persistent : 1;
|
||||
__u8 curr : 1;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 curr : 1;
|
||||
__u8 persistent : 1;
|
||||
__u8 feature_version : 4;
|
||||
__u8 reserved1 : 2;
|
||||
#endif
|
||||
__u8 add_len;
|
||||
#ifdef __BIG_ENDIAN_BITFIELD
|
||||
__u8 reserved2 : 7;
|
||||
__u8 write : 1;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 write : 1;
|
||||
__u8 reserved2 : 7;
|
||||
#endif
|
||||
__u8 reserved3;
|
||||
__u8 reserved4;
|
||||
__u8 reserved5;
|
||||
};
|
||||
|
||||
struct rwrt_feature_desc {
|
||||
__u16 feature_code;
|
||||
#ifdef __BIG_ENDIAN_BITFIELD
|
||||
__u8 reserved1 : 2;
|
||||
__u8 feature_version : 4;
|
||||
__u8 persistent : 1;
|
||||
__u8 curr : 1;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 curr : 1;
|
||||
__u8 persistent : 1;
|
||||
__u8 feature_version : 4;
|
||||
__u8 reserved1 : 2;
|
||||
#endif
|
||||
__u8 add_len;
|
||||
__u32 last_lba;
|
||||
__u32 block_size;
|
||||
__u16 blocking;
|
||||
#ifdef __BIG_ENDIAN_BITFIELD
|
||||
__u8 reserved2 : 7;
|
||||
__u8 page_present : 1;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 page_present : 1;
|
||||
__u8 reserved2 : 7;
|
||||
#endif
|
||||
__u8 reserved3;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
__u16 disc_information_length;
|
||||
#ifdef __BIG_ENDIAN_BITFIELD
|
||||
__u8 reserved1 : 3;
|
||||
__u8 erasable : 1;
|
||||
__u8 border_status : 2;
|
||||
__u8 disc_status : 2;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 disc_status : 2;
|
||||
__u8 border_status : 2;
|
||||
__u8 erasable : 1;
|
||||
__u8 reserved1 : 3;
|
||||
#else
|
||||
#error "Please fix <asm/byteorder.h>"
|
||||
#endif
|
||||
__u8 n_first_track;
|
||||
__u8 n_sessions_lsb;
|
||||
__u8 first_track_lsb;
|
||||
__u8 last_track_lsb;
|
||||
#ifdef __BIG_ENDIAN_BITFIELD
|
||||
__u8 did_v : 1;
|
||||
__u8 dbc_v : 1;
|
||||
__u8 uru : 1;
|
||||
__u8 reserved2 : 2;
|
||||
__u8 dbit : 1;
|
||||
__u8 mrw_status : 2;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 mrw_status : 2;
|
||||
__u8 dbit : 1;
|
||||
__u8 reserved2 : 2;
|
||||
__u8 uru : 1;
|
||||
__u8 dbc_v : 1;
|
||||
__u8 did_v : 1;
|
||||
#endif
|
||||
__u8 disc_type;
|
||||
__u8 n_sessions_msb;
|
||||
__u8 first_track_msb;
|
||||
__u8 last_track_msb;
|
||||
__u32 disc_id;
|
||||
__u32 lead_in;
|
||||
__u32 lead_out;
|
||||
__u8 disc_bar_code[8];
|
||||
__u8 reserved3;
|
||||
__u8 n_opc;
|
||||
} disc_information;
|
||||
|
||||
typedef struct {
|
||||
__u16 track_information_length;
|
||||
__u8 track_lsb;
|
||||
__u8 session_lsb;
|
||||
__u8 reserved1;
|
||||
#ifdef __BIG_ENDIAN_BITFIELD
|
||||
__u8 reserved2 : 2;
|
||||
__u8 damage : 1;
|
||||
__u8 copy : 1;
|
||||
__u8 track_mode : 4;
|
||||
__u8 rt : 1;
|
||||
__u8 blank : 1;
|
||||
__u8 packet : 1;
|
||||
__u8 fp : 1;
|
||||
__u8 data_mode : 4;
|
||||
__u8 reserved3 : 6;
|
||||
__u8 lra_v : 1;
|
||||
__u8 nwa_v : 1;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 track_mode : 4;
|
||||
__u8 copy : 1;
|
||||
__u8 damage : 1;
|
||||
__u8 reserved2 : 2;
|
||||
__u8 data_mode : 4;
|
||||
__u8 fp : 1;
|
||||
__u8 packet : 1;
|
||||
__u8 blank : 1;
|
||||
__u8 rt : 1;
|
||||
__u8 nwa_v : 1;
|
||||
__u8 lra_v : 1;
|
||||
__u8 reserved3 : 6;
|
||||
#endif
|
||||
__u32 track_start;
|
||||
__u32 next_writable;
|
||||
__u32 free_blocks;
|
||||
__u32 fixed_packet_size;
|
||||
__u32 track_size;
|
||||
__u32 last_rec_address;
|
||||
} track_information;
|
||||
|
||||
struct feature_header {
|
||||
__u32 data_len;
|
||||
__u8 reserved1;
|
||||
__u8 reserved2;
|
||||
__u16 curr_profile;
|
||||
};
|
||||
|
||||
struct mode_page_header {
|
||||
__u16 mode_data_length;
|
||||
__u8 medium_type;
|
||||
__u8 reserved1;
|
||||
__u8 reserved2;
|
||||
__u8 reserved3;
|
||||
__u16 desc_length;
|
||||
};
|
||||
|
||||
#endif
|
29
libc/kernel/common/linux/circ_buf.h
Normal file
29
libc/kernel/common/linux/circ_buf.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_CIRC_BUF_H
|
||||
#define _LINUX_CIRC_BUF_H 1
|
||||
|
||||
struct circ_buf {
|
||||
char *buf;
|
||||
int head;
|
||||
int tail;
|
||||
};
|
||||
|
||||
#define CIRC_CNT(head,tail,size) (((head) - (tail)) & ((size)-1))
|
||||
|
||||
#define CIRC_SPACE(head,tail,size) CIRC_CNT((tail),((head)+1),(size))
|
||||
|
||||
#define CIRC_CNT_TO_END(head,tail,size) ({int end = (size) - (tail); int n = ((head) + end) & ((size)-1); n < end ? n : end;})
|
||||
|
||||
#define CIRC_SPACE_TO_END(head,tail,size) ({int end = (size) - 1 - (head); int n = (end + (tail)) & ((size)-1); n <= end ? n : end+1;})
|
||||
|
||||
#endif
|
23
libc/kernel/common/linux/clk.h
Normal file
23
libc/kernel/common/linux/clk.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __LINUX_CLK_H
|
||||
#define __LINUX_CLK_H
|
||||
|
||||
struct device;
|
||||
|
||||
struct clk;
|
||||
|
||||
struct clk *clk_get(struct device *dev, const char *id);
|
||||
|
||||
struct clk *clk_get_parent(struct clk *clk);
|
||||
|
||||
#endif
|
594
libc/kernel/common/linux/coda.h
Normal file
594
libc/kernel/common/linux/coda.h
Normal file
@@ -0,0 +1,594 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _CODA_HEADER_
|
||||
#define _CODA_HEADER_
|
||||
|
||||
#if defined(__NetBSD__) || (defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL)
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifndef CODA_MAXSYMLINKS
|
||||
#define CODA_MAXSYMLINKS 10
|
||||
#endif
|
||||
|
||||
#if defined(DJGPP) || defined(__CYGWIN32__)
|
||||
#ifdef KERNEL
|
||||
typedef unsigned long u_long;
|
||||
typedef unsigned int u_int;
|
||||
typedef unsigned short u_short;
|
||||
typedef u_long ino_t;
|
||||
typedef u_long dev_t;
|
||||
typedef void * caddr_t;
|
||||
#ifdef DOS
|
||||
typedef unsigned __int64 u_quad_t;
|
||||
#else
|
||||
typedef unsigned long long u_quad_t;
|
||||
#endif
|
||||
|
||||
#define inline
|
||||
|
||||
struct timespec {
|
||||
long ts_sec;
|
||||
long ts_nsec;
|
||||
};
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
typedef unsigned long long u_quad_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
#include <linux/time.h>
|
||||
#define cdev_t u_quad_t
|
||||
#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
|
||||
#define _UQUAD_T_ 1
|
||||
typedef unsigned long long u_quad_t;
|
||||
#endif
|
||||
#else
|
||||
#define cdev_t dev_t
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
struct timespec {
|
||||
time_t tv_sec;
|
||||
long tv_nsec;
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef __BIT_TYPES_DEFINED__
|
||||
#define __BIT_TYPES_DEFINED__
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char u_int8_t;
|
||||
typedef short int16_t;
|
||||
typedef unsigned short u_int16_t;
|
||||
typedef int int32_t;
|
||||
typedef unsigned int u_int32_t;
|
||||
#endif
|
||||
|
||||
#define CODA_MAXNAMLEN 255
|
||||
#define CODA_MAXPATHLEN 1024
|
||||
#define CODA_MAXSYMLINK 10
|
||||
|
||||
#define C_O_READ 0x001
|
||||
#define C_O_WRITE 0x002
|
||||
#define C_O_TRUNC 0x010
|
||||
#define C_O_EXCL 0x100
|
||||
#define C_O_CREAT 0x200
|
||||
|
||||
#define C_M_READ 00400
|
||||
#define C_M_WRITE 00200
|
||||
|
||||
#define C_A_C_OK 8
|
||||
#define C_A_R_OK 4
|
||||
#define C_A_W_OK 2
|
||||
#define C_A_X_OK 1
|
||||
#define C_A_F_OK 0
|
||||
|
||||
#ifndef _VENUS_DIRENT_T_
|
||||
#define _VENUS_DIRENT_T_ 1
|
||||
struct venus_dirent {
|
||||
u_int32_t d_fileno;
|
||||
u_int16_t d_reclen;
|
||||
u_int8_t d_type;
|
||||
u_int8_t d_namlen;
|
||||
char d_name[CODA_MAXNAMLEN + 1];
|
||||
};
|
||||
#undef DIRSIZ
|
||||
#define DIRSIZ(dp) ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
|
||||
|
||||
#define CDT_UNKNOWN 0
|
||||
#define CDT_FIFO 1
|
||||
#define CDT_CHR 2
|
||||
#define CDT_DIR 4
|
||||
#define CDT_BLK 6
|
||||
#define CDT_REG 8
|
||||
#define CDT_LNK 10
|
||||
#define CDT_SOCK 12
|
||||
#define CDT_WHT 14
|
||||
|
||||
#define IFTOCDT(mode) (((mode) & 0170000) >> 12)
|
||||
#define CDTTOIF(dirtype) ((dirtype) << 12)
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef _VUID_T_
|
||||
#define _VUID_T_
|
||||
typedef u_int32_t vuid_t;
|
||||
typedef u_int32_t vgid_t;
|
||||
#endif
|
||||
|
||||
struct CodaFid {
|
||||
u_int32_t opaque[4];
|
||||
};
|
||||
|
||||
#define coda_f2i(fid) (fid ? (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]) : 0)
|
||||
|
||||
#ifndef _VENUS_VATTR_T_
|
||||
#define _VENUS_VATTR_T_
|
||||
|
||||
enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
|
||||
|
||||
struct coda_vattr {
|
||||
long va_type;
|
||||
u_short va_mode;
|
||||
short va_nlink;
|
||||
vuid_t va_uid;
|
||||
vgid_t va_gid;
|
||||
long va_fileid;
|
||||
u_quad_t va_size;
|
||||
long va_blocksize;
|
||||
struct timespec va_atime;
|
||||
struct timespec va_mtime;
|
||||
struct timespec va_ctime;
|
||||
u_long va_gen;
|
||||
u_long va_flags;
|
||||
cdev_t va_rdev;
|
||||
u_quad_t va_bytes;
|
||||
u_quad_t va_filerev;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
struct coda_statfs {
|
||||
int32_t f_blocks;
|
||||
int32_t f_bfree;
|
||||
int32_t f_bavail;
|
||||
int32_t f_files;
|
||||
int32_t f_ffree;
|
||||
};
|
||||
|
||||
#define CODA_ROOT 2
|
||||
#define CODA_OPEN_BY_FD 3
|
||||
#define CODA_OPEN 4
|
||||
#define CODA_CLOSE 5
|
||||
#define CODA_IOCTL 6
|
||||
#define CODA_GETATTR 7
|
||||
#define CODA_SETATTR 8
|
||||
#define CODA_ACCESS 9
|
||||
#define CODA_LOOKUP 10
|
||||
#define CODA_CREATE 11
|
||||
#define CODA_REMOVE 12
|
||||
#define CODA_LINK 13
|
||||
#define CODA_RENAME 14
|
||||
#define CODA_MKDIR 15
|
||||
#define CODA_RMDIR 16
|
||||
#define CODA_SYMLINK 18
|
||||
#define CODA_READLINK 19
|
||||
#define CODA_FSYNC 20
|
||||
#define CODA_VGET 22
|
||||
#define CODA_SIGNAL 23
|
||||
#define CODA_REPLACE 24
|
||||
#define CODA_FLUSH 25
|
||||
#define CODA_PURGEUSER 26
|
||||
#define CODA_ZAPFILE 27
|
||||
#define CODA_ZAPDIR 28
|
||||
#define CODA_PURGEFID 30
|
||||
#define CODA_OPEN_BY_PATH 31
|
||||
#define CODA_RESOLVE 32
|
||||
#define CODA_REINTEGRATE 33
|
||||
#define CODA_STATFS 34
|
||||
#define CODA_STORE 35
|
||||
#define CODA_RELEASE 36
|
||||
#define CODA_NCALLS 37
|
||||
|
||||
#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
|
||||
|
||||
#define VC_MAXDATASIZE 8192
|
||||
#define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) + VC_MAXDATASIZE
|
||||
|
||||
#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
|
||||
|
||||
#define CODA_KERNEL_VERSION 3
|
||||
|
||||
struct coda_in_hdr {
|
||||
u_int32_t opcode;
|
||||
u_int32_t unique;
|
||||
pid_t pid;
|
||||
pid_t pgid;
|
||||
vuid_t uid;
|
||||
};
|
||||
|
||||
struct coda_out_hdr {
|
||||
u_int32_t opcode;
|
||||
u_int32_t unique;
|
||||
u_int32_t result;
|
||||
};
|
||||
|
||||
struct coda_root_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid VFid;
|
||||
};
|
||||
|
||||
struct coda_root_in {
|
||||
struct coda_in_hdr in;
|
||||
};
|
||||
|
||||
struct coda_open_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_open_out {
|
||||
struct coda_out_hdr oh;
|
||||
cdev_t dev;
|
||||
ino_t inode;
|
||||
};
|
||||
|
||||
struct coda_store_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_store_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
struct coda_release_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_release_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
struct coda_close_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_close_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
struct coda_ioctl_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int cmd;
|
||||
int len;
|
||||
int rwflag;
|
||||
char *data;
|
||||
};
|
||||
|
||||
struct coda_ioctl_out {
|
||||
struct coda_out_hdr oh;
|
||||
int len;
|
||||
caddr_t data;
|
||||
};
|
||||
|
||||
struct coda_getattr_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
};
|
||||
|
||||
struct coda_getattr_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct coda_vattr attr;
|
||||
};
|
||||
|
||||
struct coda_setattr_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
struct coda_vattr attr;
|
||||
};
|
||||
|
||||
struct coda_setattr_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
struct coda_access_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_access_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
#define CLU_CASE_SENSITIVE 0x01
|
||||
#define CLU_CASE_INSENSITIVE 0x02
|
||||
|
||||
struct coda_lookup_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int name;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_lookup_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid VFid;
|
||||
int vtype;
|
||||
};
|
||||
|
||||
struct coda_create_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
struct coda_vattr attr;
|
||||
int excl;
|
||||
int mode;
|
||||
int name;
|
||||
};
|
||||
|
||||
struct coda_create_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid VFid;
|
||||
struct coda_vattr attr;
|
||||
};
|
||||
|
||||
struct coda_remove_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int name;
|
||||
};
|
||||
|
||||
struct coda_remove_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
struct coda_link_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid sourceFid;
|
||||
struct CodaFid destFid;
|
||||
int tname;
|
||||
};
|
||||
|
||||
struct coda_link_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
struct coda_rename_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid sourceFid;
|
||||
int srcname;
|
||||
struct CodaFid destFid;
|
||||
int destname;
|
||||
};
|
||||
|
||||
struct coda_rename_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
struct coda_mkdir_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
struct coda_vattr attr;
|
||||
int name;
|
||||
};
|
||||
|
||||
struct coda_mkdir_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid VFid;
|
||||
struct coda_vattr attr;
|
||||
};
|
||||
|
||||
struct coda_rmdir_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int name;
|
||||
};
|
||||
|
||||
struct coda_rmdir_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
struct coda_symlink_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int srcname;
|
||||
struct coda_vattr attr;
|
||||
int tname;
|
||||
};
|
||||
|
||||
struct coda_symlink_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
struct coda_readlink_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
};
|
||||
|
||||
struct coda_readlink_out {
|
||||
struct coda_out_hdr oh;
|
||||
int count;
|
||||
caddr_t data;
|
||||
};
|
||||
|
||||
struct coda_fsync_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
};
|
||||
|
||||
struct coda_fsync_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
struct coda_vget_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
};
|
||||
|
||||
struct coda_vget_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid VFid;
|
||||
int vtype;
|
||||
};
|
||||
|
||||
struct coda_purgeuser_out {
|
||||
struct coda_out_hdr oh;
|
||||
vuid_t uid;
|
||||
};
|
||||
|
||||
struct coda_zapfile_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid CodaFid;
|
||||
};
|
||||
|
||||
struct coda_zapdir_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid CodaFid;
|
||||
};
|
||||
|
||||
struct coda_purgefid_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid CodaFid;
|
||||
};
|
||||
|
||||
struct coda_replace_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid NewFid;
|
||||
struct CodaFid OldFid;
|
||||
};
|
||||
|
||||
struct coda_open_by_fd_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_open_by_fd_out {
|
||||
struct coda_out_hdr oh;
|
||||
int fd;
|
||||
|
||||
};
|
||||
|
||||
struct coda_open_by_path_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_open_by_path_out {
|
||||
struct coda_out_hdr oh;
|
||||
int path;
|
||||
};
|
||||
|
||||
struct coda_statfs_in {
|
||||
struct coda_in_hdr in;
|
||||
};
|
||||
|
||||
struct coda_statfs_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct coda_statfs stat;
|
||||
};
|
||||
|
||||
#define CODA_NOCACHE 0x80000000
|
||||
|
||||
union inputArgs {
|
||||
struct coda_in_hdr ih;
|
||||
struct coda_open_in coda_open;
|
||||
struct coda_store_in coda_store;
|
||||
struct coda_release_in coda_release;
|
||||
struct coda_close_in coda_close;
|
||||
struct coda_ioctl_in coda_ioctl;
|
||||
struct coda_getattr_in coda_getattr;
|
||||
struct coda_setattr_in coda_setattr;
|
||||
struct coda_access_in coda_access;
|
||||
struct coda_lookup_in coda_lookup;
|
||||
struct coda_create_in coda_create;
|
||||
struct coda_remove_in coda_remove;
|
||||
struct coda_link_in coda_link;
|
||||
struct coda_rename_in coda_rename;
|
||||
struct coda_mkdir_in coda_mkdir;
|
||||
struct coda_rmdir_in coda_rmdir;
|
||||
struct coda_symlink_in coda_symlink;
|
||||
struct coda_readlink_in coda_readlink;
|
||||
struct coda_fsync_in coda_fsync;
|
||||
struct coda_vget_in coda_vget;
|
||||
struct coda_open_by_fd_in coda_open_by_fd;
|
||||
struct coda_open_by_path_in coda_open_by_path;
|
||||
struct coda_statfs_in coda_statfs;
|
||||
};
|
||||
|
||||
union outputArgs {
|
||||
struct coda_out_hdr oh;
|
||||
struct coda_root_out coda_root;
|
||||
struct coda_open_out coda_open;
|
||||
struct coda_ioctl_out coda_ioctl;
|
||||
struct coda_getattr_out coda_getattr;
|
||||
struct coda_lookup_out coda_lookup;
|
||||
struct coda_create_out coda_create;
|
||||
struct coda_mkdir_out coda_mkdir;
|
||||
struct coda_readlink_out coda_readlink;
|
||||
struct coda_vget_out coda_vget;
|
||||
struct coda_purgeuser_out coda_purgeuser;
|
||||
struct coda_zapfile_out coda_zapfile;
|
||||
struct coda_zapdir_out coda_zapdir;
|
||||
struct coda_purgefid_out coda_purgefid;
|
||||
struct coda_replace_out coda_replace;
|
||||
struct coda_open_by_fd_out coda_open_by_fd;
|
||||
struct coda_open_by_path_out coda_open_by_path;
|
||||
struct coda_statfs_out coda_statfs;
|
||||
};
|
||||
|
||||
union coda_downcalls {
|
||||
|
||||
struct coda_purgeuser_out purgeuser;
|
||||
struct coda_zapfile_out zapfile;
|
||||
struct coda_zapdir_out zapdir;
|
||||
struct coda_purgefid_out purgefid;
|
||||
struct coda_replace_out replace;
|
||||
};
|
||||
|
||||
#define PIOCPARM_MASK 0x0000ffff
|
||||
struct ViceIoctl {
|
||||
void __user *in;
|
||||
void __user *out;
|
||||
u_short in_size;
|
||||
u_short out_size;
|
||||
};
|
||||
|
||||
struct PioctlData {
|
||||
const char __user *path;
|
||||
int follow;
|
||||
struct ViceIoctl vi;
|
||||
};
|
||||
|
||||
#define CODA_CONTROL ".CONTROL"
|
||||
#define CODA_CONTROLLEN 8
|
||||
#define CTL_INO -1
|
||||
|
||||
#define CODA_MOUNT_VERSION 1
|
||||
|
||||
struct coda_mount_data {
|
||||
int version;
|
||||
int fd;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
15
libc/kernel/common/linux/coda_fs_i.h
Normal file
15
libc/kernel/common/linux/coda_fs_i.h
Normal file
@@ -0,0 +1,15 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_CODA_FS_I
|
||||
#define _LINUX_CODA_FS_I
|
||||
|
||||
#endif
|
15
libc/kernel/common/linux/compat.h
Normal file
15
libc/kernel/common/linux/compat.h
Normal file
@@ -0,0 +1,15 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_COMPAT_H
|
||||
#define _LINUX_COMPAT_H
|
||||
|
||||
#endif
|
22
libc/kernel/common/linux/compiler-gcc.h
Normal file
22
libc/kernel/common/linux/compiler-gcc.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#define barrier() __asm__ __volatile__("": : :"memory")
|
||||
|
||||
#define RELOC_HIDE(ptr, off) ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"(ptr)); (typeof(ptr)) (__ptr + (off)); })
|
||||
|
||||
#define inline inline __attribute__((always_inline))
|
||||
#define __inline__ __inline__ __attribute__((always_inline))
|
||||
#define __inline __inline __attribute__((always_inline))
|
||||
#define __deprecated __attribute__((deprecated))
|
||||
#define noinline __attribute__((noinline))
|
||||
#define __attribute_pure__ __attribute__((pure))
|
||||
#define __attribute_const__ __attribute__((__const__))
|
38
libc/kernel/common/linux/compiler.h
Normal file
38
libc/kernel/common/linux/compiler.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __LINUX_COMPILER_H
|
||||
#define __LINUX_COMPILER_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#define __user
|
||||
#define __kernel
|
||||
#define __safe
|
||||
#define __force
|
||||
#define __nocast
|
||||
#define __iomem
|
||||
#define __chk_user_ptr(x) (void)0
|
||||
#define __chk_io_ptr(x) (void)0
|
||||
#define __builtin_warning(x, y...) (1)
|
||||
#define __acquires(x)
|
||||
#define __releases(x)
|
||||
#define __acquire(x) (void)0
|
||||
#define __release(x) (void)0
|
||||
#define __cond_lock(x) (x)
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef __attribute_const__
|
||||
#define __attribute_const__
|
||||
#endif
|
||||
|
||||
#endif
|
32
libc/kernel/common/linux/completion.h
Normal file
32
libc/kernel/common/linux/completion.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __LINUX_COMPLETION_H
|
||||
#define __LINUX_COMPLETION_H
|
||||
|
||||
#include <linux/wait.h>
|
||||
|
||||
struct completion {
|
||||
unsigned int done;
|
||||
wait_queue_head_t wait;
|
||||
};
|
||||
|
||||
#define COMPLETION_INITIALIZER(work) { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) }
|
||||
|
||||
#define COMPLETION_INITIALIZER_ONSTACK(work) ({ init_completion(&work); work; })
|
||||
|
||||
#define DECLARE_COMPLETION(work) struct completion work = COMPLETION_INITIALIZER(work)
|
||||
|
||||
#define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work)
|
||||
|
||||
#define INIT_COMPLETION(x) ((x).done = 0)
|
||||
|
||||
#endif
|
17
libc/kernel/common/linux/config.h
Normal file
17
libc/kernel/common/linux/config.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_CONFIG_H
|
||||
#define _LINUX_CONFIG_H
|
||||
|
||||
#include <linux/autoconf.h>
|
||||
|
||||
#endif
|
121
libc/kernel/common/linux/console_struct.h
Normal file
121
libc/kernel/common/linux/console_struct.h
Normal file
@@ -0,0 +1,121 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#include <linux/wait.h>
|
||||
#include <linux/vt.h>
|
||||
|
||||
struct vt_struct;
|
||||
|
||||
#define NPAR 16
|
||||
|
||||
struct vc_data {
|
||||
unsigned short vc_num;
|
||||
unsigned int vc_cols;
|
||||
unsigned int vc_rows;
|
||||
unsigned int vc_size_row;
|
||||
unsigned int vc_scan_lines;
|
||||
unsigned long vc_origin;
|
||||
unsigned long vc_scr_end;
|
||||
unsigned long vc_visible_origin;
|
||||
unsigned int vc_top, vc_bottom;
|
||||
const struct consw *vc_sw;
|
||||
unsigned short *vc_screenbuf;
|
||||
unsigned int vc_screenbuf_size;
|
||||
unsigned char vc_mode;
|
||||
|
||||
unsigned char vc_attr;
|
||||
unsigned char vc_def_color;
|
||||
unsigned char vc_color;
|
||||
unsigned char vc_s_color;
|
||||
unsigned char vc_ulcolor;
|
||||
unsigned char vc_halfcolor;
|
||||
|
||||
unsigned int vc_cursor_type;
|
||||
unsigned short vc_complement_mask;
|
||||
unsigned short vc_s_complement_mask;
|
||||
unsigned int vc_x, vc_y;
|
||||
unsigned int vc_saved_x, vc_saved_y;
|
||||
unsigned long vc_pos;
|
||||
|
||||
unsigned short vc_hi_font_mask;
|
||||
struct console_font vc_font;
|
||||
unsigned short vc_video_erase_char;
|
||||
|
||||
unsigned int vc_state;
|
||||
unsigned int vc_npar,vc_par[NPAR];
|
||||
struct tty_struct *vc_tty;
|
||||
|
||||
struct vt_mode vt_mode;
|
||||
int vt_pid;
|
||||
int vt_newvt;
|
||||
wait_queue_head_t paste_wait;
|
||||
|
||||
unsigned int vc_charset : 1;
|
||||
unsigned int vc_s_charset : 1;
|
||||
unsigned int vc_disp_ctrl : 1;
|
||||
unsigned int vc_toggle_meta : 1;
|
||||
unsigned int vc_decscnm : 1;
|
||||
unsigned int vc_decom : 1;
|
||||
unsigned int vc_decawm : 1;
|
||||
unsigned int vc_deccm : 1;
|
||||
unsigned int vc_decim : 1;
|
||||
unsigned int vc_deccolm : 1;
|
||||
|
||||
unsigned int vc_intensity : 2;
|
||||
unsigned int vc_underline : 1;
|
||||
unsigned int vc_blink : 1;
|
||||
unsigned int vc_reverse : 1;
|
||||
unsigned int vc_s_intensity : 2;
|
||||
unsigned int vc_s_underline : 1;
|
||||
unsigned int vc_s_blink : 1;
|
||||
unsigned int vc_s_reverse : 1;
|
||||
|
||||
unsigned int vc_ques : 1;
|
||||
unsigned int vc_need_wrap : 1;
|
||||
unsigned int vc_can_do_color : 1;
|
||||
unsigned int vc_report_mouse : 2;
|
||||
unsigned int vc_kmalloced : 1;
|
||||
unsigned char vc_utf : 1;
|
||||
unsigned char vc_utf_count;
|
||||
int vc_utf_char;
|
||||
unsigned int vc_tab_stop[8];
|
||||
unsigned char vc_palette[16*3];
|
||||
unsigned short * vc_translate;
|
||||
unsigned char vc_G0_charset;
|
||||
unsigned char vc_G1_charset;
|
||||
unsigned char vc_saved_G0;
|
||||
unsigned char vc_saved_G1;
|
||||
unsigned int vc_bell_pitch;
|
||||
unsigned int vc_bell_duration;
|
||||
struct vc_data **vc_display_fg;
|
||||
unsigned long vc_uni_pagedir;
|
||||
unsigned long *vc_uni_pagedir_loc;
|
||||
|
||||
};
|
||||
|
||||
struct vc {
|
||||
struct vc_data *d;
|
||||
|
||||
};
|
||||
|
||||
#define CUR_DEF 0
|
||||
#define CUR_NONE 1
|
||||
#define CUR_UNDERLINE 2
|
||||
#define CUR_LOWER_THIRD 3
|
||||
#define CUR_LOWER_HALF 4
|
||||
#define CUR_TWO_THIRDS 5
|
||||
#define CUR_BLOCK 6
|
||||
#define CUR_HWMASK 0x0f
|
||||
#define CUR_SWMASK 0xfff0
|
||||
|
||||
#define CUR_DEFAULT CUR_UNDERLINE
|
||||
|
||||
#define CON_IS_VISIBLE(conp) (*conp->vc_display_fg == conp)
|
36
libc/kernel/common/linux/cpu.h
Normal file
36
libc/kernel/common/linux/cpu.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_CPU_H_
|
||||
#define _LINUX_CPU_H_
|
||||
|
||||
#include <linux/sysdev.h>
|
||||
#include <linux/node.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/cpumask.h>
|
||||
#include <asm/semaphore.h>
|
||||
|
||||
struct cpu {
|
||||
int node_id;
|
||||
int no_control;
|
||||
struct sys_device sysdev;
|
||||
};
|
||||
|
||||
struct notifier_block;
|
||||
|
||||
#define lock_cpu_hotplug() do { } while (0)
|
||||
#define unlock_cpu_hotplug() do { } while (0)
|
||||
#define lock_cpu_hotplug_interruptible() 0
|
||||
#define hotcpu_notifier(fn, pri) do { } while (0)
|
||||
#define register_hotcpu_notifier(nb) do { } while (0)
|
||||
#define unregister_hotcpu_notifier(nb) do { } while (0)
|
||||
|
||||
#endif
|
87
libc/kernel/common/linux/cpumask.h
Normal file
87
libc/kernel/common/linux/cpumask.h
Normal file
@@ -0,0 +1,87 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __LINUX_CPUMASK_H
|
||||
#define __LINUX_CPUMASK_H
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/threads.h>
|
||||
#include <linux/bitmap.h>
|
||||
|
||||
typedef struct { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;
|
||||
|
||||
#define cpu_set(cpu, dst) __cpu_set((cpu), &(dst))
|
||||
#define cpu_clear(cpu, dst) __cpu_clear((cpu), &(dst))
|
||||
#define cpus_setall(dst) __cpus_setall(&(dst), NR_CPUS)
|
||||
#define cpus_clear(dst) __cpus_clear(&(dst), NR_CPUS)
|
||||
#define cpu_isset(cpu, cpumask) test_bit((cpu), (cpumask).bits)
|
||||
#define cpu_test_and_set(cpu, cpumask) __cpu_test_and_set((cpu), &(cpumask))
|
||||
#define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
#define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
#define cpus_xor(dst, src1, src2) __cpus_xor(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
#define cpus_andnot(dst, src1, src2) __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
#define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS)
|
||||
#define cpus_equal(src1, src2) __cpus_equal(&(src1), &(src2), NR_CPUS)
|
||||
#define cpus_intersects(src1, src2) __cpus_intersects(&(src1), &(src2), NR_CPUS)
|
||||
#define cpus_subset(src1, src2) __cpus_subset(&(src1), &(src2), NR_CPUS)
|
||||
#define cpus_empty(src) __cpus_empty(&(src), NR_CPUS)
|
||||
#define cpus_full(cpumask) __cpus_full(&(cpumask), NR_CPUS)
|
||||
#define cpus_weight(cpumask) __cpus_weight(&(cpumask), NR_CPUS)
|
||||
#define cpus_shift_right(dst, src, n) __cpus_shift_right(&(dst), &(src), (n), NR_CPUS)
|
||||
#define cpus_shift_left(dst, src, n) __cpus_shift_left(&(dst), &(src), (n), NR_CPUS)
|
||||
#define first_cpu(src) 0
|
||||
#define next_cpu(n, src) 1
|
||||
#define cpumask_of_cpu(cpu) ({ typeof(_unused_cpumask_arg_) m; if (sizeof(m) == sizeof(unsigned long)) { m.bits[0] = 1UL<<(cpu); } else { cpus_clear(m); cpu_set((cpu), m); } m; })
|
||||
#define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS)
|
||||
#if NR_CPUS <= BITS_PER_LONG
|
||||
#define CPU_MASK_ALL (cpumask_t) { { [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD } }
|
||||
#else
|
||||
#define CPU_MASK_ALL (cpumask_t) { { [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD } }
|
||||
#endif
|
||||
#define CPU_MASK_NONE (cpumask_t) { { [0 ... BITS_TO_LONGS(NR_CPUS)-1] = 0UL } }
|
||||
#define CPU_MASK_CPU0 (cpumask_t) { { [0] = 1UL } }
|
||||
#define cpus_addr(src) ((src).bits)
|
||||
#define cpumask_scnprintf(buf, len, src) __cpumask_scnprintf((buf), (len), &(src), NR_CPUS)
|
||||
#define cpumask_parse(ubuf, ulen, dst) __cpumask_parse((ubuf), (ulen), &(dst), NR_CPUS)
|
||||
#define cpulist_scnprintf(buf, len, src) __cpulist_scnprintf((buf), (len), &(src), NR_CPUS)
|
||||
#define cpulist_parse(buf, dst) __cpulist_parse((buf), &(dst), NR_CPUS)
|
||||
#define cpu_remap(oldbit, old, new) __cpu_remap((oldbit), &(old), &(new), NR_CPUS)
|
||||
#define cpus_remap(dst, src, old, new) __cpus_remap(&(dst), &(src), &(old), &(new), NR_CPUS)
|
||||
#if NR_CPUS > 1
|
||||
#define for_each_cpu_mask(cpu, mask) for ((cpu) = first_cpu(mask); (cpu) < NR_CPUS; (cpu) = next_cpu((cpu), (mask)))
|
||||
#else
|
||||
#define for_each_cpu_mask(cpu, mask) for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
|
||||
#endif
|
||||
|
||||
#if NR_CPUS > 1
|
||||
#define num_online_cpus() cpus_weight(cpu_online_map)
|
||||
#define num_possible_cpus() cpus_weight(cpu_possible_map)
|
||||
#define num_present_cpus() cpus_weight(cpu_present_map)
|
||||
#define cpu_online(cpu) cpu_isset((cpu), cpu_online_map)
|
||||
#define cpu_possible(cpu) cpu_isset((cpu), cpu_possible_map)
|
||||
#define cpu_present(cpu) cpu_isset((cpu), cpu_present_map)
|
||||
#else
|
||||
#define num_online_cpus() 1
|
||||
#define num_possible_cpus() 1
|
||||
#define num_present_cpus() 1
|
||||
#define cpu_online(cpu) ((cpu) == 0)
|
||||
#define cpu_possible(cpu) ((cpu) == 0)
|
||||
#define cpu_present(cpu) ((cpu) == 0)
|
||||
#endif
|
||||
|
||||
#define highest_possible_processor_id() 0
|
||||
#define any_online_cpu(mask) 0
|
||||
|
||||
#define for_each_possible_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map)
|
||||
#define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map)
|
||||
#define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map)
|
||||
|
||||
#endif
|
43
libc/kernel/common/linux/ctype.h
Normal file
43
libc/kernel/common/linux/ctype.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_CTYPE_H
|
||||
#define _LINUX_CTYPE_H
|
||||
|
||||
#define _U 0x01
|
||||
#define _L 0x02
|
||||
#define _D 0x04
|
||||
#define _C 0x08
|
||||
#define _P 0x10
|
||||
#define _S 0x20
|
||||
#define _X 0x40
|
||||
#define _SP 0x80
|
||||
|
||||
#define __ismask(x) (_ctype[(int)(unsigned char)(x)])
|
||||
|
||||
#define isalnum(c) ((__ismask(c)&(_U|_L|_D)) != 0)
|
||||
#define isalpha(c) ((__ismask(c)&(_U|_L)) != 0)
|
||||
#define iscntrl(c) ((__ismask(c)&(_C)) != 0)
|
||||
#define isdigit(c) ((__ismask(c)&(_D)) != 0)
|
||||
#define isgraph(c) ((__ismask(c)&(_P|_U|_L|_D)) != 0)
|
||||
#define islower(c) ((__ismask(c)&(_L)) != 0)
|
||||
#define isprint(c) ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0)
|
||||
#define ispunct(c) ((__ismask(c)&(_P)) != 0)
|
||||
#define isspace(c) ((__ismask(c)&(_S)) != 0)
|
||||
#define isupper(c) ((__ismask(c)&(_U)) != 0)
|
||||
#define isxdigit(c) ((__ismask(c)&(_D|_X)) != 0)
|
||||
|
||||
#define isascii(c) (((unsigned char)(c))<=0x7f)
|
||||
#define toascii(c) (((unsigned char)(c))&0x7f)
|
||||
|
||||
#define tolower(c) __tolower(c)
|
||||
#define toupper(c) __toupper(c)
|
||||
#endif
|
135
libc/kernel/common/linux/dccp.h
Normal file
135
libc/kernel/common/linux/dccp.h
Normal file
@@ -0,0 +1,135 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_DCCP_H
|
||||
#define _LINUX_DCCP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
struct dccp_hdr {
|
||||
__be16 dccph_sport,
|
||||
dccph_dport;
|
||||
__u8 dccph_doff;
|
||||
#ifdef __LITTLE_ENDIAN_BITFIELD
|
||||
__u8 dccph_cscov:4,
|
||||
dccph_ccval:4;
|
||||
#elif defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 dccph_ccval:4,
|
||||
dccph_cscov:4;
|
||||
#else
|
||||
#error "Adjust your <asm/byteorder.h> defines"
|
||||
#endif
|
||||
__u16 dccph_checksum;
|
||||
#ifdef __LITTLE_ENDIAN_BITFIELD
|
||||
__u8 dccph_x:1,
|
||||
dccph_type:4,
|
||||
dccph_reserved:3;
|
||||
#elif defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 dccph_reserved:3,
|
||||
dccph_type:4,
|
||||
dccph_x:1;
|
||||
#else
|
||||
#error "Adjust your <asm/byteorder.h> defines"
|
||||
#endif
|
||||
__u8 dccph_seq2;
|
||||
__be16 dccph_seq;
|
||||
};
|
||||
|
||||
struct dccp_hdr_ext {
|
||||
__be32 dccph_seq_low;
|
||||
};
|
||||
|
||||
struct dccp_hdr_request {
|
||||
__be32 dccph_req_service;
|
||||
};
|
||||
|
||||
struct dccp_hdr_ack_bits {
|
||||
__be16 dccph_reserved1;
|
||||
__be16 dccph_ack_nr_high;
|
||||
__be32 dccph_ack_nr_low;
|
||||
};
|
||||
|
||||
struct dccp_hdr_response {
|
||||
struct dccp_hdr_ack_bits dccph_resp_ack;
|
||||
__be32 dccph_resp_service;
|
||||
};
|
||||
|
||||
struct dccp_hdr_reset {
|
||||
struct dccp_hdr_ack_bits dccph_reset_ack;
|
||||
__u8 dccph_reset_code,
|
||||
dccph_reset_data[3];
|
||||
};
|
||||
|
||||
enum dccp_pkt_type {
|
||||
DCCP_PKT_REQUEST = 0,
|
||||
DCCP_PKT_RESPONSE,
|
||||
DCCP_PKT_DATA,
|
||||
DCCP_PKT_ACK,
|
||||
DCCP_PKT_DATAACK,
|
||||
DCCP_PKT_CLOSEREQ,
|
||||
DCCP_PKT_CLOSE,
|
||||
DCCP_PKT_RESET,
|
||||
DCCP_PKT_SYNC,
|
||||
DCCP_PKT_SYNCACK,
|
||||
DCCP_PKT_INVALID,
|
||||
};
|
||||
|
||||
#define DCCP_NR_PKT_TYPES DCCP_PKT_INVALID
|
||||
|
||||
enum {
|
||||
DCCPO_PADDING = 0,
|
||||
DCCPO_MANDATORY = 1,
|
||||
DCCPO_MIN_RESERVED = 3,
|
||||
DCCPO_MAX_RESERVED = 31,
|
||||
DCCPO_CHANGE_L = 32,
|
||||
DCCPO_CONFIRM_L = 33,
|
||||
DCCPO_CHANGE_R = 34,
|
||||
DCCPO_CONFIRM_R = 35,
|
||||
DCCPO_NDP_COUNT = 37,
|
||||
DCCPO_ACK_VECTOR_0 = 38,
|
||||
DCCPO_ACK_VECTOR_1 = 39,
|
||||
DCCPO_TIMESTAMP = 41,
|
||||
DCCPO_TIMESTAMP_ECHO = 42,
|
||||
DCCPO_ELAPSED_TIME = 43,
|
||||
DCCPO_MAX = 45,
|
||||
DCCPO_MIN_CCID_SPECIFIC = 128,
|
||||
DCCPO_MAX_CCID_SPECIFIC = 255,
|
||||
};
|
||||
|
||||
enum {
|
||||
DCCPF_RESERVED = 0,
|
||||
DCCPF_CCID = 1,
|
||||
DCCPF_SEQUENCE_WINDOW = 3,
|
||||
DCCPF_ACK_RATIO = 5,
|
||||
DCCPF_SEND_ACK_VECTOR = 6,
|
||||
DCCPF_SEND_NDP_COUNT = 7,
|
||||
|
||||
DCCPF_MIN_CCID_SPECIFIC = 128,
|
||||
DCCPF_MAX_CCID_SPECIFIC = 255,
|
||||
};
|
||||
|
||||
struct dccp_so_feat {
|
||||
__u8 dccpsf_feat;
|
||||
__u8 *dccpsf_val;
|
||||
__u8 dccpsf_len;
|
||||
};
|
||||
|
||||
#define DCCP_SOCKOPT_PACKET_SIZE 1
|
||||
#define DCCP_SOCKOPT_SERVICE 2
|
||||
#define DCCP_SOCKOPT_CHANGE_L 3
|
||||
#define DCCP_SOCKOPT_CHANGE_R 4
|
||||
#define DCCP_SOCKOPT_CCID_RX_INFO 128
|
||||
#define DCCP_SOCKOPT_CCID_TX_INFO 192
|
||||
|
||||
#define DCCP_SERVICE_LIST_MAX_LEN 32
|
||||
|
||||
#endif
|
26
libc/kernel/common/linux/debug_locks.h
Normal file
26
libc/kernel/common/linux/debug_locks.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __LINUX_DEBUG_LOCKING_H
|
||||
#define __LINUX_DEBUG_LOCKING_H
|
||||
|
||||
struct task_struct;
|
||||
|
||||
#define _RET_IP_ (unsigned long)__builtin_return_address(0)
|
||||
#define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
|
||||
|
||||
#define DEBUG_LOCKS_WARN_ON(c) ({ int __ret = 0; if (unlikely(c)) { if (debug_locks_off()) WARN_ON(1); __ret = 1; } __ret; })
|
||||
|
||||
#define SMP_DEBUG_LOCKS_WARN_ON(c) do { } while (0)
|
||||
|
||||
#define locking_selftest() do { } while (0)
|
||||
|
||||
#endif
|
29
libc/kernel/common/linux/delay.h
Normal file
29
libc/kernel/common/linux/delay.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_DELAY_H
|
||||
#define _LINUX_DELAY_H
|
||||
|
||||
#include <asm/delay.h>
|
||||
|
||||
#ifndef MAX_UDELAY_MS
|
||||
#define MAX_UDELAY_MS 5
|
||||
#endif
|
||||
|
||||
#ifndef mdelay
|
||||
#define mdelay(n) ( (__builtin_constant_p(n) && (n)<=MAX_UDELAY_MS) ? udelay((n)*1000) : ({unsigned long __ms=(n); while (__ms--) udelay(1000);}))
|
||||
#endif
|
||||
|
||||
#ifndef ndelay
|
||||
#define ndelay(x) udelay(((x)+999)/1000)
|
||||
#endif
|
||||
|
||||
#endif
|
222
libc/kernel/common/linux/device.h
Normal file
222
libc/kernel/common/linux/device.h
Normal file
@@ -0,0 +1,222 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _DEVICE_H_
|
||||
#define _DEVICE_H_
|
||||
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/klist.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/pm.h>
|
||||
#include <asm/semaphore.h>
|
||||
#include <asm/atomic.h>
|
||||
|
||||
#define DEVICE_NAME_SIZE 50
|
||||
#define DEVICE_NAME_HALF __stringify(20)
|
||||
#define DEVICE_ID_SIZE 32
|
||||
#define BUS_ID_SIZE KOBJ_NAME_LEN
|
||||
|
||||
struct device;
|
||||
struct device_driver;
|
||||
struct class;
|
||||
struct class_device;
|
||||
|
||||
struct bus_type {
|
||||
const char * name;
|
||||
|
||||
struct subsystem subsys;
|
||||
struct kset drivers;
|
||||
struct kset devices;
|
||||
struct klist klist_devices;
|
||||
struct klist klist_drivers;
|
||||
|
||||
struct bus_attribute * bus_attrs;
|
||||
struct device_attribute * dev_attrs;
|
||||
struct driver_attribute * drv_attrs;
|
||||
|
||||
int (*match)(struct device * dev, struct device_driver * drv);
|
||||
int (*uevent)(struct device *dev, char **envp,
|
||||
int num_envp, char *buffer, int buffer_size);
|
||||
int (*probe)(struct device * dev);
|
||||
int (*remove)(struct device * dev);
|
||||
void (*shutdown)(struct device * dev);
|
||||
int (*suspend)(struct device * dev, pm_message_t state);
|
||||
int (*resume)(struct device * dev);
|
||||
};
|
||||
|
||||
struct device * bus_find_device(struct bus_type *bus, struct device *start,
|
||||
void *data, int (*match)(struct device *, void *));
|
||||
|
||||
struct bus_attribute {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(struct bus_type *, char * buf);
|
||||
ssize_t (*store)(struct bus_type *, const char * buf, size_t count);
|
||||
};
|
||||
|
||||
#define BUS_ATTR(_name,_mode,_show,_store) struct bus_attribute bus_attr_##_name = __ATTR(_name,_mode,_show,_store)
|
||||
|
||||
struct device_driver {
|
||||
const char * name;
|
||||
struct bus_type * bus;
|
||||
|
||||
struct completion unloaded;
|
||||
struct kobject kobj;
|
||||
struct klist klist_devices;
|
||||
struct klist_node knode_bus;
|
||||
|
||||
struct module * owner;
|
||||
|
||||
int (*probe) (struct device * dev);
|
||||
int (*remove) (struct device * dev);
|
||||
void (*shutdown) (struct device * dev);
|
||||
int (*suspend) (struct device * dev, pm_message_t state);
|
||||
int (*resume) (struct device * dev);
|
||||
};
|
||||
|
||||
struct driver_attribute {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(struct device_driver *, char * buf);
|
||||
ssize_t (*store)(struct device_driver *, const char * buf, size_t count);
|
||||
};
|
||||
|
||||
#define DRIVER_ATTR(_name,_mode,_show,_store) struct driver_attribute driver_attr_##_name = __ATTR(_name,_mode,_show,_store)
|
||||
|
||||
struct device * driver_find_device(struct device_driver *drv,
|
||||
struct device *start, void *data,
|
||||
int (*match)(struct device *, void *));
|
||||
|
||||
struct class {
|
||||
const char * name;
|
||||
struct module * owner;
|
||||
|
||||
struct subsystem subsys;
|
||||
struct list_head children;
|
||||
struct list_head devices;
|
||||
struct list_head interfaces;
|
||||
struct semaphore sem;
|
||||
|
||||
struct class_attribute * class_attrs;
|
||||
struct class_device_attribute * class_dev_attrs;
|
||||
|
||||
int (*uevent)(struct class_device *dev, char **envp,
|
||||
int num_envp, char *buffer, int buffer_size);
|
||||
|
||||
void (*release)(struct class_device *dev);
|
||||
void (*class_release)(struct class *class);
|
||||
};
|
||||
|
||||
struct class_attribute {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(struct class *, char * buf);
|
||||
ssize_t (*store)(struct class *, const char * buf, size_t count);
|
||||
};
|
||||
|
||||
#define CLASS_ATTR(_name,_mode,_show,_store) struct class_attribute class_attr_##_name = __ATTR(_name,_mode,_show,_store)
|
||||
|
||||
struct class_device_attribute {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(struct class_device *, char * buf);
|
||||
ssize_t (*store)(struct class_device *, const char * buf, size_t count);
|
||||
};
|
||||
|
||||
#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store) struct class_device_attribute class_device_attr_##_name = __ATTR(_name,_mode,_show,_store)
|
||||
|
||||
struct class_device {
|
||||
struct list_head node;
|
||||
|
||||
struct kobject kobj;
|
||||
struct class * class;
|
||||
dev_t devt;
|
||||
struct class_device_attribute *devt_attr;
|
||||
struct class_device_attribute uevent_attr;
|
||||
struct device * dev;
|
||||
void * class_data;
|
||||
struct class_device *parent;
|
||||
struct attribute_group ** groups;
|
||||
|
||||
void (*release)(struct class_device *dev);
|
||||
int (*uevent)(struct class_device *dev, char **envp,
|
||||
int num_envp, char *buffer, int buffer_size);
|
||||
char class_id[BUS_ID_SIZE];
|
||||
};
|
||||
|
||||
struct class_interface {
|
||||
struct list_head node;
|
||||
struct class *class;
|
||||
|
||||
int (*add) (struct class_device *, struct class_interface *);
|
||||
void (*remove) (struct class_device *, struct class_interface *);
|
||||
};
|
||||
|
||||
struct device_attribute {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(struct device *dev, struct device_attribute *attr,
|
||||
char *buf);
|
||||
ssize_t (*store)(struct device *dev, struct device_attribute *attr,
|
||||
const char *buf, size_t count);
|
||||
};
|
||||
|
||||
#define DEVICE_ATTR(_name,_mode,_show,_store) struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store)
|
||||
|
||||
struct device {
|
||||
struct klist klist_children;
|
||||
struct klist_node knode_parent;
|
||||
struct klist_node knode_driver;
|
||||
struct klist_node knode_bus;
|
||||
struct device * parent;
|
||||
|
||||
struct kobject kobj;
|
||||
char bus_id[BUS_ID_SIZE];
|
||||
struct device_attribute uevent_attr;
|
||||
struct device_attribute *devt_attr;
|
||||
|
||||
struct semaphore sem;
|
||||
|
||||
struct bus_type * bus;
|
||||
struct device_driver *driver;
|
||||
void *driver_data;
|
||||
void *platform_data;
|
||||
void *firmware_data;
|
||||
struct dev_pm_info power;
|
||||
|
||||
u64 *dma_mask;
|
||||
u64 coherent_dma_mask;
|
||||
|
||||
struct list_head dma_pools;
|
||||
|
||||
struct dma_coherent_mem *dma_mem;
|
||||
|
||||
struct list_head node;
|
||||
struct class *class;
|
||||
dev_t devt;
|
||||
|
||||
void (*release)(struct device * dev);
|
||||
};
|
||||
|
||||
#define dev_printk(level, dev, format, arg...) printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg)
|
||||
|
||||
#ifdef DEBUG
|
||||
#define dev_dbg(dev, format, arg...) dev_printk(KERN_DEBUG , dev , format , ## arg)
|
||||
#else
|
||||
#define dev_dbg(dev, format, arg...) do { (void)(dev); } while (0)
|
||||
#endif
|
||||
|
||||
#define dev_err(dev, format, arg...) dev_printk(KERN_ERR , dev , format , ## arg)
|
||||
#define dev_info(dev, format, arg...) dev_printk(KERN_INFO , dev , format , ## arg)
|
||||
#define dev_warn(dev, format, arg...) dev_printk(KERN_WARNING , dev , format , ## arg)
|
||||
#define dev_notice(dev, format, arg...) dev_printk(KERN_NOTICE , dev , format , ## arg)
|
||||
|
||||
#define MODULE_ALIAS_CHARDEV(major,minor) MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor))
|
||||
#define MODULE_ALIAS_CHARDEV_MAJOR(major) MODULE_ALIAS("char-major-" __stringify(major) "-*")
|
||||
#endif
|
30
libc/kernel/common/linux/dirent.h
Normal file
30
libc/kernel/common/linux/dirent.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_DIRENT_H
|
||||
#define _LINUX_DIRENT_H
|
||||
|
||||
struct dirent {
|
||||
long d_ino;
|
||||
__kernel_off_t d_off;
|
||||
unsigned short d_reclen;
|
||||
char d_name[256];
|
||||
};
|
||||
|
||||
struct dirent64 {
|
||||
__u64 d_ino;
|
||||
__s64 d_off;
|
||||
unsigned short d_reclen;
|
||||
unsigned char d_type;
|
||||
char d_name[256];
|
||||
};
|
||||
|
||||
#endif
|
146
libc/kernel/common/linux/dm-ioctl.h
Normal file
146
libc/kernel/common/linux/dm-ioctl.h
Normal file
@@ -0,0 +1,146 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_DM_IOCTL_V4_H
|
||||
#define _LINUX_DM_IOCTL_V4_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define DM_DIR "mapper"
|
||||
#define DM_MAX_TYPE_NAME 16
|
||||
#define DM_NAME_LEN 128
|
||||
#define DM_UUID_LEN 129
|
||||
|
||||
struct dm_ioctl {
|
||||
|
||||
uint32_t version[3];
|
||||
uint32_t data_size;
|
||||
|
||||
uint32_t data_start;
|
||||
|
||||
uint32_t target_count;
|
||||
int32_t open_count;
|
||||
uint32_t flags;
|
||||
uint32_t event_nr;
|
||||
uint32_t padding;
|
||||
|
||||
uint64_t dev;
|
||||
|
||||
char name[DM_NAME_LEN];
|
||||
char uuid[DM_UUID_LEN];
|
||||
char data[7];
|
||||
};
|
||||
|
||||
struct dm_target_spec {
|
||||
uint64_t sector_start;
|
||||
uint64_t length;
|
||||
int32_t status;
|
||||
|
||||
uint32_t next;
|
||||
|
||||
char target_type[DM_MAX_TYPE_NAME];
|
||||
|
||||
};
|
||||
|
||||
struct dm_target_deps {
|
||||
uint32_t count;
|
||||
uint32_t padding;
|
||||
uint64_t dev[0];
|
||||
};
|
||||
|
||||
struct dm_name_list {
|
||||
uint64_t dev;
|
||||
uint32_t next;
|
||||
char name[0];
|
||||
};
|
||||
|
||||
struct dm_target_versions {
|
||||
uint32_t next;
|
||||
uint32_t version[3];
|
||||
|
||||
char name[0];
|
||||
};
|
||||
|
||||
struct dm_target_msg {
|
||||
uint64_t sector;
|
||||
|
||||
char message[0];
|
||||
};
|
||||
|
||||
enum {
|
||||
|
||||
DM_VERSION_CMD = 0,
|
||||
DM_REMOVE_ALL_CMD,
|
||||
DM_LIST_DEVICES_CMD,
|
||||
|
||||
DM_DEV_CREATE_CMD,
|
||||
DM_DEV_REMOVE_CMD,
|
||||
DM_DEV_RENAME_CMD,
|
||||
DM_DEV_SUSPEND_CMD,
|
||||
DM_DEV_STATUS_CMD,
|
||||
DM_DEV_WAIT_CMD,
|
||||
|
||||
DM_TABLE_LOAD_CMD,
|
||||
DM_TABLE_CLEAR_CMD,
|
||||
DM_TABLE_DEPS_CMD,
|
||||
DM_TABLE_STATUS_CMD,
|
||||
|
||||
DM_LIST_VERSIONS_CMD,
|
||||
DM_TARGET_MSG_CMD,
|
||||
DM_DEV_SET_GEOMETRY_CMD
|
||||
};
|
||||
|
||||
#define DM_IOCTL 0xfd
|
||||
|
||||
#define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl)
|
||||
#define DM_REMOVE_ALL _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, struct dm_ioctl)
|
||||
#define DM_LIST_DEVICES _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, struct dm_ioctl)
|
||||
|
||||
#define DM_DEV_CREATE _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, struct dm_ioctl)
|
||||
#define DM_DEV_REMOVE _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, struct dm_ioctl)
|
||||
#define DM_DEV_RENAME _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, struct dm_ioctl)
|
||||
#define DM_DEV_SUSPEND _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, struct dm_ioctl)
|
||||
#define DM_DEV_STATUS _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, struct dm_ioctl)
|
||||
#define DM_DEV_WAIT _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, struct dm_ioctl)
|
||||
|
||||
#define DM_TABLE_LOAD _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, struct dm_ioctl)
|
||||
#define DM_TABLE_CLEAR _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, struct dm_ioctl)
|
||||
#define DM_TABLE_DEPS _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, struct dm_ioctl)
|
||||
#define DM_TABLE_STATUS _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, struct dm_ioctl)
|
||||
|
||||
#define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl)
|
||||
|
||||
#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)
|
||||
#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
|
||||
|
||||
#define DM_VERSION_MAJOR 4
|
||||
#define DM_VERSION_MINOR 14
|
||||
#define DM_VERSION_PATCHLEVEL 0
|
||||
#define DM_VERSION_EXTRA "-ioctl (2008-04-23)"
|
||||
|
||||
#define DM_READONLY_FLAG (1 << 0)
|
||||
#define DM_SUSPEND_FLAG (1 << 1)
|
||||
#define DM_PERSISTENT_DEV_FLAG (1 << 3)
|
||||
|
||||
#define DM_STATUS_TABLE_FLAG (1 << 4)
|
||||
|
||||
#define DM_ACTIVE_PRESENT_FLAG (1 << 5)
|
||||
#define DM_INACTIVE_PRESENT_FLAG (1 << 6)
|
||||
|
||||
#define DM_BUFFER_FULL_FLAG (1 << 8)
|
||||
|
||||
#define DM_SKIP_BDGET_FLAG (1 << 9)
|
||||
|
||||
#define DM_SKIP_LOCKFS_FLAG (1 << 10)
|
||||
|
||||
#define DM_NOFLUSH_FLAG (1 << 11)
|
||||
|
||||
#endif
|
48
libc/kernel/common/linux/dma-mapping.h
Normal file
48
libc/kernel/common/linux/dma-mapping.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _ASM_LINUX_DMA_MAPPING_H
|
||||
#define _ASM_LINUX_DMA_MAPPING_H
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/err.h>
|
||||
|
||||
enum dma_data_direction {
|
||||
DMA_BIDIRECTIONAL = 0,
|
||||
DMA_TO_DEVICE = 1,
|
||||
DMA_FROM_DEVICE = 2,
|
||||
DMA_NONE = 3,
|
||||
};
|
||||
|
||||
#define DMA_64BIT_MASK 0xffffffffffffffffULL
|
||||
#define DMA_48BIT_MASK 0x0000ffffffffffffULL
|
||||
#define DMA_40BIT_MASK 0x000000ffffffffffULL
|
||||
#define DMA_39BIT_MASK 0x0000007fffffffffULL
|
||||
#define DMA_32BIT_MASK 0x00000000ffffffffULL
|
||||
#define DMA_31BIT_MASK 0x000000007fffffffULL
|
||||
#define DMA_30BIT_MASK 0x000000003fffffffULL
|
||||
#define DMA_29BIT_MASK 0x000000001fffffffULL
|
||||
#define DMA_28BIT_MASK 0x000000000fffffffULL
|
||||
#define DMA_24BIT_MASK 0x0000000000ffffffULL
|
||||
|
||||
#include <asm/dma-mapping.h>
|
||||
|
||||
#define dma_sync_single dma_sync_single_for_cpu
|
||||
#define dma_sync_sg dma_sync_sg_for_cpu
|
||||
|
||||
#define DMA_MEMORY_MAP 0x01
|
||||
#define DMA_MEMORY_IO 0x02
|
||||
#define DMA_MEMORY_INCLUDES_CHILDREN 0x04
|
||||
#define DMA_MEMORY_EXCLUSIVE 0x08
|
||||
|
||||
#ifndef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
|
||||
#endif
|
||||
#endif
|
15
libc/kernel/common/linux/dmaengine.h
Normal file
15
libc/kernel/common/linux/dmaengine.h
Normal file
@@ -0,0 +1,15 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef DMAENGINE_H
|
||||
#define DMAENGINE_H
|
||||
|
||||
#endif
|
45
libc/kernel/common/linux/efs_dir.h
Normal file
45
libc/kernel/common/linux/efs_dir.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __EFS_DIR_H__
|
||||
#define __EFS_DIR_H__
|
||||
|
||||
#define EFS_DIRBSIZE_BITS EFS_BLOCKSIZE_BITS
|
||||
#define EFS_DIRBSIZE (1 << EFS_DIRBSIZE_BITS)
|
||||
|
||||
struct efs_dentry {
|
||||
__be32 inode;
|
||||
unsigned char namelen;
|
||||
char name[3];
|
||||
};
|
||||
|
||||
#define EFS_DENTSIZE (sizeof(struct efs_dentry) - 3 + 1)
|
||||
#define EFS_MAXNAMELEN ((1 << (sizeof(char) * 8)) - 1)
|
||||
|
||||
#define EFS_DIRBLK_HEADERSIZE 4
|
||||
#define EFS_DIRBLK_MAGIC 0xbeef
|
||||
|
||||
struct efs_dir {
|
||||
__be16 magic;
|
||||
unsigned char firstused;
|
||||
unsigned char slots;
|
||||
|
||||
unsigned char space[EFS_DIRBSIZE - EFS_DIRBLK_HEADERSIZE];
|
||||
};
|
||||
|
||||
#define EFS_MAXENTS ((EFS_DIRBSIZE - EFS_DIRBLK_HEADERSIZE) / (EFS_DENTSIZE + sizeof(char)))
|
||||
|
||||
#define EFS_SLOTAT(dir, slot) EFS_REALOFF((dir)->space[slot])
|
||||
|
||||
#define EFS_REALOFF(offset) ((offset << 1))
|
||||
|
||||
#endif
|
||||
|
63
libc/kernel/common/linux/efs_fs_i.h
Normal file
63
libc/kernel/common/linux/efs_fs_i.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __EFS_FS_I_H__
|
||||
#define __EFS_FS_I_H__
|
||||
|
||||
typedef int32_t efs_block_t;
|
||||
typedef uint32_t efs_ino_t;
|
||||
|
||||
#define EFS_DIRECTEXTENTS 12
|
||||
|
||||
typedef union extent_u {
|
||||
unsigned char raw[8];
|
||||
struct extent_s {
|
||||
unsigned int ex_magic:8;
|
||||
unsigned int ex_bn:24;
|
||||
unsigned int ex_length:8;
|
||||
unsigned int ex_offset:24;
|
||||
} cooked;
|
||||
} efs_extent;
|
||||
|
||||
typedef struct edevs {
|
||||
__be16 odev;
|
||||
__be32 ndev;
|
||||
} efs_devs;
|
||||
|
||||
struct efs_dinode {
|
||||
__be16 di_mode;
|
||||
__be16 di_nlink;
|
||||
__be16 di_uid;
|
||||
__be16 di_gid;
|
||||
__be32 di_size;
|
||||
__be32 di_atime;
|
||||
__be32 di_mtime;
|
||||
__be32 di_ctime;
|
||||
__be32 di_gen;
|
||||
__be16 di_numextents;
|
||||
u_char di_version;
|
||||
u_char di_spare;
|
||||
union di_addr {
|
||||
efs_extent di_extents[EFS_DIRECTEXTENTS];
|
||||
efs_devs di_dev;
|
||||
} di_u;
|
||||
};
|
||||
|
||||
struct efs_inode_info {
|
||||
int numextents;
|
||||
int lastextent;
|
||||
|
||||
efs_extent extents[EFS_DIRECTEXTENTS];
|
||||
struct inode vfs_inode;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
61
libc/kernel/common/linux/efs_fs_sb.h
Normal file
61
libc/kernel/common/linux/efs_fs_sb.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __EFS_FS_SB_H__
|
||||
#define __EFS_FS_SB_H__
|
||||
|
||||
#define EFS_SUPER_MAGIC 0x414A53
|
||||
|
||||
#define EFS_MAGIC 0x072959
|
||||
#define EFS_NEWMAGIC 0x07295a
|
||||
|
||||
#define IS_EFS_MAGIC(x) ((x == EFS_MAGIC) || (x == EFS_NEWMAGIC))
|
||||
|
||||
#define EFS_SUPER 1
|
||||
#define EFS_ROOTINODE 2
|
||||
|
||||
struct efs_super {
|
||||
__be32 fs_size;
|
||||
__be32 fs_firstcg;
|
||||
__be32 fs_cgfsize;
|
||||
__be16 fs_cgisize;
|
||||
__be16 fs_sectors;
|
||||
__be16 fs_heads;
|
||||
__be16 fs_ncg;
|
||||
__be16 fs_dirty;
|
||||
__be32 fs_time;
|
||||
__be32 fs_magic;
|
||||
char fs_fname[6];
|
||||
char fs_fpack[6];
|
||||
__be32 fs_bmsize;
|
||||
__be32 fs_tfree;
|
||||
__be32 fs_tinode;
|
||||
__be32 fs_bmblock;
|
||||
__be32 fs_replsb;
|
||||
__be32 fs_lastialloc;
|
||||
char fs_spare[20];
|
||||
__be32 fs_checksum;
|
||||
};
|
||||
|
||||
struct efs_sb_info {
|
||||
__u32 fs_magic;
|
||||
__u32 fs_start;
|
||||
__u32 first_block;
|
||||
__u32 total_blocks;
|
||||
__u32 group_size;
|
||||
__u32 data_free;
|
||||
__u32 inode_free;
|
||||
__u16 inode_blocks;
|
||||
__u16 total_groups;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
109
libc/kernel/common/linux/elevator.h
Normal file
109
libc/kernel/common/linux/elevator.h
Normal file
@@ -0,0 +1,109 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ELEVATOR_H
|
||||
#define _LINUX_ELEVATOR_H
|
||||
|
||||
typedef int (elevator_merge_fn) (request_queue_t *, struct request **,
|
||||
struct bio *);
|
||||
|
||||
typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *);
|
||||
|
||||
typedef void (elevator_merged_fn) (request_queue_t *, struct request *);
|
||||
|
||||
typedef int (elevator_dispatch_fn) (request_queue_t *, int);
|
||||
|
||||
typedef void (elevator_add_req_fn) (request_queue_t *, struct request *);
|
||||
typedef int (elevator_queue_empty_fn) (request_queue_t *);
|
||||
typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *);
|
||||
typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *);
|
||||
typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *);
|
||||
|
||||
typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, gfp_t);
|
||||
typedef void (elevator_put_req_fn) (request_queue_t *, struct request *);
|
||||
typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *);
|
||||
typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *);
|
||||
|
||||
typedef void *(elevator_init_fn) (request_queue_t *, elevator_t *);
|
||||
typedef void (elevator_exit_fn) (elevator_t *);
|
||||
|
||||
struct elevator_ops
|
||||
{
|
||||
elevator_merge_fn *elevator_merge_fn;
|
||||
elevator_merged_fn *elevator_merged_fn;
|
||||
elevator_merge_req_fn *elevator_merge_req_fn;
|
||||
|
||||
elevator_dispatch_fn *elevator_dispatch_fn;
|
||||
elevator_add_req_fn *elevator_add_req_fn;
|
||||
elevator_activate_req_fn *elevator_activate_req_fn;
|
||||
elevator_deactivate_req_fn *elevator_deactivate_req_fn;
|
||||
|
||||
elevator_queue_empty_fn *elevator_queue_empty_fn;
|
||||
elevator_completed_req_fn *elevator_completed_req_fn;
|
||||
|
||||
elevator_request_list_fn *elevator_former_req_fn;
|
||||
elevator_request_list_fn *elevator_latter_req_fn;
|
||||
|
||||
elevator_set_req_fn *elevator_set_req_fn;
|
||||
elevator_put_req_fn *elevator_put_req_fn;
|
||||
|
||||
elevator_may_queue_fn *elevator_may_queue_fn;
|
||||
|
||||
elevator_init_fn *elevator_init_fn;
|
||||
elevator_exit_fn *elevator_exit_fn;
|
||||
void (*trim)(struct io_context *);
|
||||
};
|
||||
|
||||
#define ELV_NAME_MAX (16)
|
||||
|
||||
struct elv_fs_entry {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(elevator_t *, char *);
|
||||
ssize_t (*store)(elevator_t *, const char *, size_t);
|
||||
};
|
||||
|
||||
struct elevator_type
|
||||
{
|
||||
struct list_head list;
|
||||
struct elevator_ops ops;
|
||||
struct elevator_type *elevator_type;
|
||||
struct elv_fs_entry *elevator_attrs;
|
||||
char elevator_name[ELV_NAME_MAX];
|
||||
struct module *elevator_owner;
|
||||
};
|
||||
|
||||
struct elevator_queue
|
||||
{
|
||||
struct elevator_ops *ops;
|
||||
void *elevator_data;
|
||||
struct kobject kobj;
|
||||
struct elevator_type *elevator_type;
|
||||
struct mutex sysfs_lock;
|
||||
};
|
||||
|
||||
#define ELEVATOR_NO_MERGE 0
|
||||
#define ELEVATOR_FRONT_MERGE 1
|
||||
#define ELEVATOR_BACK_MERGE 2
|
||||
|
||||
#define ELEVATOR_INSERT_FRONT 1
|
||||
#define ELEVATOR_INSERT_BACK 2
|
||||
#define ELEVATOR_INSERT_SORT 3
|
||||
#define ELEVATOR_INSERT_REQUEUE 4
|
||||
|
||||
enum {
|
||||
ELV_MQUEUE_MAY,
|
||||
ELV_MQUEUE_NO,
|
||||
ELV_MQUEUE_MUST,
|
||||
};
|
||||
|
||||
#define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors)
|
||||
|
||||
#endif
|
51
libc/kernel/common/linux/elf-em.h
Normal file
51
libc/kernel/common/linux/elf-em.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ELF_EM_H
|
||||
#define _LINUX_ELF_EM_H
|
||||
|
||||
#define EM_NONE 0
|
||||
#define EM_M32 1
|
||||
#define EM_SPARC 2
|
||||
#define EM_386 3
|
||||
#define EM_68K 4
|
||||
#define EM_88K 5
|
||||
#define EM_486 6
|
||||
#define EM_860 7
|
||||
#define EM_MIPS 8
|
||||
|
||||
#define EM_MIPS_RS3_LE 10
|
||||
#define EM_MIPS_RS4_BE 10
|
||||
|
||||
#define EM_PARISC 15
|
||||
#define EM_SPARC32PLUS 18
|
||||
#define EM_PPC 20
|
||||
#define EM_PPC64 21
|
||||
#define EM_SH 42
|
||||
#define EM_SPARCV9 43
|
||||
#define EM_IA_64 50
|
||||
#define EM_X86_64 62
|
||||
#define EM_S390 22
|
||||
#define EM_CRIS 76
|
||||
#define EM_V850 87
|
||||
#define EM_M32R 88
|
||||
#define EM_H8_300 46
|
||||
#define EM_FRV 0x5441
|
||||
|
||||
#define EM_ALPHA 0x9026
|
||||
|
||||
#define EM_CYGNUS_V850 0x9080
|
||||
|
||||
#define EM_CYGNUS_M32R 0x9041
|
||||
|
||||
#define EM_S390_OLD 0xA390
|
||||
|
||||
#endif
|
361
libc/kernel/common/linux/elf.h
Normal file
361
libc/kernel/common/linux/elf.h
Normal file
@@ -0,0 +1,361 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ELF_H
|
||||
#define _LINUX_ELF_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/auxvec.h>
|
||||
#include <linux/elf-em.h>
|
||||
#include <asm/elf.h>
|
||||
|
||||
#ifndef elf_read_implies_exec
|
||||
|
||||
#define elf_read_implies_exec(ex, have_pt_gnu_stack) 0
|
||||
#endif
|
||||
|
||||
typedef __u32 Elf32_Addr;
|
||||
typedef __u16 Elf32_Half;
|
||||
typedef __u32 Elf32_Off;
|
||||
typedef __s32 Elf32_Sword;
|
||||
typedef __u32 Elf32_Word;
|
||||
|
||||
typedef __u64 Elf64_Addr;
|
||||
typedef __u16 Elf64_Half;
|
||||
typedef __s16 Elf64_SHalf;
|
||||
typedef __u64 Elf64_Off;
|
||||
typedef __s32 Elf64_Sword;
|
||||
typedef __u32 Elf64_Word;
|
||||
typedef __u64 Elf64_Xword;
|
||||
typedef __s64 Elf64_Sxword;
|
||||
|
||||
#define PT_NULL 0
|
||||
#define PT_LOAD 1
|
||||
#define PT_DYNAMIC 2
|
||||
#define PT_INTERP 3
|
||||
#define PT_NOTE 4
|
||||
#define PT_SHLIB 5
|
||||
#define PT_PHDR 6
|
||||
#define PT_TLS 7
|
||||
#define PT_LOOS 0x60000000
|
||||
#define PT_HIOS 0x6fffffff
|
||||
#define PT_LOPROC 0x70000000
|
||||
#define PT_HIPROC 0x7fffffff
|
||||
#define PT_GNU_EH_FRAME 0x6474e550
|
||||
|
||||
#define PT_GNU_STACK (PT_LOOS + 0x474e551)
|
||||
|
||||
#define ET_NONE 0
|
||||
#define ET_REL 1
|
||||
#define ET_EXEC 2
|
||||
#define ET_DYN 3
|
||||
#define ET_CORE 4
|
||||
#define ET_LOPROC 0xff00
|
||||
#define ET_HIPROC 0xffff
|
||||
|
||||
#define DT_NULL 0
|
||||
#define DT_NEEDED 1
|
||||
#define DT_PLTRELSZ 2
|
||||
#define DT_PLTGOT 3
|
||||
#define DT_HASH 4
|
||||
#define DT_STRTAB 5
|
||||
#define DT_SYMTAB 6
|
||||
#define DT_RELA 7
|
||||
#define DT_RELASZ 8
|
||||
#define DT_RELAENT 9
|
||||
#define DT_STRSZ 10
|
||||
#define DT_SYMENT 11
|
||||
#define DT_INIT 12
|
||||
#define DT_FINI 13
|
||||
#define DT_SONAME 14
|
||||
#define DT_RPATH 15
|
||||
#define DT_SYMBOLIC 16
|
||||
#define DT_REL 17
|
||||
#define DT_RELSZ 18
|
||||
#define DT_RELENT 19
|
||||
#define DT_PLTREL 20
|
||||
#define DT_DEBUG 21
|
||||
#define DT_TEXTREL 22
|
||||
#define DT_JMPREL 23
|
||||
#define DT_LOPROC 0x70000000
|
||||
#define DT_HIPROC 0x7fffffff
|
||||
|
||||
#define STB_LOCAL 0
|
||||
#define STB_GLOBAL 1
|
||||
#define STB_WEAK 2
|
||||
|
||||
#define STT_NOTYPE 0
|
||||
#define STT_OBJECT 1
|
||||
#define STT_FUNC 2
|
||||
#define STT_SECTION 3
|
||||
#define STT_FILE 4
|
||||
#define STT_COMMON 5
|
||||
#define STT_TLS 6
|
||||
|
||||
#define ELF_ST_BIND(x) ((x) >> 4)
|
||||
#define ELF_ST_TYPE(x) (((unsigned int) x) & 0xf)
|
||||
#define ELF32_ST_BIND(x) ELF_ST_BIND(x)
|
||||
#define ELF32_ST_TYPE(x) ELF_ST_TYPE(x)
|
||||
#define ELF64_ST_BIND(x) ELF_ST_BIND(x)
|
||||
#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
|
||||
|
||||
typedef struct dynamic{
|
||||
Elf32_Sword d_tag;
|
||||
union{
|
||||
Elf32_Sword d_val;
|
||||
Elf32_Addr d_ptr;
|
||||
} d_un;
|
||||
} Elf32_Dyn;
|
||||
|
||||
typedef struct {
|
||||
Elf64_Sxword d_tag;
|
||||
union {
|
||||
Elf64_Xword d_val;
|
||||
Elf64_Addr d_ptr;
|
||||
} d_un;
|
||||
} Elf64_Dyn;
|
||||
|
||||
#define ELF32_R_SYM(x) ((x) >> 8)
|
||||
#define ELF32_R_TYPE(x) ((x) & 0xff)
|
||||
|
||||
#define ELF64_R_SYM(i) ((i) >> 32)
|
||||
#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
|
||||
|
||||
typedef struct elf32_rel {
|
||||
Elf32_Addr r_offset;
|
||||
Elf32_Word r_info;
|
||||
} Elf32_Rel;
|
||||
|
||||
typedef struct elf64_rel {
|
||||
Elf64_Addr r_offset;
|
||||
Elf64_Xword r_info;
|
||||
} Elf64_Rel;
|
||||
|
||||
typedef struct elf32_rela{
|
||||
Elf32_Addr r_offset;
|
||||
Elf32_Word r_info;
|
||||
Elf32_Sword r_addend;
|
||||
} Elf32_Rela;
|
||||
|
||||
typedef struct elf64_rela {
|
||||
Elf64_Addr r_offset;
|
||||
Elf64_Xword r_info;
|
||||
Elf64_Sxword r_addend;
|
||||
} Elf64_Rela;
|
||||
|
||||
typedef struct elf32_sym{
|
||||
Elf32_Word st_name;
|
||||
Elf32_Addr st_value;
|
||||
Elf32_Word st_size;
|
||||
unsigned char st_info;
|
||||
unsigned char st_other;
|
||||
Elf32_Half st_shndx;
|
||||
} Elf32_Sym;
|
||||
|
||||
typedef struct elf64_sym {
|
||||
Elf64_Word st_name;
|
||||
unsigned char st_info;
|
||||
unsigned char st_other;
|
||||
Elf64_Half st_shndx;
|
||||
Elf64_Addr st_value;
|
||||
Elf64_Xword st_size;
|
||||
} Elf64_Sym;
|
||||
|
||||
#define EI_NIDENT 16
|
||||
|
||||
typedef struct elf32_hdr{
|
||||
unsigned char e_ident[EI_NIDENT];
|
||||
Elf32_Half e_type;
|
||||
Elf32_Half e_machine;
|
||||
Elf32_Word e_version;
|
||||
Elf32_Addr e_entry;
|
||||
Elf32_Off e_phoff;
|
||||
Elf32_Off e_shoff;
|
||||
Elf32_Word e_flags;
|
||||
Elf32_Half e_ehsize;
|
||||
Elf32_Half e_phentsize;
|
||||
Elf32_Half e_phnum;
|
||||
Elf32_Half e_shentsize;
|
||||
Elf32_Half e_shnum;
|
||||
Elf32_Half e_shstrndx;
|
||||
} Elf32_Ehdr;
|
||||
|
||||
typedef struct elf64_hdr {
|
||||
unsigned char e_ident[16];
|
||||
Elf64_Half e_type;
|
||||
Elf64_Half e_machine;
|
||||
Elf64_Word e_version;
|
||||
Elf64_Addr e_entry;
|
||||
Elf64_Off e_phoff;
|
||||
Elf64_Off e_shoff;
|
||||
Elf64_Word e_flags;
|
||||
Elf64_Half e_ehsize;
|
||||
Elf64_Half e_phentsize;
|
||||
Elf64_Half e_phnum;
|
||||
Elf64_Half e_shentsize;
|
||||
Elf64_Half e_shnum;
|
||||
Elf64_Half e_shstrndx;
|
||||
} Elf64_Ehdr;
|
||||
|
||||
#define PF_R 0x4
|
||||
#define PF_W 0x2
|
||||
#define PF_X 0x1
|
||||
|
||||
typedef struct elf32_phdr{
|
||||
Elf32_Word p_type;
|
||||
Elf32_Off p_offset;
|
||||
Elf32_Addr p_vaddr;
|
||||
Elf32_Addr p_paddr;
|
||||
Elf32_Word p_filesz;
|
||||
Elf32_Word p_memsz;
|
||||
Elf32_Word p_flags;
|
||||
Elf32_Word p_align;
|
||||
} Elf32_Phdr;
|
||||
|
||||
typedef struct elf64_phdr {
|
||||
Elf64_Word p_type;
|
||||
Elf64_Word p_flags;
|
||||
Elf64_Off p_offset;
|
||||
Elf64_Addr p_vaddr;
|
||||
Elf64_Addr p_paddr;
|
||||
Elf64_Xword p_filesz;
|
||||
Elf64_Xword p_memsz;
|
||||
Elf64_Xword p_align;
|
||||
} Elf64_Phdr;
|
||||
|
||||
#define SHT_NULL 0
|
||||
#define SHT_PROGBITS 1
|
||||
#define SHT_SYMTAB 2
|
||||
#define SHT_STRTAB 3
|
||||
#define SHT_RELA 4
|
||||
#define SHT_HASH 5
|
||||
#define SHT_DYNAMIC 6
|
||||
#define SHT_NOTE 7
|
||||
#define SHT_NOBITS 8
|
||||
#define SHT_REL 9
|
||||
#define SHT_SHLIB 10
|
||||
#define SHT_DYNSYM 11
|
||||
#define SHT_NUM 12
|
||||
#define SHT_LOPROC 0x70000000
|
||||
#define SHT_HIPROC 0x7fffffff
|
||||
#define SHT_LOUSER 0x80000000
|
||||
#define SHT_HIUSER 0xffffffff
|
||||
|
||||
#define SHF_WRITE 0x1
|
||||
#define SHF_ALLOC 0x2
|
||||
#define SHF_EXECINSTR 0x4
|
||||
#define SHF_MASKPROC 0xf0000000
|
||||
|
||||
#define SHN_UNDEF 0
|
||||
#define SHN_LORESERVE 0xff00
|
||||
#define SHN_LOPROC 0xff00
|
||||
#define SHN_HIPROC 0xff1f
|
||||
#define SHN_ABS 0xfff1
|
||||
#define SHN_COMMON 0xfff2
|
||||
#define SHN_HIRESERVE 0xffff
|
||||
|
||||
typedef struct {
|
||||
Elf32_Word sh_name;
|
||||
Elf32_Word sh_type;
|
||||
Elf32_Word sh_flags;
|
||||
Elf32_Addr sh_addr;
|
||||
Elf32_Off sh_offset;
|
||||
Elf32_Word sh_size;
|
||||
Elf32_Word sh_link;
|
||||
Elf32_Word sh_info;
|
||||
Elf32_Word sh_addralign;
|
||||
Elf32_Word sh_entsize;
|
||||
} Elf32_Shdr;
|
||||
|
||||
typedef struct elf64_shdr {
|
||||
Elf64_Word sh_name;
|
||||
Elf64_Word sh_type;
|
||||
Elf64_Xword sh_flags;
|
||||
Elf64_Addr sh_addr;
|
||||
Elf64_Off sh_offset;
|
||||
Elf64_Xword sh_size;
|
||||
Elf64_Word sh_link;
|
||||
Elf64_Word sh_info;
|
||||
Elf64_Xword sh_addralign;
|
||||
Elf64_Xword sh_entsize;
|
||||
} Elf64_Shdr;
|
||||
|
||||
#define EI_MAG0 0
|
||||
#define EI_MAG1 1
|
||||
#define EI_MAG2 2
|
||||
#define EI_MAG3 3
|
||||
#define EI_CLASS 4
|
||||
#define EI_DATA 5
|
||||
#define EI_VERSION 6
|
||||
#define EI_OSABI 7
|
||||
#define EI_PAD 8
|
||||
|
||||
#define ELFMAG0 0x7f
|
||||
#define ELFMAG1 'E'
|
||||
#define ELFMAG2 'L'
|
||||
#define ELFMAG3 'F'
|
||||
#define ELFMAG "\177ELF"
|
||||
#define SELFMAG 4
|
||||
|
||||
#define ELFCLASSNONE 0
|
||||
#define ELFCLASS32 1
|
||||
#define ELFCLASS64 2
|
||||
#define ELFCLASSNUM 3
|
||||
|
||||
#define ELFDATANONE 0
|
||||
#define ELFDATA2LSB 1
|
||||
#define ELFDATA2MSB 2
|
||||
|
||||
#define EV_NONE 0
|
||||
#define EV_CURRENT 1
|
||||
#define EV_NUM 2
|
||||
|
||||
#define ELFOSABI_NONE 0
|
||||
#define ELFOSABI_LINUX 3
|
||||
|
||||
#ifndef ELF_OSABI
|
||||
#define ELF_OSABI ELFOSABI_NONE
|
||||
#endif
|
||||
|
||||
#define NT_PRSTATUS 1
|
||||
#define NT_PRFPREG 2
|
||||
#define NT_PRPSINFO 3
|
||||
#define NT_TASKSTRUCT 4
|
||||
#define NT_AUXV 6
|
||||
#define NT_PRXFPREG 0x46e62b7f
|
||||
|
||||
typedef struct elf32_note {
|
||||
Elf32_Word n_namesz;
|
||||
Elf32_Word n_descsz;
|
||||
Elf32_Word n_type;
|
||||
} Elf32_Nhdr;
|
||||
|
||||
typedef struct elf64_note {
|
||||
Elf64_Word n_namesz;
|
||||
Elf64_Word n_descsz;
|
||||
Elf64_Word n_type;
|
||||
} Elf64_Nhdr;
|
||||
|
||||
#if ELF_CLASS == ELFCLASS32
|
||||
|
||||
#define elfhdr elf32_hdr
|
||||
#define elf_phdr elf32_phdr
|
||||
#define elf_note elf32_note
|
||||
|
||||
#else
|
||||
|
||||
#define elfhdr elf64_hdr
|
||||
#define elf_phdr elf64_phdr
|
||||
#define elf_note elf64_note
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
23
libc/kernel/common/linux/err.h
Normal file
23
libc/kernel/common/linux/err.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ERR_H
|
||||
#define _LINUX_ERR_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#include <asm/errno.h>
|
||||
|
||||
#define MAX_ERRNO 4095
|
||||
|
||||
#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
|
||||
|
||||
#endif
|
17
libc/kernel/common/linux/errno.h
Normal file
17
libc/kernel/common/linux/errno.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ERRNO_H
|
||||
#define _LINUX_ERRNO_H
|
||||
|
||||
#include <asm/errno.h>
|
||||
|
||||
#endif
|
33
libc/kernel/common/linux/errqueue.h
Normal file
33
libc/kernel/common/linux/errqueue.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ERRQUEUE_H
|
||||
#define _LINUX_ERRQUEUE_H 1
|
||||
|
||||
struct sock_extended_err
|
||||
{
|
||||
__u32 ee_errno;
|
||||
__u8 ee_origin;
|
||||
__u8 ee_type;
|
||||
__u8 ee_code;
|
||||
__u8 ee_pad;
|
||||
__u32 ee_info;
|
||||
__u32 ee_data;
|
||||
};
|
||||
|
||||
#define SO_EE_ORIGIN_NONE 0
|
||||
#define SO_EE_ORIGIN_LOCAL 1
|
||||
#define SO_EE_ORIGIN_ICMP 2
|
||||
#define SO_EE_ORIGIN_ICMP6 3
|
||||
|
||||
#define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1))
|
||||
|
||||
#endif
|
19
libc/kernel/common/linux/etherdevice.h
Normal file
19
libc/kernel/common/linux/etherdevice.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ETHERDEVICE_H
|
||||
#define _LINUX_ETHERDEVICE_H
|
||||
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/random.h>
|
||||
|
||||
#endif
|
378
libc/kernel/common/linux/ext2_fs.h
Normal file
378
libc/kernel/common/linux/ext2_fs.h
Normal file
@@ -0,0 +1,378 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_EXT2_FS_H
|
||||
#define _LINUX_EXT2_FS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#undef EXT2FS_DEBUG
|
||||
|
||||
#define EXT2_PREALLOCATE
|
||||
#define EXT2_DEFAULT_PREALLOC_BLOCKS 8
|
||||
|
||||
#define EXT2FS_DATE "95/08/09"
|
||||
#define EXT2FS_VERSION "0.5b"
|
||||
|
||||
#ifdef EXT2FS_DEBUG
|
||||
#define ext2_debug(f, a...) { printk ("EXT2-fs DEBUG (%s, %d): %s:", __FILE__, __LINE__, __FUNCTION__); printk (f, ## a); }
|
||||
#else
|
||||
#define ext2_debug(f, a...)
|
||||
#endif
|
||||
|
||||
#define EXT2_BAD_INO 1
|
||||
#define EXT2_ROOT_INO 2
|
||||
#define EXT2_BOOT_LOADER_INO 5
|
||||
#define EXT2_UNDEL_DIR_INO 6
|
||||
|
||||
#define EXT2_GOOD_OLD_FIRST_INO 11
|
||||
|
||||
#define EXT2_SUPER_MAGIC 0xEF53
|
||||
|
||||
#define EXT2_SB(sb) (sb)
|
||||
|
||||
#define EXT2_LINK_MAX 32000
|
||||
|
||||
#define EXT2_MIN_BLOCK_SIZE 1024
|
||||
#define EXT2_MAX_BLOCK_SIZE 4096
|
||||
#define EXT2_MIN_BLOCK_LOG_SIZE 10
|
||||
#define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size)
|
||||
#define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32))
|
||||
#define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
|
||||
#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? EXT2_GOOD_OLD_INODE_SIZE : (s)->s_inode_size)
|
||||
#define EXT2_FIRST_INO(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? EXT2_GOOD_OLD_FIRST_INO : (s)->s_first_ino)
|
||||
|
||||
#define EXT2_MIN_FRAG_SIZE 1024
|
||||
#define EXT2_MAX_FRAG_SIZE 4096
|
||||
#define EXT2_MIN_FRAG_LOG_SIZE 10
|
||||
#define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size)
|
||||
#define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s))
|
||||
|
||||
struct ext2_group_desc
|
||||
{
|
||||
__le32 bg_block_bitmap;
|
||||
__le32 bg_inode_bitmap;
|
||||
__le32 bg_inode_table;
|
||||
__le16 bg_free_blocks_count;
|
||||
__le16 bg_free_inodes_count;
|
||||
__le16 bg_used_dirs_count;
|
||||
__le16 bg_pad;
|
||||
__le32 bg_reserved[3];
|
||||
};
|
||||
|
||||
#define EXT2_BLOCKS_PER_GROUP(s) ((s)->s_blocks_per_group)
|
||||
#define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc))
|
||||
#define EXT2_INODES_PER_GROUP(s) ((s)->s_inodes_per_group)
|
||||
|
||||
#define EXT2_NDIR_BLOCKS 12
|
||||
#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS
|
||||
#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1)
|
||||
#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1)
|
||||
#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1)
|
||||
|
||||
#define EXT2_SECRM_FL 0x00000001
|
||||
#define EXT2_UNRM_FL 0x00000002
|
||||
#define EXT2_COMPR_FL 0x00000004
|
||||
#define EXT2_SYNC_FL 0x00000008
|
||||
#define EXT2_IMMUTABLE_FL 0x00000010
|
||||
#define EXT2_APPEND_FL 0x00000020
|
||||
#define EXT2_NODUMP_FL 0x00000040
|
||||
#define EXT2_NOATIME_FL 0x00000080
|
||||
|
||||
#define EXT2_DIRTY_FL 0x00000100
|
||||
#define EXT2_COMPRBLK_FL 0x00000200
|
||||
#define EXT2_NOCOMP_FL 0x00000400
|
||||
#define EXT2_ECOMPR_FL 0x00000800
|
||||
|
||||
#define EXT2_BTREE_FL 0x00001000
|
||||
#define EXT2_INDEX_FL 0x00001000
|
||||
#define EXT2_IMAGIC_FL 0x00002000
|
||||
#define EXT2_JOURNAL_DATA_FL 0x00004000
|
||||
#define EXT2_NOTAIL_FL 0x00008000
|
||||
#define EXT2_DIRSYNC_FL 0x00010000
|
||||
#define EXT2_TOPDIR_FL 0x00020000
|
||||
#define EXT2_RESERVED_FL 0x80000000
|
||||
|
||||
#define EXT2_FL_USER_VISIBLE 0x0003DFFF
|
||||
#define EXT2_FL_USER_MODIFIABLE 0x000380FF
|
||||
|
||||
#define EXT2_IOC_GETFLAGS _IOR('f', 1, long)
|
||||
#define EXT2_IOC_SETFLAGS _IOW('f', 2, long)
|
||||
#define EXT2_IOC_GETVERSION _IOR('v', 1, long)
|
||||
#define EXT2_IOC_SETVERSION _IOW('v', 2, long)
|
||||
|
||||
struct ext2_inode {
|
||||
__le16 i_mode;
|
||||
__le16 i_uid;
|
||||
__le32 i_size;
|
||||
__le32 i_atime;
|
||||
__le32 i_ctime;
|
||||
__le32 i_mtime;
|
||||
__le32 i_dtime;
|
||||
__le16 i_gid;
|
||||
__le16 i_links_count;
|
||||
__le32 i_blocks;
|
||||
__le32 i_flags;
|
||||
union {
|
||||
struct {
|
||||
__le32 l_i_reserved1;
|
||||
} linux1;
|
||||
struct {
|
||||
__le32 h_i_translator;
|
||||
} hurd1;
|
||||
struct {
|
||||
__le32 m_i_reserved1;
|
||||
} masix1;
|
||||
} osd1;
|
||||
__le32 i_block[EXT2_N_BLOCKS];
|
||||
__le32 i_generation;
|
||||
__le32 i_file_acl;
|
||||
__le32 i_dir_acl;
|
||||
__le32 i_faddr;
|
||||
union {
|
||||
struct {
|
||||
__u8 l_i_frag;
|
||||
__u8 l_i_fsize;
|
||||
__u16 i_pad1;
|
||||
__le16 l_i_uid_high;
|
||||
__le16 l_i_gid_high;
|
||||
__u32 l_i_reserved2;
|
||||
} linux2;
|
||||
struct {
|
||||
__u8 h_i_frag;
|
||||
__u8 h_i_fsize;
|
||||
__le16 h_i_mode_high;
|
||||
__le16 h_i_uid_high;
|
||||
__le16 h_i_gid_high;
|
||||
__le32 h_i_author;
|
||||
} hurd2;
|
||||
struct {
|
||||
__u8 m_i_frag;
|
||||
__u8 m_i_fsize;
|
||||
__u16 m_pad1;
|
||||
__u32 m_i_reserved2[2];
|
||||
} masix2;
|
||||
} osd2;
|
||||
};
|
||||
|
||||
#define i_size_high i_dir_acl
|
||||
|
||||
#ifdef __linux__
|
||||
#define i_reserved1 osd1.linux1.l_i_reserved1
|
||||
#define i_frag osd2.linux2.l_i_frag
|
||||
#define i_fsize osd2.linux2.l_i_fsize
|
||||
#define i_uid_low i_uid
|
||||
#define i_gid_low i_gid
|
||||
#define i_uid_high osd2.linux2.l_i_uid_high
|
||||
#define i_gid_high osd2.linux2.l_i_gid_high
|
||||
#define i_reserved2 osd2.linux2.l_i_reserved2
|
||||
#endif
|
||||
|
||||
#ifdef __hurd__
|
||||
#define i_translator osd1.hurd1.h_i_translator
|
||||
#define i_frag osd2.hurd2.h_i_frag;
|
||||
#define i_fsize osd2.hurd2.h_i_fsize;
|
||||
#define i_uid_high osd2.hurd2.h_i_uid_high
|
||||
#define i_gid_high osd2.hurd2.h_i_gid_high
|
||||
#define i_author osd2.hurd2.h_i_author
|
||||
#endif
|
||||
|
||||
#ifdef __masix__
|
||||
#define i_reserved1 osd1.masix1.m_i_reserved1
|
||||
#define i_frag osd2.masix2.m_i_frag
|
||||
#define i_fsize osd2.masix2.m_i_fsize
|
||||
#define i_reserved2 osd2.masix2.m_i_reserved2
|
||||
#endif
|
||||
|
||||
#define EXT2_VALID_FS 0x0001
|
||||
#define EXT2_ERROR_FS 0x0002
|
||||
|
||||
#define EXT2_MOUNT_CHECK 0x000001
|
||||
#define EXT2_MOUNT_OLDALLOC 0x000002
|
||||
#define EXT2_MOUNT_GRPID 0x000004
|
||||
#define EXT2_MOUNT_DEBUG 0x000008
|
||||
#define EXT2_MOUNT_ERRORS_CONT 0x000010
|
||||
#define EXT2_MOUNT_ERRORS_RO 0x000020
|
||||
#define EXT2_MOUNT_ERRORS_PANIC 0x000040
|
||||
#define EXT2_MOUNT_MINIX_DF 0x000080
|
||||
#define EXT2_MOUNT_NOBH 0x000100
|
||||
#define EXT2_MOUNT_NO_UID32 0x000200
|
||||
#define EXT2_MOUNT_XATTR_USER 0x004000
|
||||
#define EXT2_MOUNT_POSIX_ACL 0x008000
|
||||
#define EXT2_MOUNT_XIP 0x010000
|
||||
#define EXT2_MOUNT_USRQUOTA 0x020000
|
||||
#define EXT2_MOUNT_GRPQUOTA 0x040000
|
||||
|
||||
#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt
|
||||
#define set_opt(o, opt) o |= EXT2_MOUNT_##opt
|
||||
#define test_opt(sb, opt) (EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_##opt)
|
||||
|
||||
#define EXT2_DFL_MAX_MNT_COUNT 20
|
||||
#define EXT2_DFL_CHECKINTERVAL 0
|
||||
|
||||
#define EXT2_ERRORS_CONTINUE 1
|
||||
#define EXT2_ERRORS_RO 2
|
||||
#define EXT2_ERRORS_PANIC 3
|
||||
#define EXT2_ERRORS_DEFAULT EXT2_ERRORS_CONTINUE
|
||||
|
||||
struct ext2_super_block {
|
||||
__le32 s_inodes_count;
|
||||
__le32 s_blocks_count;
|
||||
__le32 s_r_blocks_count;
|
||||
__le32 s_free_blocks_count;
|
||||
__le32 s_free_inodes_count;
|
||||
__le32 s_first_data_block;
|
||||
__le32 s_log_block_size;
|
||||
__le32 s_log_frag_size;
|
||||
__le32 s_blocks_per_group;
|
||||
__le32 s_frags_per_group;
|
||||
__le32 s_inodes_per_group;
|
||||
__le32 s_mtime;
|
||||
__le32 s_wtime;
|
||||
__le16 s_mnt_count;
|
||||
__le16 s_max_mnt_count;
|
||||
__le16 s_magic;
|
||||
__le16 s_state;
|
||||
__le16 s_errors;
|
||||
__le16 s_minor_rev_level;
|
||||
__le32 s_lastcheck;
|
||||
__le32 s_checkinterval;
|
||||
__le32 s_creator_os;
|
||||
__le32 s_rev_level;
|
||||
__le16 s_def_resuid;
|
||||
__le16 s_def_resgid;
|
||||
|
||||
__le32 s_first_ino;
|
||||
__le16 s_inode_size;
|
||||
__le16 s_block_group_nr;
|
||||
__le32 s_feature_compat;
|
||||
__le32 s_feature_incompat;
|
||||
__le32 s_feature_ro_compat;
|
||||
__u8 s_uuid[16];
|
||||
char s_volume_name[16];
|
||||
char s_last_mounted[64];
|
||||
__le32 s_algorithm_usage_bitmap;
|
||||
|
||||
__u8 s_prealloc_blocks;
|
||||
__u8 s_prealloc_dir_blocks;
|
||||
__u16 s_padding1;
|
||||
|
||||
__u8 s_journal_uuid[16];
|
||||
__u32 s_journal_inum;
|
||||
__u32 s_journal_dev;
|
||||
__u32 s_last_orphan;
|
||||
__u32 s_hash_seed[4];
|
||||
__u8 s_def_hash_version;
|
||||
__u8 s_reserved_char_pad;
|
||||
__u16 s_reserved_word_pad;
|
||||
__le32 s_default_mount_opts;
|
||||
__le32 s_first_meta_bg;
|
||||
__u32 s_reserved[190];
|
||||
};
|
||||
|
||||
#define EXT2_OS_LINUX 0
|
||||
#define EXT2_OS_HURD 1
|
||||
#define EXT2_OS_MASIX 2
|
||||
#define EXT2_OS_FREEBSD 3
|
||||
#define EXT2_OS_LITES 4
|
||||
|
||||
#define EXT2_GOOD_OLD_REV 0
|
||||
#define EXT2_DYNAMIC_REV 1
|
||||
|
||||
#define EXT2_CURRENT_REV EXT2_GOOD_OLD_REV
|
||||
#define EXT2_MAX_SUPP_REV EXT2_DYNAMIC_REV
|
||||
|
||||
#define EXT2_GOOD_OLD_INODE_SIZE 128
|
||||
|
||||
#define EXT2_HAS_COMPAT_FEATURE(sb,mask) ( EXT2_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) )
|
||||
#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) ( EXT2_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) )
|
||||
#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) ( EXT2_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) )
|
||||
#define EXT2_SET_COMPAT_FEATURE(sb,mask) EXT2_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask)
|
||||
#define EXT2_SET_RO_COMPAT_FEATURE(sb,mask) EXT2_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask)
|
||||
#define EXT2_SET_INCOMPAT_FEATURE(sb,mask) EXT2_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask)
|
||||
#define EXT2_CLEAR_COMPAT_FEATURE(sb,mask) EXT2_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask)
|
||||
#define EXT2_CLEAR_RO_COMPAT_FEATURE(sb,mask) EXT2_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask)
|
||||
#define EXT2_CLEAR_INCOMPAT_FEATURE(sb,mask) EXT2_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask)
|
||||
|
||||
#define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001
|
||||
#define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002
|
||||
#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004
|
||||
#define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008
|
||||
#define EXT2_FEATURE_COMPAT_RESIZE_INO 0x0010
|
||||
#define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020
|
||||
#define EXT2_FEATURE_COMPAT_ANY 0xffffffff
|
||||
|
||||
#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
|
||||
#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
|
||||
#define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
|
||||
#define EXT2_FEATURE_RO_COMPAT_ANY 0xffffffff
|
||||
|
||||
#define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001
|
||||
#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002
|
||||
#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004
|
||||
#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008
|
||||
#define EXT2_FEATURE_INCOMPAT_META_BG 0x0010
|
||||
#define EXT2_FEATURE_INCOMPAT_ANY 0xffffffff
|
||||
|
||||
#define EXT2_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR
|
||||
#define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE| EXT2_FEATURE_INCOMPAT_META_BG)
|
||||
#define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| EXT2_FEATURE_RO_COMPAT_LARGE_FILE| EXT2_FEATURE_RO_COMPAT_BTREE_DIR)
|
||||
#define EXT2_FEATURE_RO_COMPAT_UNSUPPORTED ~EXT2_FEATURE_RO_COMPAT_SUPP
|
||||
#define EXT2_FEATURE_INCOMPAT_UNSUPPORTED ~EXT2_FEATURE_INCOMPAT_SUPP
|
||||
|
||||
#define EXT2_DEF_RESUID 0
|
||||
#define EXT2_DEF_RESGID 0
|
||||
|
||||
#define EXT2_DEFM_DEBUG 0x0001
|
||||
#define EXT2_DEFM_BSDGROUPS 0x0002
|
||||
#define EXT2_DEFM_XATTR_USER 0x0004
|
||||
#define EXT2_DEFM_ACL 0x0008
|
||||
#define EXT2_DEFM_UID16 0x0010
|
||||
|
||||
#define EXT3_DEFM_JMODE 0x0060
|
||||
#define EXT3_DEFM_JMODE_DATA 0x0020
|
||||
#define EXT3_DEFM_JMODE_ORDERED 0x0040
|
||||
#define EXT3_DEFM_JMODE_WBACK 0x0060
|
||||
|
||||
#define EXT2_NAME_LEN 255
|
||||
|
||||
struct ext2_dir_entry {
|
||||
__le32 inode;
|
||||
__le16 rec_len;
|
||||
__le16 name_len;
|
||||
char name[EXT2_NAME_LEN];
|
||||
};
|
||||
|
||||
struct ext2_dir_entry_2 {
|
||||
__le32 inode;
|
||||
__le16 rec_len;
|
||||
__u8 name_len;
|
||||
__u8 file_type;
|
||||
char name[EXT2_NAME_LEN];
|
||||
};
|
||||
|
||||
enum {
|
||||
EXT2_FT_UNKNOWN,
|
||||
EXT2_FT_REG_FILE,
|
||||
EXT2_FT_DIR,
|
||||
EXT2_FT_CHRDEV,
|
||||
EXT2_FT_BLKDEV,
|
||||
EXT2_FT_FIFO,
|
||||
EXT2_FT_SOCK,
|
||||
EXT2_FT_SYMLINK,
|
||||
EXT2_FT_MAX
|
||||
};
|
||||
|
||||
#define EXT2_DIR_PAD 4
|
||||
#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1)
|
||||
#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & ~EXT2_DIR_ROUND)
|
||||
|
||||
#endif
|
448
libc/kernel/common/linux/ext3_fs.h
Normal file
448
libc/kernel/common/linux/ext3_fs.h
Normal file
@@ -0,0 +1,448 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_EXT3_FS_H
|
||||
#define _LINUX_EXT3_FS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#undef EXT3FS_DEBUG
|
||||
|
||||
#define EXT3_DEFAULT_RESERVE_BLOCKS 8
|
||||
|
||||
#define EXT3_MAX_RESERVE_BLOCKS 1027
|
||||
#define EXT3_RESERVE_WINDOW_NOT_ALLOCATED 0
|
||||
|
||||
#define CONFIG_EXT3_INDEX
|
||||
|
||||
#ifdef EXT3FS_DEBUG
|
||||
#define ext3_debug(f, a...) do { printk (KERN_DEBUG "EXT3-fs DEBUG (%s, %d): %s:", __FILE__, __LINE__, __FUNCTION__); printk (KERN_DEBUG f, ## a); } while (0)
|
||||
#else
|
||||
#define ext3_debug(f, a...) do {} while (0)
|
||||
#endif
|
||||
|
||||
#define EXT3_BAD_INO 1
|
||||
#define EXT3_ROOT_INO 2
|
||||
#define EXT3_BOOT_LOADER_INO 5
|
||||
#define EXT3_UNDEL_DIR_INO 6
|
||||
#define EXT3_RESIZE_INO 7
|
||||
#define EXT3_JOURNAL_INO 8
|
||||
|
||||
#define EXT3_GOOD_OLD_FIRST_INO 11
|
||||
|
||||
#define EXT3_SUPER_MAGIC 0xEF53
|
||||
|
||||
#define EXT3_LINK_MAX 32000
|
||||
|
||||
#define EXT3_MIN_BLOCK_SIZE 1024
|
||||
#define EXT3_MAX_BLOCK_SIZE 4096
|
||||
#define EXT3_MIN_BLOCK_LOG_SIZE 10
|
||||
#define EXT3_BLOCK_SIZE(s) (EXT3_MIN_BLOCK_SIZE << (s)->s_log_block_size)
|
||||
#define EXT3_ADDR_PER_BLOCK(s) (EXT3_BLOCK_SIZE(s) / sizeof (__u32))
|
||||
#define EXT3_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
|
||||
#define EXT3_INODE_SIZE(s) (((s)->s_rev_level == EXT3_GOOD_OLD_REV) ? EXT3_GOOD_OLD_INODE_SIZE : (s)->s_inode_size)
|
||||
#define EXT3_FIRST_INO(s) (((s)->s_rev_level == EXT3_GOOD_OLD_REV) ? EXT3_GOOD_OLD_FIRST_INO : (s)->s_first_ino)
|
||||
|
||||
#define EXT3_MIN_FRAG_SIZE 1024
|
||||
#define EXT3_MAX_FRAG_SIZE 4096
|
||||
#define EXT3_MIN_FRAG_LOG_SIZE 10
|
||||
#define EXT3_FRAG_SIZE(s) (EXT3_MIN_FRAG_SIZE << (s)->s_log_frag_size)
|
||||
#define EXT3_FRAGS_PER_BLOCK(s) (EXT3_BLOCK_SIZE(s) / EXT3_FRAG_SIZE(s))
|
||||
|
||||
struct ext3_group_desc
|
||||
{
|
||||
__le32 bg_block_bitmap;
|
||||
__le32 bg_inode_bitmap;
|
||||
__le32 bg_inode_table;
|
||||
__le16 bg_free_blocks_count;
|
||||
__le16 bg_free_inodes_count;
|
||||
__le16 bg_used_dirs_count;
|
||||
__u16 bg_pad;
|
||||
__le32 bg_reserved[3];
|
||||
};
|
||||
|
||||
#define EXT3_BLOCKS_PER_GROUP(s) ((s)->s_blocks_per_group)
|
||||
#define EXT3_DESC_PER_BLOCK(s) (EXT3_BLOCK_SIZE(s) / sizeof (struct ext3_group_desc))
|
||||
#define EXT3_INODES_PER_GROUP(s) ((s)->s_inodes_per_group)
|
||||
|
||||
#define EXT3_NDIR_BLOCKS 12
|
||||
#define EXT3_IND_BLOCK EXT3_NDIR_BLOCKS
|
||||
#define EXT3_DIND_BLOCK (EXT3_IND_BLOCK + 1)
|
||||
#define EXT3_TIND_BLOCK (EXT3_DIND_BLOCK + 1)
|
||||
#define EXT3_N_BLOCKS (EXT3_TIND_BLOCK + 1)
|
||||
|
||||
#define EXT3_SECRM_FL 0x00000001
|
||||
#define EXT3_UNRM_FL 0x00000002
|
||||
#define EXT3_COMPR_FL 0x00000004
|
||||
#define EXT3_SYNC_FL 0x00000008
|
||||
#define EXT3_IMMUTABLE_FL 0x00000010
|
||||
#define EXT3_APPEND_FL 0x00000020
|
||||
#define EXT3_NODUMP_FL 0x00000040
|
||||
#define EXT3_NOATIME_FL 0x00000080
|
||||
|
||||
#define EXT3_DIRTY_FL 0x00000100
|
||||
#define EXT3_COMPRBLK_FL 0x00000200
|
||||
#define EXT3_NOCOMPR_FL 0x00000400
|
||||
#define EXT3_ECOMPR_FL 0x00000800
|
||||
|
||||
#define EXT3_INDEX_FL 0x00001000
|
||||
#define EXT3_IMAGIC_FL 0x00002000
|
||||
#define EXT3_JOURNAL_DATA_FL 0x00004000
|
||||
#define EXT3_NOTAIL_FL 0x00008000
|
||||
#define EXT3_DIRSYNC_FL 0x00010000
|
||||
#define EXT3_TOPDIR_FL 0x00020000
|
||||
#define EXT3_RESERVED_FL 0x80000000
|
||||
|
||||
#define EXT3_FL_USER_VISIBLE 0x0003DFFF
|
||||
#define EXT3_FL_USER_MODIFIABLE 0x000380FF
|
||||
|
||||
#define EXT3_STATE_JDATA 0x00000001
|
||||
#define EXT3_STATE_NEW 0x00000002
|
||||
#define EXT3_STATE_XATTR 0x00000004
|
||||
|
||||
struct ext3_new_group_input {
|
||||
__u32 group;
|
||||
__u32 block_bitmap;
|
||||
__u32 inode_bitmap;
|
||||
__u32 inode_table;
|
||||
__u32 blocks_count;
|
||||
__u16 reserved_blocks;
|
||||
__u16 unused;
|
||||
};
|
||||
|
||||
struct ext3_new_group_data {
|
||||
__u32 group;
|
||||
__u32 block_bitmap;
|
||||
__u32 inode_bitmap;
|
||||
__u32 inode_table;
|
||||
__u32 blocks_count;
|
||||
__u16 reserved_blocks;
|
||||
__u16 unused;
|
||||
__u32 free_blocks_count;
|
||||
};
|
||||
|
||||
#define EXT3_IOC_GETFLAGS _IOR('f', 1, long)
|
||||
#define EXT3_IOC_SETFLAGS _IOW('f', 2, long)
|
||||
#define EXT3_IOC_GETVERSION _IOR('f', 3, long)
|
||||
#define EXT3_IOC_SETVERSION _IOW('f', 4, long)
|
||||
#define EXT3_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long)
|
||||
#define EXT3_IOC_GROUP_ADD _IOW('f', 8,struct ext3_new_group_input)
|
||||
#define EXT3_IOC_GETVERSION_OLD _IOR('v', 1, long)
|
||||
#define EXT3_IOC_SETVERSION_OLD _IOW('v', 2, long)
|
||||
#define EXT3_IOC_GETRSVSZ _IOR('f', 5, long)
|
||||
#define EXT3_IOC_SETRSVSZ _IOW('f', 6, long)
|
||||
|
||||
struct ext3_mount_options {
|
||||
unsigned long s_mount_opt;
|
||||
uid_t s_resuid;
|
||||
gid_t s_resgid;
|
||||
unsigned long s_commit_interval;
|
||||
};
|
||||
|
||||
struct ext3_inode {
|
||||
__le16 i_mode;
|
||||
__le16 i_uid;
|
||||
__le32 i_size;
|
||||
__le32 i_atime;
|
||||
__le32 i_ctime;
|
||||
__le32 i_mtime;
|
||||
__le32 i_dtime;
|
||||
__le16 i_gid;
|
||||
__le16 i_links_count;
|
||||
__le32 i_blocks;
|
||||
__le32 i_flags;
|
||||
union {
|
||||
struct {
|
||||
__u32 l_i_reserved1;
|
||||
} linux1;
|
||||
struct {
|
||||
__u32 h_i_translator;
|
||||
} hurd1;
|
||||
struct {
|
||||
__u32 m_i_reserved1;
|
||||
} masix1;
|
||||
} osd1;
|
||||
__le32 i_block[EXT3_N_BLOCKS];
|
||||
__le32 i_generation;
|
||||
__le32 i_file_acl;
|
||||
__le32 i_dir_acl;
|
||||
__le32 i_faddr;
|
||||
union {
|
||||
struct {
|
||||
__u8 l_i_frag;
|
||||
__u8 l_i_fsize;
|
||||
__u16 i_pad1;
|
||||
__le16 l_i_uid_high;
|
||||
__le16 l_i_gid_high;
|
||||
__u32 l_i_reserved2;
|
||||
} linux2;
|
||||
struct {
|
||||
__u8 h_i_frag;
|
||||
__u8 h_i_fsize;
|
||||
__u16 h_i_mode_high;
|
||||
__u16 h_i_uid_high;
|
||||
__u16 h_i_gid_high;
|
||||
__u32 h_i_author;
|
||||
} hurd2;
|
||||
struct {
|
||||
__u8 m_i_frag;
|
||||
__u8 m_i_fsize;
|
||||
__u16 m_pad1;
|
||||
__u32 m_i_reserved2[2];
|
||||
} masix2;
|
||||
} osd2;
|
||||
__le16 i_extra_isize;
|
||||
__le16 i_pad1;
|
||||
};
|
||||
|
||||
#define i_size_high i_dir_acl
|
||||
|
||||
#ifdef __linux__
|
||||
#define i_reserved1 osd1.linux1.l_i_reserved1
|
||||
#define i_frag osd2.linux2.l_i_frag
|
||||
#define i_fsize osd2.linux2.l_i_fsize
|
||||
#define i_uid_low i_uid
|
||||
#define i_gid_low i_gid
|
||||
#define i_uid_high osd2.linux2.l_i_uid_high
|
||||
#define i_gid_high osd2.linux2.l_i_gid_high
|
||||
#define i_reserved2 osd2.linux2.l_i_reserved2
|
||||
|
||||
#elif defined(__GNU__)
|
||||
|
||||
#define i_translator osd1.hurd1.h_i_translator
|
||||
#define i_frag osd2.hurd2.h_i_frag;
|
||||
#define i_fsize osd2.hurd2.h_i_fsize;
|
||||
#define i_uid_high osd2.hurd2.h_i_uid_high
|
||||
#define i_gid_high osd2.hurd2.h_i_gid_high
|
||||
#define i_author osd2.hurd2.h_i_author
|
||||
|
||||
#elif defined(__masix__)
|
||||
|
||||
#define i_reserved1 osd1.masix1.m_i_reserved1
|
||||
#define i_frag osd2.masix2.m_i_frag
|
||||
#define i_fsize osd2.masix2.m_i_fsize
|
||||
#define i_reserved2 osd2.masix2.m_i_reserved2
|
||||
|
||||
#endif
|
||||
|
||||
#define EXT3_VALID_FS 0x0001
|
||||
#define EXT3_ERROR_FS 0x0002
|
||||
#define EXT3_ORPHAN_FS 0x0004
|
||||
|
||||
#define EXT3_MOUNT_CHECK 0x00001
|
||||
#define EXT3_MOUNT_OLDALLOC 0x00002
|
||||
#define EXT3_MOUNT_GRPID 0x00004
|
||||
#define EXT3_MOUNT_DEBUG 0x00008
|
||||
#define EXT3_MOUNT_ERRORS_CONT 0x00010
|
||||
#define EXT3_MOUNT_ERRORS_RO 0x00020
|
||||
#define EXT3_MOUNT_ERRORS_PANIC 0x00040
|
||||
#define EXT3_MOUNT_MINIX_DF 0x00080
|
||||
#define EXT3_MOUNT_NOLOAD 0x00100
|
||||
#define EXT3_MOUNT_ABORT 0x00200
|
||||
#define EXT3_MOUNT_DATA_FLAGS 0x00C00
|
||||
#define EXT3_MOUNT_JOURNAL_DATA 0x00400
|
||||
#define EXT3_MOUNT_ORDERED_DATA 0x00800
|
||||
#define EXT3_MOUNT_WRITEBACK_DATA 0x00C00
|
||||
#define EXT3_MOUNT_UPDATE_JOURNAL 0x01000
|
||||
#define EXT3_MOUNT_NO_UID32 0x02000
|
||||
#define EXT3_MOUNT_XATTR_USER 0x04000
|
||||
#define EXT3_MOUNT_POSIX_ACL 0x08000
|
||||
#define EXT3_MOUNT_RESERVATION 0x10000
|
||||
#define EXT3_MOUNT_BARRIER 0x20000
|
||||
#define EXT3_MOUNT_NOBH 0x40000
|
||||
#define EXT3_MOUNT_QUOTA 0x80000
|
||||
#define EXT3_MOUNT_USRQUOTA 0x100000
|
||||
#define EXT3_MOUNT_GRPQUOTA 0x200000
|
||||
|
||||
#ifndef _LINUX_EXT2_FS_H
|
||||
#define clear_opt(o, opt) o &= ~EXT3_MOUNT_##opt
|
||||
#define set_opt(o, opt) o |= EXT3_MOUNT_##opt
|
||||
#define test_opt(sb, opt) (EXT3_SB(sb)->s_mount_opt & EXT3_MOUNT_##opt)
|
||||
#else
|
||||
#define EXT2_MOUNT_NOLOAD EXT3_MOUNT_NOLOAD
|
||||
#define EXT2_MOUNT_ABORT EXT3_MOUNT_ABORT
|
||||
#define EXT2_MOUNT_DATA_FLAGS EXT3_MOUNT_DATA_FLAGS
|
||||
#endif
|
||||
|
||||
#define ext3_set_bit ext2_set_bit
|
||||
#define ext3_set_bit_atomic ext2_set_bit_atomic
|
||||
#define ext3_clear_bit ext2_clear_bit
|
||||
#define ext3_clear_bit_atomic ext2_clear_bit_atomic
|
||||
#define ext3_test_bit ext2_test_bit
|
||||
#define ext3_find_first_zero_bit ext2_find_first_zero_bit
|
||||
#define ext3_find_next_zero_bit ext2_find_next_zero_bit
|
||||
|
||||
#define EXT3_DFL_MAX_MNT_COUNT 20
|
||||
#define EXT3_DFL_CHECKINTERVAL 0
|
||||
|
||||
#define EXT3_ERRORS_CONTINUE 1
|
||||
#define EXT3_ERRORS_RO 2
|
||||
#define EXT3_ERRORS_PANIC 3
|
||||
#define EXT3_ERRORS_DEFAULT EXT3_ERRORS_CONTINUE
|
||||
|
||||
struct ext3_super_block {
|
||||
__le32 s_inodes_count;
|
||||
__le32 s_blocks_count;
|
||||
__le32 s_r_blocks_count;
|
||||
__le32 s_free_blocks_count;
|
||||
__le32 s_free_inodes_count;
|
||||
__le32 s_first_data_block;
|
||||
__le32 s_log_block_size;
|
||||
__le32 s_log_frag_size;
|
||||
__le32 s_blocks_per_group;
|
||||
__le32 s_frags_per_group;
|
||||
__le32 s_inodes_per_group;
|
||||
__le32 s_mtime;
|
||||
__le32 s_wtime;
|
||||
__le16 s_mnt_count;
|
||||
__le16 s_max_mnt_count;
|
||||
__le16 s_magic;
|
||||
__le16 s_state;
|
||||
__le16 s_errors;
|
||||
__le16 s_minor_rev_level;
|
||||
__le32 s_lastcheck;
|
||||
__le32 s_checkinterval;
|
||||
__le32 s_creator_os;
|
||||
__le32 s_rev_level;
|
||||
__le16 s_def_resuid;
|
||||
__le16 s_def_resgid;
|
||||
|
||||
__le32 s_first_ino;
|
||||
__le16 s_inode_size;
|
||||
__le16 s_block_group_nr;
|
||||
__le32 s_feature_compat;
|
||||
__le32 s_feature_incompat;
|
||||
__le32 s_feature_ro_compat;
|
||||
__u8 s_uuid[16];
|
||||
char s_volume_name[16];
|
||||
char s_last_mounted[64];
|
||||
__le32 s_algorithm_usage_bitmap;
|
||||
|
||||
__u8 s_prealloc_blocks;
|
||||
__u8 s_prealloc_dir_blocks;
|
||||
__u16 s_reserved_gdt_blocks;
|
||||
|
||||
__u8 s_journal_uuid[16];
|
||||
__le32 s_journal_inum;
|
||||
__le32 s_journal_dev;
|
||||
__le32 s_last_orphan;
|
||||
__le32 s_hash_seed[4];
|
||||
__u8 s_def_hash_version;
|
||||
__u8 s_reserved_char_pad;
|
||||
__u16 s_reserved_word_pad;
|
||||
__le32 s_default_mount_opts;
|
||||
__le32 s_first_meta_bg;
|
||||
__u32 s_reserved[190];
|
||||
};
|
||||
|
||||
#define EXT3_SB(sb) (sb)
|
||||
|
||||
#define NEXT_ORPHAN(inode) EXT3_I(inode)->i_dtime
|
||||
|
||||
#define EXT3_OS_LINUX 0
|
||||
#define EXT3_OS_HURD 1
|
||||
#define EXT3_OS_MASIX 2
|
||||
#define EXT3_OS_FREEBSD 3
|
||||
#define EXT3_OS_LITES 4
|
||||
|
||||
#define EXT3_GOOD_OLD_REV 0
|
||||
#define EXT3_DYNAMIC_REV 1
|
||||
|
||||
#define EXT3_CURRENT_REV EXT3_GOOD_OLD_REV
|
||||
#define EXT3_MAX_SUPP_REV EXT3_DYNAMIC_REV
|
||||
|
||||
#define EXT3_GOOD_OLD_INODE_SIZE 128
|
||||
|
||||
#define EXT3_HAS_COMPAT_FEATURE(sb,mask) ( EXT3_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) )
|
||||
#define EXT3_HAS_RO_COMPAT_FEATURE(sb,mask) ( EXT3_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) )
|
||||
#define EXT3_HAS_INCOMPAT_FEATURE(sb,mask) ( EXT3_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) )
|
||||
#define EXT3_SET_COMPAT_FEATURE(sb,mask) EXT3_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask)
|
||||
#define EXT3_SET_RO_COMPAT_FEATURE(sb,mask) EXT3_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask)
|
||||
#define EXT3_SET_INCOMPAT_FEATURE(sb,mask) EXT3_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask)
|
||||
#define EXT3_CLEAR_COMPAT_FEATURE(sb,mask) EXT3_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask)
|
||||
#define EXT3_CLEAR_RO_COMPAT_FEATURE(sb,mask) EXT3_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask)
|
||||
#define EXT3_CLEAR_INCOMPAT_FEATURE(sb,mask) EXT3_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask)
|
||||
|
||||
#define EXT3_FEATURE_COMPAT_DIR_PREALLOC 0x0001
|
||||
#define EXT3_FEATURE_COMPAT_IMAGIC_INODES 0x0002
|
||||
#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004
|
||||
#define EXT3_FEATURE_COMPAT_EXT_ATTR 0x0008
|
||||
#define EXT3_FEATURE_COMPAT_RESIZE_INODE 0x0010
|
||||
#define EXT3_FEATURE_COMPAT_DIR_INDEX 0x0020
|
||||
|
||||
#define EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
|
||||
#define EXT3_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
|
||||
#define EXT3_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
|
||||
|
||||
#define EXT3_FEATURE_INCOMPAT_COMPRESSION 0x0001
|
||||
#define EXT3_FEATURE_INCOMPAT_FILETYPE 0x0002
|
||||
#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004
|
||||
#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008
|
||||
#define EXT3_FEATURE_INCOMPAT_META_BG 0x0010
|
||||
|
||||
#define EXT3_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR
|
||||
#define EXT3_FEATURE_INCOMPAT_SUPP (EXT3_FEATURE_INCOMPAT_FILETYPE| EXT3_FEATURE_INCOMPAT_RECOVER| EXT3_FEATURE_INCOMPAT_META_BG)
|
||||
#define EXT3_FEATURE_RO_COMPAT_SUPP (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| EXT3_FEATURE_RO_COMPAT_LARGE_FILE| EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
|
||||
|
||||
#define EXT3_DEF_RESUID 0
|
||||
#define EXT3_DEF_RESGID 0
|
||||
|
||||
#define EXT3_DEFM_DEBUG 0x0001
|
||||
#define EXT3_DEFM_BSDGROUPS 0x0002
|
||||
#define EXT3_DEFM_XATTR_USER 0x0004
|
||||
#define EXT3_DEFM_ACL 0x0008
|
||||
#define EXT3_DEFM_UID16 0x0010
|
||||
#define EXT3_DEFM_JMODE 0x0060
|
||||
#define EXT3_DEFM_JMODE_DATA 0x0020
|
||||
#define EXT3_DEFM_JMODE_ORDERED 0x0040
|
||||
#define EXT3_DEFM_JMODE_WBACK 0x0060
|
||||
|
||||
#define EXT3_NAME_LEN 255
|
||||
|
||||
struct ext3_dir_entry {
|
||||
__le32 inode;
|
||||
__le16 rec_len;
|
||||
__le16 name_len;
|
||||
char name[EXT3_NAME_LEN];
|
||||
};
|
||||
|
||||
struct ext3_dir_entry_2 {
|
||||
__le32 inode;
|
||||
__le16 rec_len;
|
||||
__u8 name_len;
|
||||
__u8 file_type;
|
||||
char name[EXT3_NAME_LEN];
|
||||
};
|
||||
|
||||
#define EXT3_FT_UNKNOWN 0
|
||||
#define EXT3_FT_REG_FILE 1
|
||||
#define EXT3_FT_DIR 2
|
||||
#define EXT3_FT_CHRDEV 3
|
||||
#define EXT3_FT_BLKDEV 4
|
||||
#define EXT3_FT_FIFO 5
|
||||
#define EXT3_FT_SOCK 6
|
||||
#define EXT3_FT_SYMLINK 7
|
||||
|
||||
#define EXT3_FT_MAX 8
|
||||
|
||||
#define EXT3_DIR_PAD 4
|
||||
#define EXT3_DIR_ROUND (EXT3_DIR_PAD - 1)
|
||||
#define EXT3_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT3_DIR_ROUND) & ~EXT3_DIR_ROUND)
|
||||
|
||||
#define is_dx(dir) 0
|
||||
#define EXT3_DIR_LINK_MAX(dir) ((dir)->i_nlink >= EXT3_LINK_MAX)
|
||||
#define EXT3_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2)
|
||||
|
||||
#define DX_HASH_LEGACY 0
|
||||
#define DX_HASH_HALF_MD4 1
|
||||
#define DX_HASH_TEA 2
|
||||
|
||||
#endif
|
28
libc/kernel/common/linux/fadvise.h
Normal file
28
libc/kernel/common/linux/fadvise.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef FADVISE_H_INCLUDED
|
||||
#define FADVISE_H_INCLUDED
|
||||
|
||||
#define POSIX_FADV_NORMAL 0
|
||||
#define POSIX_FADV_RANDOM 1
|
||||
#define POSIX_FADV_SEQUENTIAL 2
|
||||
#define POSIX_FADV_WILLNEED 3
|
||||
|
||||
#ifdef __s390x__
|
||||
#define POSIX_FADV_DONTNEED 6
|
||||
#define POSIX_FADV_NOREUSE 7
|
||||
#else
|
||||
#define POSIX_FADV_DONTNEED 4
|
||||
#define POSIX_FADV_NOREUSE 5
|
||||
#endif
|
||||
|
||||
#endif
|
347
libc/kernel/common/linux/fb.h
Normal file
347
libc/kernel/common/linux/fb.h
Normal file
@@ -0,0 +1,347 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_FB_H
|
||||
#define _LINUX_FB_H
|
||||
|
||||
#include <asm/types.h>
|
||||
|
||||
#define FB_MAJOR 29
|
||||
#define FB_MAX 32
|
||||
|
||||
#define FBIOGET_VSCREENINFO 0x4600
|
||||
#define FBIOPUT_VSCREENINFO 0x4601
|
||||
#define FBIOGET_FSCREENINFO 0x4602
|
||||
#define FBIOGETCMAP 0x4604
|
||||
#define FBIOPUTCMAP 0x4605
|
||||
#define FBIOPAN_DISPLAY 0x4606
|
||||
#define FBIO_CURSOR _IOWR('F', 0x08, struct fb_cursor)
|
||||
|
||||
#define FBIOGET_CON2FBMAP 0x460F
|
||||
#define FBIOPUT_CON2FBMAP 0x4610
|
||||
#define FBIOBLANK 0x4611
|
||||
#define FBIOGET_VBLANK _IOR('F', 0x12, struct fb_vblank)
|
||||
#define FBIO_ALLOC 0x4613
|
||||
#define FBIO_FREE 0x4614
|
||||
#define FBIOGET_GLYPH 0x4615
|
||||
#define FBIOGET_HWCINFO 0x4616
|
||||
#define FBIOPUT_MODEINFO 0x4617
|
||||
#define FBIOGET_DISPINFO 0x4618
|
||||
|
||||
#define FB_TYPE_PACKED_PIXELS 0
|
||||
#define FB_TYPE_PLANES 1
|
||||
#define FB_TYPE_INTERLEAVED_PLANES 2
|
||||
#define FB_TYPE_TEXT 3
|
||||
#define FB_TYPE_VGA_PLANES 4
|
||||
|
||||
#define FB_AUX_TEXT_MDA 0
|
||||
#define FB_AUX_TEXT_CGA 1
|
||||
#define FB_AUX_TEXT_S3_MMIO 2
|
||||
#define FB_AUX_TEXT_MGA_STEP16 3
|
||||
#define FB_AUX_TEXT_MGA_STEP8 4
|
||||
|
||||
#define FB_AUX_VGA_PLANES_VGA4 0
|
||||
#define FB_AUX_VGA_PLANES_CFB4 1
|
||||
#define FB_AUX_VGA_PLANES_CFB8 2
|
||||
|
||||
#define FB_VISUAL_MONO01 0
|
||||
#define FB_VISUAL_MONO10 1
|
||||
#define FB_VISUAL_TRUECOLOR 2
|
||||
#define FB_VISUAL_PSEUDOCOLOR 3
|
||||
#define FB_VISUAL_DIRECTCOLOR 4
|
||||
#define FB_VISUAL_STATIC_PSEUDOCOLOR 5
|
||||
|
||||
#define FB_ACCEL_NONE 0
|
||||
#define FB_ACCEL_ATARIBLITT 1
|
||||
#define FB_ACCEL_AMIGABLITT 2
|
||||
#define FB_ACCEL_S3_TRIO64 3
|
||||
#define FB_ACCEL_NCR_77C32BLT 4
|
||||
#define FB_ACCEL_S3_VIRGE 5
|
||||
#define FB_ACCEL_ATI_MACH64GX 6
|
||||
#define FB_ACCEL_DEC_TGA 7
|
||||
#define FB_ACCEL_ATI_MACH64CT 8
|
||||
#define FB_ACCEL_ATI_MACH64VT 9
|
||||
#define FB_ACCEL_ATI_MACH64GT 10
|
||||
#define FB_ACCEL_SUN_CREATOR 11
|
||||
#define FB_ACCEL_SUN_CGSIX 12
|
||||
#define FB_ACCEL_SUN_LEO 13
|
||||
#define FB_ACCEL_IMS_TWINTURBO 14
|
||||
#define FB_ACCEL_3DLABS_PERMEDIA2 15
|
||||
#define FB_ACCEL_MATROX_MGA2064W 16
|
||||
#define FB_ACCEL_MATROX_MGA1064SG 17
|
||||
#define FB_ACCEL_MATROX_MGA2164W 18
|
||||
#define FB_ACCEL_MATROX_MGA2164W_AGP 19
|
||||
#define FB_ACCEL_MATROX_MGAG100 20
|
||||
#define FB_ACCEL_MATROX_MGAG200 21
|
||||
#define FB_ACCEL_SUN_CG14 22
|
||||
#define FB_ACCEL_SUN_BWTWO 23
|
||||
#define FB_ACCEL_SUN_CGTHREE 24
|
||||
#define FB_ACCEL_SUN_TCX 25
|
||||
#define FB_ACCEL_MATROX_MGAG400 26
|
||||
#define FB_ACCEL_NV3 27
|
||||
#define FB_ACCEL_NV4 28
|
||||
#define FB_ACCEL_NV5 29
|
||||
#define FB_ACCEL_CT_6555x 30
|
||||
#define FB_ACCEL_3DFX_BANSHEE 31
|
||||
#define FB_ACCEL_ATI_RAGE128 32
|
||||
#define FB_ACCEL_IGS_CYBER2000 33
|
||||
#define FB_ACCEL_IGS_CYBER2010 34
|
||||
#define FB_ACCEL_IGS_CYBER5000 35
|
||||
#define FB_ACCEL_SIS_GLAMOUR 36
|
||||
#define FB_ACCEL_3DLABS_PERMEDIA3 37
|
||||
#define FB_ACCEL_ATI_RADEON 38
|
||||
#define FB_ACCEL_I810 39
|
||||
#define FB_ACCEL_SIS_GLAMOUR_2 40
|
||||
#define FB_ACCEL_SIS_XABRE 41
|
||||
#define FB_ACCEL_I830 42
|
||||
#define FB_ACCEL_NV_10 43
|
||||
#define FB_ACCEL_NV_20 44
|
||||
#define FB_ACCEL_NV_30 45
|
||||
#define FB_ACCEL_NV_40 46
|
||||
#define FB_ACCEL_XGI_VOLARI_V 47
|
||||
#define FB_ACCEL_XGI_VOLARI_Z 48
|
||||
#define FB_ACCEL_OMAP1610 49
|
||||
#define FB_ACCEL_NEOMAGIC_NM2070 90
|
||||
#define FB_ACCEL_NEOMAGIC_NM2090 91
|
||||
#define FB_ACCEL_NEOMAGIC_NM2093 92
|
||||
#define FB_ACCEL_NEOMAGIC_NM2097 93
|
||||
#define FB_ACCEL_NEOMAGIC_NM2160 94
|
||||
#define FB_ACCEL_NEOMAGIC_NM2200 95
|
||||
#define FB_ACCEL_NEOMAGIC_NM2230 96
|
||||
#define FB_ACCEL_NEOMAGIC_NM2360 97
|
||||
#define FB_ACCEL_NEOMAGIC_NM2380 98
|
||||
|
||||
#define FB_ACCEL_SAVAGE4 0x80
|
||||
#define FB_ACCEL_SAVAGE3D 0x81
|
||||
#define FB_ACCEL_SAVAGE3D_MV 0x82
|
||||
#define FB_ACCEL_SAVAGE2000 0x83
|
||||
#define FB_ACCEL_SAVAGE_MX_MV 0x84
|
||||
#define FB_ACCEL_SAVAGE_MX 0x85
|
||||
#define FB_ACCEL_SAVAGE_IX_MV 0x86
|
||||
#define FB_ACCEL_SAVAGE_IX 0x87
|
||||
#define FB_ACCEL_PROSAVAGE_PM 0x88
|
||||
#define FB_ACCEL_PROSAVAGE_KM 0x89
|
||||
#define FB_ACCEL_S3TWISTER_P 0x8a
|
||||
#define FB_ACCEL_S3TWISTER_K 0x8b
|
||||
#define FB_ACCEL_SUPERSAVAGE 0x8c
|
||||
#define FB_ACCEL_PROSAVAGE_DDR 0x8d
|
||||
#define FB_ACCEL_PROSAVAGE_DDRK 0x8e
|
||||
|
||||
struct fb_fix_screeninfo {
|
||||
char id[16];
|
||||
unsigned long smem_start;
|
||||
|
||||
__u32 smem_len;
|
||||
__u32 type;
|
||||
__u32 type_aux;
|
||||
__u32 visual;
|
||||
__u16 xpanstep;
|
||||
__u16 ypanstep;
|
||||
__u16 ywrapstep;
|
||||
__u32 line_length;
|
||||
unsigned long mmio_start;
|
||||
|
||||
__u32 mmio_len;
|
||||
__u32 accel;
|
||||
|
||||
__u16 reserved[3];
|
||||
};
|
||||
|
||||
struct fb_bitfield {
|
||||
__u32 offset;
|
||||
__u32 length;
|
||||
__u32 msb_right;
|
||||
|
||||
};
|
||||
|
||||
#define FB_NONSTD_HAM 1
|
||||
|
||||
#define FB_ACTIVATE_NOW 0
|
||||
#define FB_ACTIVATE_NXTOPEN 1
|
||||
#define FB_ACTIVATE_TEST 2
|
||||
#define FB_ACTIVATE_MASK 15
|
||||
|
||||
#define FB_ACTIVATE_VBL 16
|
||||
#define FB_CHANGE_CMAP_VBL 32
|
||||
#define FB_ACTIVATE_ALL 64
|
||||
#define FB_ACTIVATE_FORCE 128
|
||||
#define FB_ACTIVATE_INV_MODE 256
|
||||
|
||||
#define FB_ACCELF_TEXT 1
|
||||
|
||||
#define FB_SYNC_HOR_HIGH_ACT 1
|
||||
#define FB_SYNC_VERT_HIGH_ACT 2
|
||||
#define FB_SYNC_EXT 4
|
||||
#define FB_SYNC_COMP_HIGH_ACT 8
|
||||
#define FB_SYNC_BROADCAST 16
|
||||
|
||||
#define FB_SYNC_ON_GREEN 32
|
||||
|
||||
#define FB_VMODE_NONINTERLACED 0
|
||||
#define FB_VMODE_INTERLACED 1
|
||||
#define FB_VMODE_DOUBLE 2
|
||||
#define FB_VMODE_MASK 255
|
||||
|
||||
#define FB_VMODE_YWRAP 256
|
||||
#define FB_VMODE_SMOOTH_XPAN 512
|
||||
#define FB_VMODE_CONUPDATE 512
|
||||
|
||||
#define FB_ROTATE_UR 0
|
||||
#define FB_ROTATE_CW 1
|
||||
#define FB_ROTATE_UD 2
|
||||
#define FB_ROTATE_CCW 3
|
||||
|
||||
#define PICOS2KHZ(a) (1000000000UL/(a))
|
||||
#define KHZ2PICOS(a) (1000000000UL/(a))
|
||||
|
||||
struct fb_var_screeninfo {
|
||||
__u32 xres;
|
||||
__u32 yres;
|
||||
__u32 xres_virtual;
|
||||
__u32 yres_virtual;
|
||||
__u32 xoffset;
|
||||
__u32 yoffset;
|
||||
|
||||
__u32 bits_per_pixel;
|
||||
__u32 grayscale;
|
||||
|
||||
struct fb_bitfield red;
|
||||
struct fb_bitfield green;
|
||||
struct fb_bitfield blue;
|
||||
struct fb_bitfield transp;
|
||||
|
||||
__u32 nonstd;
|
||||
|
||||
__u32 activate;
|
||||
|
||||
__u32 height;
|
||||
__u32 width;
|
||||
|
||||
__u32 accel_flags;
|
||||
|
||||
__u32 pixclock;
|
||||
__u32 left_margin;
|
||||
__u32 right_margin;
|
||||
__u32 upper_margin;
|
||||
__u32 lower_margin;
|
||||
__u32 hsync_len;
|
||||
__u32 vsync_len;
|
||||
__u32 sync;
|
||||
__u32 vmode;
|
||||
__u32 rotate;
|
||||
__u32 reserved[5];
|
||||
};
|
||||
|
||||
struct fb_cmap {
|
||||
__u32 start;
|
||||
__u32 len;
|
||||
__u16 *red;
|
||||
__u16 *green;
|
||||
__u16 *blue;
|
||||
__u16 *transp;
|
||||
};
|
||||
|
||||
struct fb_con2fbmap {
|
||||
__u32 console;
|
||||
__u32 framebuffer;
|
||||
};
|
||||
|
||||
#define VESA_NO_BLANKING 0
|
||||
#define VESA_VSYNC_SUSPEND 1
|
||||
#define VESA_HSYNC_SUSPEND 2
|
||||
#define VESA_POWERDOWN 3
|
||||
|
||||
enum {
|
||||
|
||||
FB_BLANK_UNBLANK = VESA_NO_BLANKING,
|
||||
|
||||
FB_BLANK_NORMAL = VESA_NO_BLANKING + 1,
|
||||
|
||||
FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SUSPEND + 1,
|
||||
|
||||
FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SUSPEND + 1,
|
||||
|
||||
FB_BLANK_POWERDOWN = VESA_POWERDOWN + 1
|
||||
};
|
||||
|
||||
#define FB_VBLANK_VBLANKING 0x001
|
||||
#define FB_VBLANK_HBLANKING 0x002
|
||||
#define FB_VBLANK_HAVE_VBLANK 0x004
|
||||
#define FB_VBLANK_HAVE_HBLANK 0x008
|
||||
#define FB_VBLANK_HAVE_COUNT 0x010
|
||||
#define FB_VBLANK_HAVE_VCOUNT 0x020
|
||||
#define FB_VBLANK_HAVE_HCOUNT 0x040
|
||||
#define FB_VBLANK_VSYNCING 0x080
|
||||
#define FB_VBLANK_HAVE_VSYNC 0x100
|
||||
|
||||
struct fb_vblank {
|
||||
__u32 flags;
|
||||
__u32 count;
|
||||
__u32 vcount;
|
||||
__u32 hcount;
|
||||
__u32 reserved[4];
|
||||
};
|
||||
|
||||
#define ROP_COPY 0
|
||||
#define ROP_XOR 1
|
||||
|
||||
struct fb_copyarea {
|
||||
__u32 dx;
|
||||
__u32 dy;
|
||||
__u32 width;
|
||||
__u32 height;
|
||||
__u32 sx;
|
||||
__u32 sy;
|
||||
};
|
||||
|
||||
struct fb_fillrect {
|
||||
__u32 dx;
|
||||
__u32 dy;
|
||||
__u32 width;
|
||||
__u32 height;
|
||||
__u32 color;
|
||||
__u32 rop;
|
||||
};
|
||||
|
||||
struct fb_image {
|
||||
__u32 dx;
|
||||
__u32 dy;
|
||||
__u32 width;
|
||||
__u32 height;
|
||||
__u32 fg_color;
|
||||
__u32 bg_color;
|
||||
__u8 depth;
|
||||
const char *data;
|
||||
struct fb_cmap cmap;
|
||||
};
|
||||
|
||||
#define FB_CUR_SETIMAGE 0x01
|
||||
#define FB_CUR_SETPOS 0x02
|
||||
#define FB_CUR_SETHOT 0x04
|
||||
#define FB_CUR_SETCMAP 0x08
|
||||
#define FB_CUR_SETSHAPE 0x10
|
||||
#define FB_CUR_SETSIZE 0x20
|
||||
#define FB_CUR_SETALL 0xFF
|
||||
|
||||
struct fbcurpos {
|
||||
__u16 x, y;
|
||||
};
|
||||
|
||||
struct fb_cursor {
|
||||
__u16 set;
|
||||
__u16 enable;
|
||||
__u16 rop;
|
||||
const char *mask;
|
||||
struct fbcurpos hot;
|
||||
struct fb_image image;
|
||||
};
|
||||
|
||||
#endif
|
35
libc/kernel/common/linux/fcntl.h
Normal file
35
libc/kernel/common/linux/fcntl.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_FCNTL_H
|
||||
#define _LINUX_FCNTL_H
|
||||
|
||||
#include <asm/fcntl.h>
|
||||
|
||||
#define F_SETLEASE (F_LINUX_SPECIFIC_BASE+0)
|
||||
#define F_GETLEASE (F_LINUX_SPECIFIC_BASE+1)
|
||||
|
||||
#define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2)
|
||||
|
||||
#define DN_ACCESS 0x00000001
|
||||
#define DN_MODIFY 0x00000002
|
||||
#define DN_CREATE 0x00000004
|
||||
#define DN_DELETE 0x00000008
|
||||
#define DN_RENAME 0x00000010
|
||||
#define DN_ATTRIB 0x00000020
|
||||
#define DN_MULTISHOT 0x80000000
|
||||
|
||||
#define AT_FDCWD -100
|
||||
#define AT_SYMLINK_NOFOLLOW 0x100
|
||||
#define AT_REMOVEDIR 0x200
|
||||
#define AT_SYMLINK_FOLLOW 0x400
|
||||
|
||||
#endif
|
258
libc/kernel/common/linux/fd.h
Normal file
258
libc/kernel/common/linux/fd.h
Normal file
@@ -0,0 +1,258 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_FD_H
|
||||
#define _LINUX_FD_H
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
struct floppy_struct {
|
||||
unsigned int size,
|
||||
sect,
|
||||
head,
|
||||
track,
|
||||
stretch;
|
||||
#define FD_STRETCH 1
|
||||
#define FD_SWAPSIDES 2
|
||||
#define FD_ZEROBASED 4
|
||||
|
||||
unsigned char gap,
|
||||
|
||||
rate,
|
||||
#define FD_2M 0x4
|
||||
#define FD_SIZECODEMASK 0x38
|
||||
#define FD_SIZECODE(floppy) (((((floppy)->rate&FD_SIZECODEMASK)>> 3)+ 2) %8)
|
||||
#define FD_SECTSIZE(floppy) ( (floppy)->rate & FD_2M ? 512 : 128 << FD_SIZECODE(floppy) )
|
||||
#define FD_PERP 0x40
|
||||
|
||||
spec1,
|
||||
fmt_gap;
|
||||
const char * name;
|
||||
};
|
||||
|
||||
#define FDCLRPRM _IO(2, 0x41)
|
||||
|
||||
#define FDSETPRM _IOW(2, 0x42, struct floppy_struct)
|
||||
#define FDSETMEDIAPRM FDSETPRM
|
||||
|
||||
#define FDDEFPRM _IOW(2, 0x43, struct floppy_struct)
|
||||
#define FDGETPRM _IOR(2, 0x04, struct floppy_struct)
|
||||
#define FDDEFMEDIAPRM FDDEFPRM
|
||||
#define FDGETMEDIAPRM FDGETPRM
|
||||
|
||||
#define FDMSGON _IO(2,0x45)
|
||||
#define FDMSGOFF _IO(2,0x46)
|
||||
|
||||
#define FD_FILL_BYTE 0xF6
|
||||
|
||||
struct format_descr {
|
||||
unsigned int device,head,track;
|
||||
};
|
||||
|
||||
#define FDFMTBEG _IO(2,0x47)
|
||||
|
||||
#define FDFMTTRK _IOW(2,0x48, struct format_descr)
|
||||
|
||||
#define FDFMTEND _IO(2,0x49)
|
||||
|
||||
struct floppy_max_errors {
|
||||
unsigned int
|
||||
abort,
|
||||
read_track,
|
||||
reset,
|
||||
recal,
|
||||
|
||||
reporting;
|
||||
|
||||
};
|
||||
|
||||
#define FDSETEMSGTRESH _IO(2,0x4a)
|
||||
|
||||
#define FDFLUSH _IO(2,0x4b)
|
||||
|
||||
#define FDSETMAXERRS _IOW(2, 0x4c, struct floppy_max_errors)
|
||||
#define FDGETMAXERRS _IOR(2, 0x0e, struct floppy_max_errors)
|
||||
|
||||
typedef char floppy_drive_name[16];
|
||||
#define FDGETDRVTYP _IOR(2, 0x0f, floppy_drive_name)
|
||||
|
||||
struct floppy_drive_params {
|
||||
signed char cmos;
|
||||
|
||||
unsigned long max_dtr;
|
||||
unsigned long hlt;
|
||||
unsigned long hut;
|
||||
unsigned long srt;
|
||||
|
||||
unsigned long spinup;
|
||||
unsigned long spindown;
|
||||
unsigned char spindown_offset;
|
||||
unsigned char select_delay;
|
||||
unsigned char rps;
|
||||
unsigned char tracks;
|
||||
unsigned long timeout;
|
||||
|
||||
unsigned char interleave_sect;
|
||||
|
||||
struct floppy_max_errors max_errors;
|
||||
|
||||
char flags;
|
||||
|
||||
#define FTD_MSG 0x10
|
||||
#define FD_BROKEN_DCL 0x20
|
||||
#define FD_DEBUG 0x02
|
||||
#define FD_SILENT_DCL_CLEAR 0x4
|
||||
#define FD_INVERTED_DCL 0x80
|
||||
|
||||
char read_track;
|
||||
|
||||
short autodetect[8];
|
||||
|
||||
int checkfreq;
|
||||
int native_format;
|
||||
};
|
||||
|
||||
enum {
|
||||
FD_NEED_TWADDLE_BIT,
|
||||
FD_VERIFY_BIT,
|
||||
FD_DISK_NEWCHANGE_BIT,
|
||||
FD_UNUSED_BIT,
|
||||
FD_DISK_CHANGED_BIT,
|
||||
FD_DISK_WRITABLE_BIT
|
||||
};
|
||||
|
||||
#define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params)
|
||||
#define FDGETDRVPRM _IOR(2, 0x11, struct floppy_drive_params)
|
||||
|
||||
struct floppy_drive_struct {
|
||||
unsigned long flags;
|
||||
|
||||
#define FD_NEED_TWADDLE (1 << FD_NEED_TWADDLE_BIT)
|
||||
#define FD_VERIFY (1 << FD_VERIFY_BIT)
|
||||
#define FD_DISK_NEWCHANGE (1 << FD_DISK_NEWCHANGE_BIT)
|
||||
#define FD_DISK_CHANGED (1 << FD_DISK_CHANGED_BIT)
|
||||
#define FD_DISK_WRITABLE (1 << FD_DISK_WRITABLE_BIT)
|
||||
|
||||
unsigned long spinup_date;
|
||||
unsigned long select_date;
|
||||
unsigned long first_read_date;
|
||||
short probed_format;
|
||||
short track;
|
||||
short maxblock;
|
||||
short maxtrack;
|
||||
int generation;
|
||||
|
||||
int keep_data;
|
||||
|
||||
int fd_ref;
|
||||
int fd_device;
|
||||
unsigned long last_checked;
|
||||
|
||||
char *dmabuf;
|
||||
int bufblocks;
|
||||
};
|
||||
|
||||
#define FDGETDRVSTAT _IOR(2, 0x12, struct floppy_drive_struct)
|
||||
#define FDPOLLDRVSTAT _IOR(2, 0x13, struct floppy_drive_struct)
|
||||
|
||||
enum reset_mode {
|
||||
FD_RESET_IF_NEEDED,
|
||||
FD_RESET_IF_RAWCMD,
|
||||
FD_RESET_ALWAYS
|
||||
};
|
||||
#define FDRESET _IO(2, 0x54)
|
||||
|
||||
struct floppy_fdc_state {
|
||||
int spec1;
|
||||
int spec2;
|
||||
int dtr;
|
||||
unsigned char version;
|
||||
unsigned char dor;
|
||||
unsigned long address;
|
||||
unsigned int rawcmd:2;
|
||||
unsigned int reset:1;
|
||||
unsigned int need_configure:1;
|
||||
unsigned int perp_mode:2;
|
||||
unsigned int has_fifo:1;
|
||||
unsigned int driver_version;
|
||||
#define FD_DRIVER_VERSION 0x100
|
||||
|
||||
unsigned char track[4];
|
||||
|
||||
};
|
||||
|
||||
#define FDGETFDCSTAT _IOR(2, 0x15, struct floppy_fdc_state)
|
||||
|
||||
struct floppy_write_errors {
|
||||
|
||||
unsigned int write_errors;
|
||||
|
||||
unsigned long first_error_sector;
|
||||
int first_error_generation;
|
||||
unsigned long last_error_sector;
|
||||
int last_error_generation;
|
||||
|
||||
unsigned int badness;
|
||||
};
|
||||
|
||||
#define FDWERRORCLR _IO(2, 0x56)
|
||||
|
||||
#define FDWERRORGET _IOR(2, 0x17, struct floppy_write_errors)
|
||||
|
||||
#define FDHAVEBATCHEDRAWCMD
|
||||
|
||||
struct floppy_raw_cmd {
|
||||
unsigned int flags;
|
||||
#define FD_RAW_READ 1
|
||||
#define FD_RAW_WRITE 2
|
||||
#define FD_RAW_NO_MOTOR 4
|
||||
#define FD_RAW_DISK_CHANGE 4
|
||||
#define FD_RAW_INTR 8
|
||||
#define FD_RAW_SPIN 0x10
|
||||
#define FD_RAW_NO_MOTOR_AFTER 0x20
|
||||
#define FD_RAW_NEED_DISK 0x40
|
||||
#define FD_RAW_NEED_SEEK 0x80
|
||||
|
||||
#define FD_RAW_MORE 0x100
|
||||
#define FD_RAW_STOP_IF_FAILURE 0x200
|
||||
#define FD_RAW_STOP_IF_SUCCESS 0x400
|
||||
#define FD_RAW_SOFTFAILURE 0x800
|
||||
|
||||
#define FD_RAW_FAILURE 0x10000
|
||||
#define FD_RAW_HARDFAILURE 0x20000
|
||||
|
||||
void __user *data;
|
||||
char *kernel_data;
|
||||
struct floppy_raw_cmd *next;
|
||||
long length;
|
||||
long phys_length;
|
||||
int buffer_length;
|
||||
|
||||
unsigned char rate;
|
||||
unsigned char cmd_count;
|
||||
unsigned char cmd[16];
|
||||
unsigned char reply_count;
|
||||
unsigned char reply[16];
|
||||
int track;
|
||||
int resultcode;
|
||||
|
||||
int reserved1;
|
||||
int reserved2;
|
||||
};
|
||||
|
||||
#define FDRAWCMD _IO(2, 0x58)
|
||||
|
||||
#define FDTWADDLE _IO(2, 0x59)
|
||||
|
||||
#define FDEJECT _IO(2, 0x5a)
|
||||
|
||||
#endif
|
64
libc/kernel/common/linux/file.h
Normal file
64
libc/kernel/common/linux/file.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __LINUX_FILE_H
|
||||
#define __LINUX_FILE_H
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/posix_types.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#define NR_OPEN_DEFAULT BITS_PER_LONG
|
||||
|
||||
struct embedded_fd_set {
|
||||
unsigned long fds_bits[1];
|
||||
};
|
||||
|
||||
#define EMBEDDED_FD_SET_SIZE (BITS_PER_BYTE * sizeof(struct embedded_fd_set))
|
||||
|
||||
struct fdtable {
|
||||
unsigned int max_fds;
|
||||
int max_fdset;
|
||||
struct file ** fd;
|
||||
fd_set *close_on_exec;
|
||||
fd_set *open_fds;
|
||||
struct rcu_head rcu;
|
||||
struct files_struct *free_files;
|
||||
struct fdtable *next;
|
||||
};
|
||||
|
||||
struct files_struct {
|
||||
|
||||
atomic_t count;
|
||||
struct fdtable *fdt;
|
||||
struct fdtable fdtab;
|
||||
|
||||
spinlock_t file_lock ____cacheline_aligned_in_smp;
|
||||
int next_fd;
|
||||
struct embedded_fd_set close_on_exec_init;
|
||||
struct embedded_fd_set open_fds_init;
|
||||
struct file * fd_array[NR_OPEN_DEFAULT];
|
||||
};
|
||||
|
||||
#define files_fdtable(files) (rcu_dereference((files)->fdt))
|
||||
|
||||
struct kmem_cache;
|
||||
|
||||
#define fcheck(fd) fcheck_files(current->files, fd)
|
||||
|
||||
struct task_struct;
|
||||
|
||||
struct files_struct *get_files_struct(struct task_struct *);
|
||||
|
||||
#endif
|
104
libc/kernel/common/linux/filter.h
Normal file
104
libc/kernel/common/linux/filter.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __LINUX_FILTER_H__
|
||||
#define __LINUX_FILTER_H__
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#define BPF_MAJOR_VERSION 1
|
||||
#define BPF_MINOR_VERSION 1
|
||||
|
||||
struct sock_filter
|
||||
{
|
||||
__u16 code;
|
||||
__u8 jt;
|
||||
__u8 jf;
|
||||
__u32 k;
|
||||
};
|
||||
|
||||
struct sock_fprog
|
||||
{
|
||||
unsigned short len;
|
||||
struct sock_filter __user *filter;
|
||||
};
|
||||
|
||||
#define BPF_CLASS(code) ((code) & 0x07)
|
||||
#define BPF_LD 0x00
|
||||
#define BPF_LDX 0x01
|
||||
#define BPF_ST 0x02
|
||||
#define BPF_STX 0x03
|
||||
#define BPF_ALU 0x04
|
||||
#define BPF_JMP 0x05
|
||||
#define BPF_RET 0x06
|
||||
#define BPF_MISC 0x07
|
||||
|
||||
#define BPF_SIZE(code) ((code) & 0x18)
|
||||
#define BPF_W 0x00
|
||||
#define BPF_H 0x08
|
||||
#define BPF_B 0x10
|
||||
#define BPF_MODE(code) ((code) & 0xe0)
|
||||
#define BPF_IMM 0x00
|
||||
#define BPF_ABS 0x20
|
||||
#define BPF_IND 0x40
|
||||
#define BPF_MEM 0x60
|
||||
#define BPF_LEN 0x80
|
||||
#define BPF_MSH 0xa0
|
||||
|
||||
#define BPF_OP(code) ((code) & 0xf0)
|
||||
#define BPF_ADD 0x00
|
||||
#define BPF_SUB 0x10
|
||||
#define BPF_MUL 0x20
|
||||
#define BPF_DIV 0x30
|
||||
#define BPF_OR 0x40
|
||||
#define BPF_AND 0x50
|
||||
#define BPF_LSH 0x60
|
||||
#define BPF_RSH 0x70
|
||||
#define BPF_NEG 0x80
|
||||
#define BPF_JA 0x00
|
||||
#define BPF_JEQ 0x10
|
||||
#define BPF_JGT 0x20
|
||||
#define BPF_JGE 0x30
|
||||
#define BPF_JSET 0x40
|
||||
#define BPF_SRC(code) ((code) & 0x08)
|
||||
#define BPF_K 0x00
|
||||
#define BPF_X 0x08
|
||||
|
||||
#define BPF_RVAL(code) ((code) & 0x18)
|
||||
#define BPF_A 0x10
|
||||
|
||||
#define BPF_MISCOP(code) ((code) & 0xf8)
|
||||
#define BPF_TAX 0x00
|
||||
#define BPF_TXA 0x80
|
||||
|
||||
#ifndef BPF_MAXINSNS
|
||||
#define BPF_MAXINSNS 4096
|
||||
#endif
|
||||
|
||||
#ifndef BPF_STMT
|
||||
#define BPF_STMT(code, k) { (unsigned short)(code), 0, 0, k }
|
||||
#endif
|
||||
#ifndef BPF_JUMP
|
||||
#define BPF_JUMP(code, k, jt, jf) { (unsigned short)(code), jt, jf, k }
|
||||
#endif
|
||||
|
||||
#define BPF_MEMWORDS 16
|
||||
|
||||
#define SKF_AD_OFF (-0x1000)
|
||||
#define SKF_AD_PROTOCOL 0
|
||||
#define SKF_AD_PKTTYPE 4
|
||||
#define SKF_AD_IFINDEX 8
|
||||
#define SKF_AD_MAX 12
|
||||
#define SKF_NET_OFF (-0x100000)
|
||||
#define SKF_LL_OFF (-0x200000)
|
||||
|
||||
#endif
|
162
libc/kernel/common/linux/fs.h
Normal file
162
libc/kernel/common/linux/fs.h
Normal file
@@ -0,0 +1,162 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_FS_H
|
||||
#define _LINUX_FS_H
|
||||
|
||||
#include <linux/limits.h>
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#undef NR_OPEN
|
||||
#define NR_OPEN (1024*1024)
|
||||
#define INR_OPEN 1024
|
||||
|
||||
#define BLOCK_SIZE_BITS 10
|
||||
#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
|
||||
|
||||
#define SEEK_SET 0
|
||||
#define SEEK_CUR 1
|
||||
#define SEEK_END 2
|
||||
|
||||
struct files_stat_struct {
|
||||
int nr_files;
|
||||
int nr_free_files;
|
||||
int max_files;
|
||||
};
|
||||
|
||||
struct inodes_stat_t {
|
||||
int nr_inodes;
|
||||
int nr_unused;
|
||||
int dummy[5];
|
||||
};
|
||||
|
||||
#define NR_FILE 8192
|
||||
|
||||
#define MAY_EXEC 1
|
||||
#define MAY_WRITE 2
|
||||
#define MAY_READ 4
|
||||
#define MAY_APPEND 8
|
||||
|
||||
#define FMODE_READ 1
|
||||
#define FMODE_WRITE 2
|
||||
|
||||
#define FMODE_LSEEK 4
|
||||
#define FMODE_PREAD 8
|
||||
#define FMODE_PWRITE FMODE_PREAD
|
||||
|
||||
#define FMODE_EXEC 16
|
||||
|
||||
#define RW_MASK 1
|
||||
#define RWA_MASK 2
|
||||
#define READ 0
|
||||
#define WRITE 1
|
||||
#define READA 2
|
||||
#define SWRITE 3
|
||||
#define SPECIAL 4
|
||||
#define READ_SYNC (READ | (1 << BIO_RW_SYNC))
|
||||
#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC))
|
||||
#define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER))
|
||||
|
||||
#define SEL_IN 1
|
||||
#define SEL_OUT 2
|
||||
#define SEL_EX 4
|
||||
|
||||
#define FS_REQUIRES_DEV 1
|
||||
#define FS_BINARY_MOUNTDATA 2
|
||||
#define FS_REVAL_DOT 16384
|
||||
#define FS_ODD_RENAME 32768
|
||||
|
||||
#define MS_RDONLY 1
|
||||
#define MS_NOSUID 2
|
||||
#define MS_NODEV 4
|
||||
#define MS_NOEXEC 8
|
||||
#define MS_SYNCHRONOUS 16
|
||||
#define MS_REMOUNT 32
|
||||
#define MS_MANDLOCK 64
|
||||
#define MS_DIRSYNC 128
|
||||
#define MS_NOATIME 1024
|
||||
#define MS_NODIRATIME 2048
|
||||
#define MS_BIND 4096
|
||||
#define MS_MOVE 8192
|
||||
#define MS_REC 16384
|
||||
#define MS_VERBOSE 32768
|
||||
#define MS_SILENT 32768
|
||||
#define MS_POSIXACL (1<<16)
|
||||
#define MS_UNBINDABLE (1<<17)
|
||||
#define MS_PRIVATE (1<<18)
|
||||
#define MS_SLAVE (1<<19)
|
||||
#define MS_SHARED (1<<20)
|
||||
#define MS_ACTIVE (1<<30)
|
||||
#define MS_NOUSER (1<<31)
|
||||
|
||||
#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK)
|
||||
|
||||
#define MS_MGC_VAL 0xC0ED0000
|
||||
#define MS_MGC_MSK 0xffff0000
|
||||
|
||||
#define S_SYNC 1
|
||||
#define S_NOATIME 2
|
||||
#define S_APPEND 4
|
||||
#define S_IMMUTABLE 8
|
||||
#define S_DEAD 16
|
||||
#define S_NOQUOTA 32
|
||||
#define S_DIRSYNC 64
|
||||
#define S_NOCMTIME 128
|
||||
#define S_SWAPFILE 256
|
||||
#define S_PRIVATE 512
|
||||
|
||||
#define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg))
|
||||
|
||||
#define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY)
|
||||
#define IS_SYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS) || ((inode)->i_flags & S_SYNC))
|
||||
#define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || ((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
|
||||
#define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK)
|
||||
|
||||
#define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA)
|
||||
#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
|
||||
#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
|
||||
#define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL)
|
||||
|
||||
#define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD)
|
||||
#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME)
|
||||
#define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE)
|
||||
#define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE)
|
||||
|
||||
#define BLKROSET _IO(0x12,93)
|
||||
#define BLKROGET _IO(0x12,94)
|
||||
#define BLKRRPART _IO(0x12,95)
|
||||
#define BLKGETSIZE _IO(0x12,96)
|
||||
#define BLKFLSBUF _IO(0x12,97)
|
||||
#define BLKRASET _IO(0x12,98)
|
||||
#define BLKRAGET _IO(0x12,99)
|
||||
#define BLKFRASET _IO(0x12,100)
|
||||
#define BLKFRAGET _IO(0x12,101)
|
||||
#define BLKSECTSET _IO(0x12,102)
|
||||
#define BLKSECTGET _IO(0x12,103)
|
||||
#define BLKSSZGET _IO(0x12,104)
|
||||
|
||||
#define BLKBSZGET _IOR(0x12,112,size_t)
|
||||
#define BLKBSZSET _IOW(0x12,113,size_t)
|
||||
#define BLKGETSIZE64 _IOR(0x12,114,size_t)
|
||||
#define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup)
|
||||
#define BLKTRACESTART _IO(0x12,116)
|
||||
#define BLKTRACESTOP _IO(0x12,117)
|
||||
#define BLKTRACETEARDOWN _IO(0x12,118)
|
||||
|
||||
#define BMAP_IOCTL 1
|
||||
#define FIBMAP _IO(0x00,1)
|
||||
#define FIGETBSZ _IO(0x00,2)
|
||||
|
||||
#define SYNC_FILE_RANGE_WAIT_BEFORE 1
|
||||
#define SYNC_FILE_RANGE_WRITE 2
|
||||
#define SYNC_FILE_RANGE_WAIT_AFTER 4
|
||||
|
||||
#endif
|
51
libc/kernel/common/linux/ftape.h
Normal file
51
libc/kernel/common/linux/ftape.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _FTAPE_H
|
||||
#define _FTAPE_H
|
||||
|
||||
#define FTAPE_VERSION "ftape v3.04d 25/11/97"
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/mtio.h>
|
||||
|
||||
#define FT_SECTOR(x) (x+1)
|
||||
#define FT_SECTOR_SIZE 1024
|
||||
#define FT_SECTORS_PER_SEGMENT 32
|
||||
#define FT_ECC_SECTORS 3
|
||||
#define FT_SEGMENT_SIZE ((FT_SECTORS_PER_SEGMENT - FT_ECC_SECTORS) * FT_SECTOR_SIZE)
|
||||
#define FT_BUFF_SIZE (FT_SECTORS_PER_SEGMENT * FT_SECTOR_SIZE)
|
||||
|
||||
#define FTAPE_SEL_A 0
|
||||
#define FTAPE_SEL_B 1
|
||||
#define FTAPE_SEL_C 2
|
||||
#define FTAPE_SEL_D 3
|
||||
#define FTAPE_SEL_MASK 3
|
||||
#define FTAPE_SEL(unit) ((unit) & FTAPE_SEL_MASK)
|
||||
#define FTAPE_NO_REWIND 4
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
__u8 error;
|
||||
__u8 command;
|
||||
} error;
|
||||
long space;
|
||||
} ft_drive_error;
|
||||
typedef union {
|
||||
struct {
|
||||
__u8 drive_status;
|
||||
__u8 drive_config;
|
||||
__u8 tape_status;
|
||||
} status;
|
||||
long space;
|
||||
} ft_drive_status;
|
||||
|
||||
#endif
|
61
libc/kernel/common/linux/futex.h
Normal file
61
libc/kernel/common/linux/futex.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_FUTEX_H
|
||||
#define _LINUX_FUTEX_H
|
||||
|
||||
#include <linux/sched.h>
|
||||
|
||||
#define FUTEX_WAIT 0
|
||||
#define FUTEX_WAKE 1
|
||||
#define FUTEX_FD 2
|
||||
#define FUTEX_REQUEUE 3
|
||||
#define FUTEX_CMP_REQUEUE 4
|
||||
#define FUTEX_WAKE_OP 5
|
||||
#define FUTEX_LOCK_PI 6
|
||||
#define FUTEX_UNLOCK_PI 7
|
||||
#define FUTEX_TRYLOCK_PI 8
|
||||
|
||||
struct robust_list {
|
||||
struct robust_list __user *next;
|
||||
};
|
||||
|
||||
struct robust_list_head {
|
||||
|
||||
struct robust_list list;
|
||||
|
||||
long futex_offset;
|
||||
|
||||
struct robust_list __user *list_op_pending;
|
||||
};
|
||||
|
||||
#define FUTEX_WAITERS 0x80000000
|
||||
|
||||
#define FUTEX_OWNER_DIED 0x40000000
|
||||
|
||||
#define FUTEX_TID_MASK 0x3fffffff
|
||||
|
||||
#define ROBUST_LIST_LIMIT 2048
|
||||
|
||||
#define FUTEX_OP_SET 0
|
||||
#define FUTEX_OP_ADD 1
|
||||
#define FUTEX_OP_OR 2
|
||||
#define FUTEX_OP_ANDN 3
|
||||
#define FUTEX_OP_XOR 4
|
||||
#define FUTEX_OP_OPARG_SHIFT 8
|
||||
#define FUTEX_OP_CMP_EQ 0
|
||||
#define FUTEX_OP_CMP_NE 1
|
||||
#define FUTEX_OP_CMP_LT 2
|
||||
#define FUTEX_OP_CMP_LE 3
|
||||
#define FUTEX_OP_CMP_GT 4
|
||||
#define FUTEX_OP_CMP_GE 5
|
||||
#define FUTEX_OP(op, oparg, cmp, cmparg) (((op & 0xf) << 28) | ((cmp & 0xf) << 24) | ((oparg & 0xfff) << 12) | (cmparg & 0xfff))
|
||||
#endif
|
55
libc/kernel/common/linux/genhd.h
Normal file
55
libc/kernel/common/linux/genhd.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_GENHD_H
|
||||
#define _LINUX_GENHD_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
enum {
|
||||
|
||||
DOS_EXTENDED_PARTITION = 5,
|
||||
LINUX_EXTENDED_PARTITION = 0x85,
|
||||
WIN98_EXTENDED_PARTITION = 0x0f,
|
||||
|
||||
LINUX_SWAP_PARTITION = 0x82,
|
||||
LINUX_RAID_PARTITION = 0xfd,
|
||||
|
||||
SOLARIS_X86_PARTITION = LINUX_SWAP_PARTITION,
|
||||
NEW_SOLARIS_X86_PARTITION = 0xbf,
|
||||
|
||||
DM6_AUX1PARTITION = 0x51,
|
||||
DM6_AUX3PARTITION = 0x53,
|
||||
DM6_PARTITION = 0x54,
|
||||
EZD_PARTITION = 0x55,
|
||||
|
||||
FREEBSD_PARTITION = 0xa5,
|
||||
OPENBSD_PARTITION = 0xa6,
|
||||
NETBSD_PARTITION = 0xa9,
|
||||
BSDI_PARTITION = 0xb7,
|
||||
MINIX_PARTITION = 0x81,
|
||||
UNIXWARE_PARTITION = 0x63,
|
||||
};
|
||||
|
||||
struct partition {
|
||||
unsigned char boot_ind;
|
||||
unsigned char head;
|
||||
unsigned char sector;
|
||||
unsigned char cyl;
|
||||
unsigned char sys_ind;
|
||||
unsigned char end_head;
|
||||
unsigned char end_sector;
|
||||
unsigned char end_cyl;
|
||||
unsigned int start_sect;
|
||||
unsigned int nr_sects;
|
||||
} __attribute__((packed));
|
||||
|
||||
#endif
|
76
libc/kernel/common/linux/gfp.h
Normal file
76
libc/kernel/common/linux/gfp.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __LINUX_GFP_H
|
||||
#define __LINUX_GFP_H
|
||||
|
||||
#include <linux/mmzone.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
struct vm_area_struct;
|
||||
|
||||
#define __GFP_DMA ((__force gfp_t)0x01u)
|
||||
#define __GFP_HIGHMEM ((__force gfp_t)0x02u)
|
||||
#if BITS_PER_LONG < 64
|
||||
#define __GFP_DMA32 ((__force gfp_t)0x00)
|
||||
#else
|
||||
#define __GFP_DMA32 ((__force gfp_t)0x04)
|
||||
#endif
|
||||
|
||||
#define __GFP_WAIT ((__force gfp_t)0x10u)
|
||||
#define __GFP_HIGH ((__force gfp_t)0x20u)
|
||||
#define __GFP_IO ((__force gfp_t)0x40u)
|
||||
#define __GFP_FS ((__force gfp_t)0x80u)
|
||||
#define __GFP_COLD ((__force gfp_t)0x100u)
|
||||
#define __GFP_NOWARN ((__force gfp_t)0x200u)
|
||||
#define __GFP_REPEAT ((__force gfp_t)0x400u)
|
||||
#define __GFP_NOFAIL ((__force gfp_t)0x800u)
|
||||
#define __GFP_NORETRY ((__force gfp_t)0x1000u)
|
||||
#define __GFP_NO_GROW ((__force gfp_t)0x2000u)
|
||||
#define __GFP_COMP ((__force gfp_t)0x4000u)
|
||||
#define __GFP_ZERO ((__force gfp_t)0x8000u)
|
||||
#define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u)
|
||||
#define __GFP_HARDWALL ((__force gfp_t)0x20000u)
|
||||
|
||||
#define __GFP_BITS_SHIFT 20
|
||||
#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
|
||||
|
||||
#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| __GFP_NOMEMALLOC|__GFP_HARDWALL)
|
||||
|
||||
#define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH)
|
||||
|
||||
#define GFP_ATOMIC (__GFP_HIGH)
|
||||
#define GFP_NOIO (__GFP_WAIT)
|
||||
#define GFP_NOFS (__GFP_WAIT | __GFP_IO)
|
||||
#define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS)
|
||||
#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
|
||||
#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | __GFP_HIGHMEM)
|
||||
|
||||
#define GFP_DMA __GFP_DMA
|
||||
|
||||
#define GFP_DMA32 __GFP_DMA32
|
||||
|
||||
#ifndef HAVE_ARCH_FREE_PAGE
|
||||
#endif
|
||||
|
||||
#define alloc_pages(gfp_mask, order) alloc_pages_node(numa_node_id(), gfp_mask, order)
|
||||
#define alloc_page_vma(gfp_mask, vma, addr) alloc_pages(gfp_mask, 0)
|
||||
#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0)
|
||||
|
||||
#define __get_free_page(gfp_mask) __get_free_pages((gfp_mask),0)
|
||||
|
||||
#define __get_dma_pages(gfp_mask, order) __get_free_pages((gfp_mask) | GFP_DMA,(order))
|
||||
|
||||
#define __free_page(page) __free_pages((page), 0)
|
||||
#define free_page(addr) free_pages((addr),0)
|
||||
|
||||
#endif
|
73
libc/kernel/common/linux/hardirq.h
Normal file
73
libc/kernel/common/linux/hardirq.h
Normal file
@@ -0,0 +1,73 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef LINUX_HARDIRQ_H
|
||||
#define LINUX_HARDIRQ_H
|
||||
|
||||
#include <linux/preempt.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/lockdep.h>
|
||||
#include <asm/hardirq.h>
|
||||
#include <asm/system.h>
|
||||
|
||||
#define PREEMPT_BITS 8
|
||||
#define SOFTIRQ_BITS 8
|
||||
|
||||
#ifndef HARDIRQ_BITS
|
||||
#define HARDIRQ_BITS 12
|
||||
|
||||
#if 1 << HARDIRQ_BITS < NR_IRQS
|
||||
#error HARDIRQ_BITS is too low!
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define PREEMPT_SHIFT 0
|
||||
#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS)
|
||||
#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
|
||||
|
||||
#define __IRQ_MASK(x) ((1UL << (x))-1)
|
||||
|
||||
#define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
|
||||
#define SOFTIRQ_MASK (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
|
||||
#define HARDIRQ_MASK (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
|
||||
|
||||
#define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT)
|
||||
#define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT)
|
||||
#define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT)
|
||||
|
||||
#if PREEMPT_ACTIVE < 1 << HARDIRQ_SHIFT + HARDIRQ_BITS
|
||||
#error PREEMPT_ACTIVE is too low!
|
||||
#endif
|
||||
|
||||
#define hardirq_count() (preempt_count() & HARDIRQ_MASK)
|
||||
#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
|
||||
#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
|
||||
|
||||
#define in_irq() (hardirq_count())
|
||||
#define in_softirq() (softirq_count())
|
||||
#define in_interrupt() (irq_count())
|
||||
|
||||
#define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0)
|
||||
|
||||
#define preemptible() 0
|
||||
#define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
|
||||
|
||||
#define synchronize_irq(irq) barrier()
|
||||
|
||||
struct task_struct;
|
||||
|
||||
#define irq_enter() do { account_system_vtime(current); add_preempt_count(HARDIRQ_OFFSET); trace_hardirq_enter(); } while (0)
|
||||
#define __irq_exit() do { trace_hardirq_exit(); account_system_vtime(current); sub_preempt_count(HARDIRQ_OFFSET); } while (0)
|
||||
|
||||
#define nmi_enter() do { lockdep_off(); irq_enter(); } while (0)
|
||||
#define nmi_exit() do { __irq_exit(); lockdep_on(); } while (0)
|
||||
|
||||
#endif
|
57
libc/kernel/common/linux/hdlc/ioctl.h
Normal file
57
libc/kernel/common/linux/hdlc/ioctl.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __HDLC_IOCTL_H__
|
||||
#define __HDLC_IOCTL_H__
|
||||
|
||||
typedef struct {
|
||||
unsigned int clock_rate;
|
||||
unsigned int clock_type;
|
||||
unsigned short loopback;
|
||||
} sync_serial_settings;
|
||||
|
||||
typedef struct {
|
||||
unsigned int clock_rate;
|
||||
unsigned int clock_type;
|
||||
unsigned short loopback;
|
||||
unsigned int slot_map;
|
||||
} te1_settings;
|
||||
|
||||
typedef struct {
|
||||
unsigned short encoding;
|
||||
unsigned short parity;
|
||||
} raw_hdlc_proto;
|
||||
|
||||
typedef struct {
|
||||
unsigned int t391;
|
||||
unsigned int t392;
|
||||
unsigned int n391;
|
||||
unsigned int n392;
|
||||
unsigned int n393;
|
||||
unsigned short lmi;
|
||||
unsigned short dce;
|
||||
} fr_proto;
|
||||
|
||||
typedef struct {
|
||||
unsigned int dlci;
|
||||
} fr_proto_pvc;
|
||||
|
||||
typedef struct {
|
||||
unsigned int dlci;
|
||||
char master[IFNAMSIZ];
|
||||
}fr_proto_pvc_info;
|
||||
|
||||
typedef struct {
|
||||
unsigned int interval;
|
||||
unsigned int timeout;
|
||||
} cisco_proto;
|
||||
|
||||
#endif
|
432
libc/kernel/common/linux/hdreg.h
Normal file
432
libc/kernel/common/linux/hdreg.h
Normal file
@@ -0,0 +1,432 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_HDREG_H
|
||||
#define _LINUX_HDREG_H
|
||||
|
||||
#define HDIO_DRIVE_CMD_HDR_SIZE (4 * sizeof(u8))
|
||||
#define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(u8))
|
||||
#define HDIO_DRIVE_TASK_HDR_SIZE (8 * sizeof(u8))
|
||||
|
||||
#define IDE_DRIVE_TASK_INVALID -1
|
||||
#define IDE_DRIVE_TASK_NO_DATA 0
|
||||
#define IDE_DRIVE_TASK_SET_XFER 1
|
||||
|
||||
#define IDE_DRIVE_TASK_IN 2
|
||||
|
||||
#define IDE_DRIVE_TASK_OUT 3
|
||||
#define IDE_DRIVE_TASK_RAW_WRITE 4
|
||||
|
||||
#define IDE_TASKFILE_STD_IN_FLAGS 0xFE
|
||||
#define IDE_HOB_STD_IN_FLAGS 0x3C
|
||||
#define IDE_TASKFILE_STD_OUT_FLAGS 0xFE
|
||||
#define IDE_HOB_STD_OUT_FLAGS 0x3C
|
||||
|
||||
typedef unsigned char task_ioreg_t;
|
||||
typedef unsigned long sata_ioreg_t;
|
||||
|
||||
typedef union ide_reg_valid_s {
|
||||
unsigned all : 16;
|
||||
struct {
|
||||
unsigned data : 1;
|
||||
unsigned error_feature : 1;
|
||||
unsigned sector : 1;
|
||||
unsigned nsector : 1;
|
||||
unsigned lcyl : 1;
|
||||
unsigned hcyl : 1;
|
||||
unsigned select : 1;
|
||||
unsigned status_command : 1;
|
||||
|
||||
unsigned data_hob : 1;
|
||||
unsigned error_feature_hob : 1;
|
||||
unsigned sector_hob : 1;
|
||||
unsigned nsector_hob : 1;
|
||||
unsigned lcyl_hob : 1;
|
||||
unsigned hcyl_hob : 1;
|
||||
unsigned select_hob : 1;
|
||||
unsigned control_hob : 1;
|
||||
} b;
|
||||
} ide_reg_valid_t;
|
||||
|
||||
typedef struct ide_task_request_s {
|
||||
task_ioreg_t io_ports[8];
|
||||
task_ioreg_t hob_ports[8];
|
||||
ide_reg_valid_t out_flags;
|
||||
ide_reg_valid_t in_flags;
|
||||
int data_phase;
|
||||
int req_cmd;
|
||||
unsigned long out_size;
|
||||
unsigned long in_size;
|
||||
} ide_task_request_t;
|
||||
|
||||
typedef struct ide_ioctl_request_s {
|
||||
ide_task_request_t *task_request;
|
||||
unsigned char *out_buffer;
|
||||
unsigned char *in_buffer;
|
||||
} ide_ioctl_request_t;
|
||||
|
||||
struct hd_drive_cmd_hdr {
|
||||
task_ioreg_t command;
|
||||
task_ioreg_t sector_number;
|
||||
task_ioreg_t feature;
|
||||
task_ioreg_t sector_count;
|
||||
};
|
||||
|
||||
typedef struct hd_drive_task_hdr {
|
||||
task_ioreg_t data;
|
||||
task_ioreg_t feature;
|
||||
task_ioreg_t sector_count;
|
||||
task_ioreg_t sector_number;
|
||||
task_ioreg_t low_cylinder;
|
||||
task_ioreg_t high_cylinder;
|
||||
task_ioreg_t device_head;
|
||||
task_ioreg_t command;
|
||||
} task_struct_t;
|
||||
|
||||
typedef struct hd_drive_hob_hdr {
|
||||
task_ioreg_t data;
|
||||
task_ioreg_t feature;
|
||||
task_ioreg_t sector_count;
|
||||
task_ioreg_t sector_number;
|
||||
task_ioreg_t low_cylinder;
|
||||
task_ioreg_t high_cylinder;
|
||||
task_ioreg_t device_head;
|
||||
task_ioreg_t control;
|
||||
} hob_struct_t;
|
||||
|
||||
#define TASKFILE_INVALID 0x7fff
|
||||
#define TASKFILE_48 0x8000
|
||||
|
||||
#define TASKFILE_NO_DATA 0x0000
|
||||
|
||||
#define TASKFILE_IN 0x0001
|
||||
#define TASKFILE_MULTI_IN 0x0002
|
||||
|
||||
#define TASKFILE_OUT 0x0004
|
||||
#define TASKFILE_MULTI_OUT 0x0008
|
||||
#define TASKFILE_IN_OUT 0x0010
|
||||
|
||||
#define TASKFILE_IN_DMA 0x0020
|
||||
#define TASKFILE_OUT_DMA 0x0040
|
||||
#define TASKFILE_IN_DMAQ 0x0080
|
||||
#define TASKFILE_OUT_DMAQ 0x0100
|
||||
|
||||
#define TASKFILE_P_IN 0x0200
|
||||
#define TASKFILE_P_OUT 0x0400
|
||||
#define TASKFILE_P_IN_DMA 0x0800
|
||||
#define TASKFILE_P_OUT_DMA 0x1000
|
||||
#define TASKFILE_P_IN_DMAQ 0x2000
|
||||
#define TASKFILE_P_OUT_DMAQ 0x4000
|
||||
|
||||
#define WIN_NOP 0x00
|
||||
|
||||
#define CFA_REQ_EXT_ERROR_CODE 0x03
|
||||
|
||||
#define WIN_SRST 0x08
|
||||
#define WIN_DEVICE_RESET 0x08
|
||||
|
||||
#define WIN_RECAL 0x10
|
||||
#define WIN_RESTORE WIN_RECAL
|
||||
|
||||
#define WIN_READ 0x20
|
||||
#define WIN_READ_ONCE 0x21
|
||||
#define WIN_READ_LONG 0x22
|
||||
#define WIN_READ_LONG_ONCE 0x23
|
||||
#define WIN_READ_EXT 0x24
|
||||
#define WIN_READDMA_EXT 0x25
|
||||
#define WIN_READDMA_QUEUED_EXT 0x26
|
||||
#define WIN_READ_NATIVE_MAX_EXT 0x27
|
||||
|
||||
#define WIN_MULTREAD_EXT 0x29
|
||||
|
||||
#define WIN_WRITE 0x30
|
||||
#define WIN_WRITE_ONCE 0x31
|
||||
#define WIN_WRITE_LONG 0x32
|
||||
#define WIN_WRITE_LONG_ONCE 0x33
|
||||
#define WIN_WRITE_EXT 0x34
|
||||
#define WIN_WRITEDMA_EXT 0x35
|
||||
#define WIN_WRITEDMA_QUEUED_EXT 0x36
|
||||
#define WIN_SET_MAX_EXT 0x37
|
||||
#define CFA_WRITE_SECT_WO_ERASE 0x38
|
||||
#define WIN_MULTWRITE_EXT 0x39
|
||||
|
||||
#define WIN_WRITE_VERIFY 0x3C
|
||||
|
||||
#define WIN_VERIFY 0x40
|
||||
#define WIN_VERIFY_ONCE 0x41
|
||||
#define WIN_VERIFY_EXT 0x42
|
||||
|
||||
#define WIN_FORMAT 0x50
|
||||
|
||||
#define WIN_INIT 0x60
|
||||
|
||||
#define WIN_SEEK 0x70
|
||||
|
||||
#define CFA_TRANSLATE_SECTOR 0x87
|
||||
#define WIN_DIAGNOSE 0x90
|
||||
#define WIN_SPECIFY 0x91
|
||||
#define WIN_DOWNLOAD_MICROCODE 0x92
|
||||
#define WIN_STANDBYNOW2 0x94
|
||||
#define WIN_STANDBY2 0x96
|
||||
#define WIN_SETIDLE2 0x97
|
||||
#define WIN_CHECKPOWERMODE2 0x98
|
||||
#define WIN_SLEEPNOW2 0x99
|
||||
|
||||
#define WIN_PACKETCMD 0xA0
|
||||
#define WIN_PIDENTIFY 0xA1
|
||||
#define WIN_QUEUED_SERVICE 0xA2
|
||||
#define WIN_SMART 0xB0
|
||||
#define CFA_ERASE_SECTORS 0xC0
|
||||
#define WIN_MULTREAD 0xC4
|
||||
#define WIN_MULTWRITE 0xC5
|
||||
#define WIN_SETMULT 0xC6
|
||||
#define WIN_READDMA_QUEUED 0xC7
|
||||
#define WIN_READDMA 0xC8
|
||||
#define WIN_READDMA_ONCE 0xC9
|
||||
#define WIN_WRITEDMA 0xCA
|
||||
#define WIN_WRITEDMA_ONCE 0xCB
|
||||
#define WIN_WRITEDMA_QUEUED 0xCC
|
||||
#define CFA_WRITE_MULTI_WO_ERASE 0xCD
|
||||
#define WIN_GETMEDIASTATUS 0xDA
|
||||
#define WIN_ACKMEDIACHANGE 0xDB
|
||||
#define WIN_POSTBOOT 0xDC
|
||||
#define WIN_PREBOOT 0xDD
|
||||
#define WIN_DOORLOCK 0xDE
|
||||
#define WIN_DOORUNLOCK 0xDF
|
||||
#define WIN_STANDBYNOW1 0xE0
|
||||
#define WIN_IDLEIMMEDIATE 0xE1
|
||||
#define WIN_STANDBY 0xE2
|
||||
#define WIN_SETIDLE1 0xE3
|
||||
#define WIN_READ_BUFFER 0xE4
|
||||
#define WIN_CHECKPOWERMODE1 0xE5
|
||||
#define WIN_SLEEPNOW1 0xE6
|
||||
#define WIN_FLUSH_CACHE 0xE7
|
||||
#define WIN_WRITE_BUFFER 0xE8
|
||||
#define WIN_WRITE_SAME 0xE9
|
||||
|
||||
#define WIN_FLUSH_CACHE_EXT 0xEA
|
||||
#define WIN_IDENTIFY 0xEC
|
||||
#define WIN_MEDIAEJECT 0xED
|
||||
#define WIN_IDENTIFY_DMA 0xEE
|
||||
#define WIN_SETFEATURES 0xEF
|
||||
#define EXABYTE_ENABLE_NEST 0xF0
|
||||
#define WIN_SECURITY_SET_PASS 0xF1
|
||||
#define WIN_SECURITY_UNLOCK 0xF2
|
||||
#define WIN_SECURITY_ERASE_PREPARE 0xF3
|
||||
#define WIN_SECURITY_ERASE_UNIT 0xF4
|
||||
#define WIN_SECURITY_FREEZE_LOCK 0xF5
|
||||
#define WIN_SECURITY_DISABLE 0xF6
|
||||
#define WIN_READ_NATIVE_MAX 0xF8
|
||||
#define WIN_SET_MAX 0xF9
|
||||
#define DISABLE_SEAGATE 0xFB
|
||||
|
||||
#define SMART_READ_VALUES 0xD0
|
||||
#define SMART_READ_THRESHOLDS 0xD1
|
||||
#define SMART_AUTOSAVE 0xD2
|
||||
#define SMART_SAVE 0xD3
|
||||
#define SMART_IMMEDIATE_OFFLINE 0xD4
|
||||
#define SMART_READ_LOG_SECTOR 0xD5
|
||||
#define SMART_WRITE_LOG_SECTOR 0xD6
|
||||
#define SMART_WRITE_THRESHOLDS 0xD7
|
||||
#define SMART_ENABLE 0xD8
|
||||
#define SMART_DISABLE 0xD9
|
||||
#define SMART_STATUS 0xDA
|
||||
#define SMART_AUTO_OFFLINE 0xDB
|
||||
|
||||
#define SMART_LCYL_PASS 0x4F
|
||||
#define SMART_HCYL_PASS 0xC2
|
||||
|
||||
#define SETFEATURES_EN_8BIT 0x01
|
||||
#define SETFEATURES_EN_WCACHE 0x02
|
||||
#define SETFEATURES_DIS_DEFECT 0x04
|
||||
#define SETFEATURES_EN_APM 0x05
|
||||
#define SETFEATURES_EN_SAME_R 0x22
|
||||
#define SETFEATURES_DIS_MSN 0x31
|
||||
#define SETFEATURES_DIS_RETRY 0x33
|
||||
#define SETFEATURES_EN_AAM 0x42
|
||||
#define SETFEATURES_RW_LONG 0x44
|
||||
#define SETFEATURES_SET_CACHE 0x54
|
||||
#define SETFEATURES_DIS_RLA 0x55
|
||||
#define SETFEATURES_EN_RI 0x5D
|
||||
#define SETFEATURES_EN_SI 0x5E
|
||||
#define SETFEATURES_DIS_RPOD 0x66
|
||||
#define SETFEATURES_DIS_ECC 0x77
|
||||
#define SETFEATURES_DIS_8BIT 0x81
|
||||
#define SETFEATURES_DIS_WCACHE 0x82
|
||||
#define SETFEATURES_EN_DEFECT 0x84
|
||||
#define SETFEATURES_DIS_APM 0x85
|
||||
#define SETFEATURES_EN_ECC 0x88
|
||||
#define SETFEATURES_EN_MSN 0x95
|
||||
#define SETFEATURES_EN_RETRY 0x99
|
||||
#define SETFEATURES_EN_RLA 0xAA
|
||||
#define SETFEATURES_PREFETCH 0xAB
|
||||
#define SETFEATURES_EN_REST 0xAC
|
||||
#define SETFEATURES_4B_RW_LONG 0xBB
|
||||
#define SETFEATURES_DIS_AAM 0xC2
|
||||
#define SETFEATURES_EN_RPOD 0xCC
|
||||
#define SETFEATURES_DIS_RI 0xDD
|
||||
#define SETFEATURES_EN_SAME_M 0xDD
|
||||
#define SETFEATURES_DIS_SI 0xDE
|
||||
|
||||
#define SECURITY_SET_PASSWORD 0xBA
|
||||
#define SECURITY_UNLOCK 0xBB
|
||||
#define SECURITY_ERASE_PREPARE 0xBC
|
||||
#define SECURITY_ERASE_UNIT 0xBD
|
||||
#define SECURITY_FREEZE_LOCK 0xBE
|
||||
#define SECURITY_DISABLE_PASSWORD 0xBF
|
||||
|
||||
struct hd_geometry {
|
||||
unsigned char heads;
|
||||
unsigned char sectors;
|
||||
unsigned short cylinders;
|
||||
unsigned long start;
|
||||
};
|
||||
|
||||
#define HDIO_GETGEO 0x0301
|
||||
#define HDIO_GET_UNMASKINTR 0x0302
|
||||
#define HDIO_GET_MULTCOUNT 0x0304
|
||||
#define HDIO_GET_QDMA 0x0305
|
||||
|
||||
#define HDIO_SET_XFER 0x0306
|
||||
|
||||
#define HDIO_OBSOLETE_IDENTITY 0x0307
|
||||
#define HDIO_GET_KEEPSETTINGS 0x0308
|
||||
#define HDIO_GET_32BIT 0x0309
|
||||
#define HDIO_GET_NOWERR 0x030a
|
||||
#define HDIO_GET_DMA 0x030b
|
||||
#define HDIO_GET_NICE 0x030c
|
||||
#define HDIO_GET_IDENTITY 0x030d
|
||||
#define HDIO_GET_WCACHE 0x030e
|
||||
#define HDIO_GET_ACOUSTIC 0x030f
|
||||
#define HDIO_GET_ADDRESS 0x0310
|
||||
|
||||
#define HDIO_GET_BUSSTATE 0x031a
|
||||
#define HDIO_TRISTATE_HWIF 0x031b
|
||||
#define HDIO_DRIVE_RESET 0x031c
|
||||
#define HDIO_DRIVE_TASKFILE 0x031d
|
||||
#define HDIO_DRIVE_TASK 0x031e
|
||||
#define HDIO_DRIVE_CMD 0x031f
|
||||
#define HDIO_DRIVE_CMD_AEB HDIO_DRIVE_TASK
|
||||
|
||||
#define HDIO_SET_MULTCOUNT 0x0321
|
||||
#define HDIO_SET_UNMASKINTR 0x0322
|
||||
#define HDIO_SET_KEEPSETTINGS 0x0323
|
||||
#define HDIO_SET_32BIT 0x0324
|
||||
#define HDIO_SET_NOWERR 0x0325
|
||||
#define HDIO_SET_DMA 0x0326
|
||||
#define HDIO_SET_PIO_MODE 0x0327
|
||||
#define HDIO_SCAN_HWIF 0x0328
|
||||
#define HDIO_SET_NICE 0x0329
|
||||
#define HDIO_UNREGISTER_HWIF 0x032a
|
||||
#define HDIO_SET_WCACHE 0x032b
|
||||
#define HDIO_SET_ACOUSTIC 0x032c
|
||||
#define HDIO_SET_BUSSTATE 0x032d
|
||||
#define HDIO_SET_QDMA 0x032e
|
||||
#define HDIO_SET_ADDRESS 0x032f
|
||||
|
||||
enum {
|
||||
BUSSTATE_OFF = 0,
|
||||
BUSSTATE_ON,
|
||||
BUSSTATE_TRISTATE
|
||||
};
|
||||
|
||||
#define __NEW_HD_DRIVE_ID
|
||||
|
||||
struct hd_driveid {
|
||||
unsigned short config;
|
||||
unsigned short cyls;
|
||||
unsigned short reserved2;
|
||||
unsigned short heads;
|
||||
unsigned short track_bytes;
|
||||
unsigned short sector_bytes;
|
||||
unsigned short sectors;
|
||||
unsigned short vendor0;
|
||||
unsigned short vendor1;
|
||||
unsigned short vendor2;
|
||||
unsigned char serial_no[20];
|
||||
unsigned short buf_type;
|
||||
unsigned short buf_size;
|
||||
unsigned short ecc_bytes;
|
||||
unsigned char fw_rev[8];
|
||||
unsigned char model[40];
|
||||
unsigned char max_multsect;
|
||||
unsigned char vendor3;
|
||||
unsigned short dword_io;
|
||||
unsigned char vendor4;
|
||||
unsigned char capability;
|
||||
unsigned short reserved50;
|
||||
unsigned char vendor5;
|
||||
unsigned char tPIO;
|
||||
unsigned char vendor6;
|
||||
unsigned char tDMA;
|
||||
unsigned short field_valid;
|
||||
unsigned short cur_cyls;
|
||||
unsigned short cur_heads;
|
||||
unsigned short cur_sectors;
|
||||
unsigned short cur_capacity0;
|
||||
unsigned short cur_capacity1;
|
||||
unsigned char multsect;
|
||||
unsigned char multsect_valid;
|
||||
unsigned int lba_capacity;
|
||||
unsigned short dma_1word;
|
||||
unsigned short dma_mword;
|
||||
unsigned short eide_pio_modes;
|
||||
unsigned short eide_dma_min;
|
||||
unsigned short eide_dma_time;
|
||||
unsigned short eide_pio;
|
||||
unsigned short eide_pio_iordy;
|
||||
unsigned short words69_70[2];
|
||||
|
||||
unsigned short words71_74[4];
|
||||
unsigned short queue_depth;
|
||||
unsigned short words76_79[4];
|
||||
unsigned short major_rev_num;
|
||||
unsigned short minor_rev_num;
|
||||
unsigned short command_set_1;
|
||||
unsigned short command_set_2;
|
||||
unsigned short cfsse;
|
||||
unsigned short cfs_enable_1;
|
||||
unsigned short cfs_enable_2;
|
||||
unsigned short csf_default;
|
||||
unsigned short dma_ultra;
|
||||
unsigned short trseuc;
|
||||
unsigned short trsEuc;
|
||||
unsigned short CurAPMvalues;
|
||||
unsigned short mprc;
|
||||
unsigned short hw_config;
|
||||
unsigned short acoustic;
|
||||
unsigned short msrqs;
|
||||
unsigned short sxfert;
|
||||
unsigned short sal;
|
||||
unsigned int spg;
|
||||
unsigned long long lba_capacity_2;
|
||||
unsigned short words104_125[22];
|
||||
unsigned short last_lun;
|
||||
unsigned short word127;
|
||||
unsigned short dlf;
|
||||
unsigned short csfo;
|
||||
unsigned short words130_155[26];
|
||||
unsigned short word156;
|
||||
unsigned short words157_159[3];
|
||||
unsigned short cfa_power;
|
||||
unsigned short words161_175[15];
|
||||
unsigned short words176_205[30];
|
||||
unsigned short words206_254[49];
|
||||
unsigned short integrity_word;
|
||||
};
|
||||
|
||||
#define IDE_NICE_DSC_OVERLAP (0)
|
||||
#define IDE_NICE_ATAPI_OVERLAP (1)
|
||||
#define IDE_NICE_0 (2)
|
||||
#define IDE_NICE_1 (3)
|
||||
#define IDE_NICE_2 (4)
|
||||
|
||||
#endif
|
114
libc/kernel/common/linux/hdsmart.h
Normal file
114
libc/kernel/common/linux/hdsmart.h
Normal file
@@ -0,0 +1,114 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_HDSMART_H
|
||||
#define _LINUX_HDSMART_H
|
||||
|
||||
#define OFFLINE_FULL_SCAN 0
|
||||
#define SHORT_SELF_TEST 1
|
||||
#define EXTEND_SELF_TEST 2
|
||||
#define SHORT_CAPTIVE_SELF_TEST 129
|
||||
#define EXTEND_CAPTIVE_SELF_TEST 130
|
||||
|
||||
typedef struct ata_smart_attribute_s {
|
||||
unsigned char id;
|
||||
unsigned short status_flag;
|
||||
unsigned char normalized;
|
||||
unsigned char worse_normal;
|
||||
unsigned char raw[6];
|
||||
unsigned char reserv;
|
||||
} __attribute__ ((packed)) ata_smart_attribute_t;
|
||||
|
||||
typedef struct ata_smart_values_s {
|
||||
unsigned short revnumber;
|
||||
ata_smart_attribute_t vendor_attributes [30];
|
||||
unsigned char offline_data_collection_status;
|
||||
unsigned char self_test_exec_status;
|
||||
unsigned short total_time_to_complete_off_line;
|
||||
unsigned char vendor_specific_366;
|
||||
unsigned char offline_data_collection_capability;
|
||||
unsigned short smart_capability;
|
||||
unsigned char errorlog_capability;
|
||||
unsigned char vendor_specific_371;
|
||||
unsigned char short_test_completion_time;
|
||||
unsigned char extend_test_completion_time;
|
||||
unsigned char reserved_374_385 [12];
|
||||
unsigned char vendor_specific_386_509 [125];
|
||||
unsigned char chksum;
|
||||
} __attribute__ ((packed)) ata_smart_values_t;
|
||||
|
||||
typedef struct ata_smart_threshold_entry_s {
|
||||
unsigned char id;
|
||||
unsigned char normalized_threshold;
|
||||
unsigned char reserved[10];
|
||||
} __attribute__ ((packed)) ata_smart_threshold_entry_t;
|
||||
|
||||
typedef struct ata_smart_thresholds_s {
|
||||
unsigned short revnumber;
|
||||
ata_smart_threshold_entry_t thres_entries[30];
|
||||
unsigned char reserved[149];
|
||||
unsigned char chksum;
|
||||
} __attribute__ ((packed)) ata_smart_thresholds_t;
|
||||
|
||||
typedef struct ata_smart_errorlog_command_struct_s {
|
||||
unsigned char devicecontrolreg;
|
||||
unsigned char featuresreg;
|
||||
unsigned char sector_count;
|
||||
unsigned char sector_number;
|
||||
unsigned char cylinder_low;
|
||||
unsigned char cylinder_high;
|
||||
unsigned char drive_head;
|
||||
unsigned char commandreg;
|
||||
unsigned int timestamp;
|
||||
} __attribute__ ((packed)) ata_smart_errorlog_command_struct_t;
|
||||
|
||||
typedef struct ata_smart_errorlog_error_struct_s {
|
||||
unsigned char error_condition;
|
||||
unsigned char extended_error[14];
|
||||
unsigned char state;
|
||||
unsigned short timestamp;
|
||||
} __attribute__ ((packed)) ata_smart_errorlog_error_struct_t;
|
||||
|
||||
typedef struct ata_smart_errorlog_struct_s {
|
||||
ata_smart_errorlog_command_struct_t commands[6];
|
||||
ata_smart_errorlog_error_struct_t error_struct;
|
||||
} __attribute__ ((packed)) ata_smart_errorlog_struct_t;
|
||||
|
||||
typedef struct ata_smart_errorlog_s {
|
||||
unsigned char revnumber;
|
||||
unsigned char error_log_pointer;
|
||||
ata_smart_errorlog_struct_t errorlog_struct[5];
|
||||
unsigned short ata_error_count;
|
||||
unsigned short non_fatal_count;
|
||||
unsigned short drive_timeout_count;
|
||||
unsigned char reserved[53];
|
||||
unsigned char chksum;
|
||||
} __attribute__ ((packed)) ata_smart_errorlog_t;
|
||||
|
||||
typedef struct ata_smart_selftestlog_struct_s {
|
||||
unsigned char selftestnumber;
|
||||
unsigned char selfteststatus;
|
||||
unsigned short timestamp;
|
||||
unsigned char selftestfailurecheckpoint;
|
||||
unsigned int lbafirstfailure;
|
||||
unsigned char vendorspecific[15];
|
||||
} __attribute__ ((packed)) ata_smart_selftestlog_struct_t;
|
||||
|
||||
typedef struct ata_smart_selftestlog_s {
|
||||
unsigned short revnumber;
|
||||
ata_smart_selftestlog_struct_t selftest_struct[21];
|
||||
unsigned char vendorspecific[2];
|
||||
unsigned char mostrecenttest;
|
||||
unsigned char resevered[2];
|
||||
unsigned char chksum;
|
||||
} __attribute__ ((packed)) ata_smart_selftestlog_t;
|
||||
|
||||
#endif
|
31
libc/kernel/common/linux/highmem.h
Normal file
31
libc/kernel/common/linux/highmem.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_HIGHMEM_H
|
||||
#define _LINUX_HIGHMEM_H
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/mm.h>
|
||||
|
||||
#include <asm/cacheflush.h>
|
||||
|
||||
#ifndef ARCH_HAS_FLUSH_ANON_PAGE
|
||||
#endif
|
||||
#ifndef ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
|
||||
#endif
|
||||
#define kunmap(page) do { (void) (page); } while (0)
|
||||
#define kmap_atomic(page, idx) page_address(page)
|
||||
#define kunmap_atomic(addr, idx) do { } while (0)
|
||||
#define kmap_atomic_pfn(pfn, idx) page_address(pfn_to_page(pfn))
|
||||
#define kmap_atomic_to_page(ptr) virt_to_page(ptr)
|
||||
#ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
|
||||
#endif
|
||||
#endif
|
256
libc/kernel/common/linux/hil.h
Normal file
256
libc/kernel/common/linux/hil.h
Normal file
@@ -0,0 +1,256 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _HIL_H_
|
||||
#define _HIL_H_
|
||||
|
||||
#include <asm/types.h>
|
||||
|
||||
#define HIL_CLOCK 8MHZ
|
||||
#define HIL_EK1_CLOCK 30HZ
|
||||
#define HIL_EK2_CLOCK 60HZ
|
||||
|
||||
#define HIL_TIMEOUT_DEV 5
|
||||
#define HIL_TIMEOUT_DEVS 10
|
||||
#define HIL_TIMEOUT_NORESP 10
|
||||
#define HIL_TIMEOUT_DEVS_DATA 16
|
||||
#define HIL_TIMEOUT_SELFTEST 200
|
||||
|
||||
#define HIL_WIRE_PACKET_LEN 15
|
||||
enum hil_wire_bitpos {
|
||||
HIL_WIRE_START = 0,
|
||||
HIL_WIRE_ADDR2,
|
||||
HIL_WIRE_ADDR1,
|
||||
HIL_WIRE_ADDR0,
|
||||
HIL_WIRE_COMMAND,
|
||||
HIL_WIRE_DATA7,
|
||||
HIL_WIRE_DATA6,
|
||||
HIL_WIRE_DATA5,
|
||||
HIL_WIRE_DATA4,
|
||||
HIL_WIRE_DATA3,
|
||||
HIL_WIRE_DATA2,
|
||||
HIL_WIRE_DATA1,
|
||||
HIL_WIRE_DATA0,
|
||||
HIL_WIRE_PARITY,
|
||||
HIL_WIRE_STOP
|
||||
};
|
||||
|
||||
enum hil_pkt_bitpos {
|
||||
HIL_PKT_CMD = 0x00000800,
|
||||
HIL_PKT_ADDR2 = 0x00000400,
|
||||
HIL_PKT_ADDR1 = 0x00000200,
|
||||
HIL_PKT_ADDR0 = 0x00000100,
|
||||
HIL_PKT_ADDR_MASK = 0x00000700,
|
||||
HIL_PKT_ADDR_SHIFT = 8,
|
||||
HIL_PKT_DATA7 = 0x00000080,
|
||||
HIL_PKT_DATA6 = 0x00000040,
|
||||
HIL_PKT_DATA5 = 0x00000020,
|
||||
HIL_PKT_DATA4 = 0x00000010,
|
||||
HIL_PKT_DATA3 = 0x00000008,
|
||||
HIL_PKT_DATA2 = 0x00000004,
|
||||
HIL_PKT_DATA1 = 0x00000002,
|
||||
HIL_PKT_DATA0 = 0x00000001,
|
||||
HIL_PKT_DATA_MASK = 0x000000FF,
|
||||
HIL_PKT_DATA_SHIFT = 0
|
||||
};
|
||||
|
||||
enum hil_error_bitpos {
|
||||
HIL_ERR_OB = 0x00000800,
|
||||
HIL_ERR_INT = 0x00010000,
|
||||
HIL_ERR_NMI = 0x00020000,
|
||||
HIL_ERR_LERR = 0x00040000,
|
||||
HIL_ERR_PERR = 0x01000000,
|
||||
HIL_ERR_FERR = 0x02000000,
|
||||
HIL_ERR_FOF = 0x04000000
|
||||
};
|
||||
|
||||
enum hil_control_bitpos {
|
||||
HIL_CTRL_TEST = 0x00010000,
|
||||
HIL_CTRL_IPF = 0x00040000,
|
||||
HIL_CTRL_APE = 0x02000000
|
||||
};
|
||||
|
||||
#define HIL_DO_ALTER_CTRL 0x40000000
|
||||
#define HIL_CTRL_ONLY 0xc0000000
|
||||
|
||||
typedef u32 hil_packet;
|
||||
|
||||
enum hil_command {
|
||||
HIL_CMD_IFC = 0x00,
|
||||
HIL_CMD_EPT = 0x01,
|
||||
HIL_CMD_ELB = 0x02,
|
||||
HIL_CMD_IDD = 0x03,
|
||||
HIL_CMD_DSR = 0x04,
|
||||
HIL_CMD_PST = 0x05,
|
||||
HIL_CMD_RRG = 0x06,
|
||||
HIL_CMD_WRG = 0x07,
|
||||
HIL_CMD_ACF = 0x08,
|
||||
HIL_CMDID_ACF = 0x07,
|
||||
HIL_CMD_POL = 0x10,
|
||||
HIL_CMDCT_POL = 0x0f,
|
||||
HIL_CMD_RPL = 0x20,
|
||||
HIL_CMDCT_RPL = 0x0f,
|
||||
HIL_CMD_RNM = 0x30,
|
||||
HIL_CMD_RST = 0x31,
|
||||
HIL_CMD_EXD = 0x32,
|
||||
HIL_CMD_RSC = 0x33,
|
||||
|
||||
HIL_CMD_DKA = 0x3d,
|
||||
HIL_CMD_EK1 = 0x3e,
|
||||
HIL_CMD_EK2 = 0x3f,
|
||||
HIL_CMD_PR1 = 0x40,
|
||||
HIL_CMD_PR2 = 0x41,
|
||||
HIL_CMD_PR3 = 0x42,
|
||||
HIL_CMD_PR4 = 0x43,
|
||||
HIL_CMD_PR5 = 0x44,
|
||||
HIL_CMD_PR6 = 0x45,
|
||||
HIL_CMD_PR7 = 0x46,
|
||||
HIL_CMD_PRM = 0x47,
|
||||
HIL_CMD_AK1 = 0x48,
|
||||
HIL_CMD_AK2 = 0x49,
|
||||
HIL_CMD_AK3 = 0x4a,
|
||||
HIL_CMD_AK4 = 0x4b,
|
||||
HIL_CMD_AK5 = 0x4c,
|
||||
HIL_CMD_AK6 = 0x4d,
|
||||
HIL_CMD_AK7 = 0x4e,
|
||||
HIL_CMD_ACK = 0x4f,
|
||||
|
||||
HIL_CMD_RIO = 0xfa,
|
||||
HIL_CMD_SHR = 0xfb,
|
||||
HIL_CMD_TER = 0xfc,
|
||||
HIL_CMD_CAE = 0xfd,
|
||||
HIL_CMD_DHR = 0xfe,
|
||||
|
||||
};
|
||||
|
||||
#define HIL_IDD_DID_TYPE_MASK 0xe0
|
||||
#define HIL_IDD_DID_TYPE_KB_INTEGRAL 0xa0
|
||||
#define HIL_IDD_DID_TYPE_KB_ITF 0xc0
|
||||
#define HIL_IDD_DID_TYPE_KB_RSVD 0xe0
|
||||
#define HIL_IDD_DID_TYPE_KB_LANG_MASK 0x1f
|
||||
#define HIL_IDD_DID_KBLANG_USE_ESD 0x00
|
||||
#define HIL_IDD_DID_TYPE_ABS 0x80
|
||||
#define HIL_IDD_DID_ABS_RSVD1_MASK 0xf8
|
||||
#define HIL_IDD_DID_ABS_RSVD1 0x98
|
||||
#define HIL_IDD_DID_ABS_TABLET_MASK 0xf8
|
||||
#define HIL_IDD_DID_ABS_TABLET 0x90
|
||||
#define HIL_IDD_DID_ABS_TSCREEN_MASK 0xfc
|
||||
#define HIL_IDD_DID_ABS_TSCREEN 0x8c
|
||||
#define HIL_IDD_DID_ABS_RSVD2_MASK 0xfc
|
||||
#define HIL_IDD_DID_ABS_RSVD2 0x88
|
||||
#define HIL_IDD_DID_ABS_RSVD3_MASK 0xfc
|
||||
#define HIL_IDD_DID_ABS_RSVD3 0x80
|
||||
#define HIL_IDD_DID_TYPE_REL 0x60
|
||||
#define HIL_IDD_DID_REL_RSVD1_MASK 0xf0
|
||||
#define HIL_IDD_DID_REL_RSVD1 0x70
|
||||
#define HIL_IDD_DID_REL_RSVD2_MASK 0xfc
|
||||
#define HIL_IDD_DID_REL_RSVD2 0x6c
|
||||
#define HIL_IDD_DID_REL_MOUSE_MASK 0xfc
|
||||
#define HIL_IDD_DID_REL_MOUSE 0x68
|
||||
#define HIL_IDD_DID_REL_QUAD_MASK 0xf8
|
||||
#define HIL_IDD_DID_REL_QUAD 0x60
|
||||
#define HIL_IDD_DID_TYPE_CHAR 0x40
|
||||
#define HIL_IDD_DID_CHAR_BARCODE_MASK 0xfc
|
||||
#define HIL_IDD_DID_CHAR_BARCODE 0x5c
|
||||
#define HIL_IDD_DID_CHAR_RSVD1_MASK 0xfc
|
||||
#define HIL_IDD_DID_CHAR_RSVD1 0x58
|
||||
#define HIL_IDD_DID_CHAR_RSVD2_MASK 0xf8
|
||||
#define HIL_IDD_DID_CHAR_RSVD2 0x50
|
||||
#define HIL_IDD_DID_CHAR_RSVD3_MASK 0xf0
|
||||
#define HIL_IDD_DID_CHAR_RSVD3 0x40
|
||||
#define HIL_IDD_DID_TYPE_OTHER 0x20
|
||||
#define HIL_IDD_DID_OTHER_RSVD1_MASK 0xf0
|
||||
#define HIL_IDD_DID_OTHER_RSVD1 0x30
|
||||
#define HIL_IDD_DID_OTHER_BARCODE_MASK 0xfc
|
||||
#define HIL_IDD_DID_OTHER_BARCODE 0x2c
|
||||
#define HIL_IDD_DID_OTHER_RSVD2_MASK 0xfc
|
||||
#define HIL_IDD_DID_OTHER_RSVD2 0x28
|
||||
#define HIL_IDD_DID_OTHER_RSVD3_MASK 0xf8
|
||||
#define HIL_IDD_DID_OTHER_RSVD3 0x20
|
||||
#define HIL_IDD_DID_TYPE_KEYPAD 0x00
|
||||
|
||||
#define HIL_IDD_HEADER_AXSET_MASK 0x03
|
||||
#define HIL_IDD_HEADER_RSC 0x04
|
||||
#define HIL_IDD_HEADER_EXD 0x08
|
||||
#define HIL_IDD_HEADER_IOD 0x10
|
||||
#define HIL_IDD_HEADER_16BIT 0x20
|
||||
#define HIL_IDD_HEADER_ABS 0x40
|
||||
#define HIL_IDD_HEADER_2X_AXIS 0x80
|
||||
|
||||
#define HIL_IDD_IOD_NBUTTON_MASK 0x07
|
||||
#define HIL_IDD_IOD_PROXIMITY 0x08
|
||||
#define HIL_IDD_IOD_PROMPT_MASK 0x70
|
||||
#define HIL_IDD_IOD_PROMPT_SHIFT 4
|
||||
#define HIL_IDD_IOD_PROMPT 0x80
|
||||
|
||||
#define HIL_IDD_NUM_AXES_PER_SET(header_packet) ((header_packet) & HIL_IDD_HEADER_AXSET_MASK)
|
||||
|
||||
#define HIL_IDD_NUM_AXSETS(header_packet) (2 - !((header_packet) & HIL_IDD_HEADER_2X_AXIS))
|
||||
|
||||
#define HIL_IDD_LEN(header_packet) ((4 - !(header_packet & HIL_IDD_HEADER_IOD) - 2 * !(HIL_IDD_NUM_AXES_PER_SET(header_packet))) + 2 * HIL_IDD_NUM_AXES_PER_SET(header_packet) * !!((header_packet) & HIL_IDD_HEADER_ABS))
|
||||
|
||||
#define HIL_IDD_AXIS_COUNTS_PER_M(header_ptr) (!(HIL_IDD_NUM_AXSETS(*(header_ptr))) ? -1 : (((*(header_ptr + 1) & HIL_PKT_DATA_MASK) + ((*(header_ptr + 2) & HIL_PKT_DATA_MASK)) << 8) * ((*(header_ptr) & HIL_IDD_HEADER_16BIT) ? 100 : 1)))
|
||||
|
||||
#define HIL_IDD_AXIS_MAX(header_ptr, __axnum) ((!(*(header_ptr) & HIL_IDD_HEADER_ABS) || (HIL_IDD_NUM_AXES_PER_SET(*(header_ptr)) <= __axnum)) ? 0 : ((HIL_PKT_DATA_MASK & *((header_ptr) + 3 + 2 * __axnum)) + ((HIL_PKT_DATA_MASK & *((header_ptr) + 4 + 2 * __axnum)) << 8)))
|
||||
|
||||
#define HIL_IDD_IOD(header_ptr) (*(header_ptr + HIL_IDD_LEN((*header_ptr)) - 1))
|
||||
|
||||
#define HIL_IDD_HAS_GEN_PROMPT(header_ptr) ((*header_ptr & HIL_IDD_HEADER_IOD) && (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_PROMPT))
|
||||
|
||||
#define HIL_IDD_HAS_GEN_PROXIMITY(header_ptr) ((*header_ptr & HIL_IDD_HEADER_IOD) && (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_PROXIMITY))
|
||||
|
||||
#define HIL_IDD_NUM_BUTTONS(header_ptr) ((*header_ptr & HIL_IDD_HEADER_IOD) ? (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_NBUTTON_MASK) : 0)
|
||||
|
||||
#define HIL_IDD_NUM_PROMPTS(header_ptr) ((*header_ptr & HIL_IDD_HEADER_IOD) ? ((HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_NPROMPT_MASK) >> HIL_IDD_IOD_PROMPT_SHIFT) : 0)
|
||||
|
||||
#define HIL_EXD_HEADER_WRG 0x03
|
||||
#define HIL_EXD_HEADER_WRG_TYPE1 0x01
|
||||
#define HIL_EXD_HEADER_WRG_TYPE2 0x02
|
||||
#define HIL_EXD_HEADER_RRG 0x04
|
||||
#define HIL_EXD_HEADER_RNM 0x10
|
||||
#define HIL_EXD_HEADER_RST 0x20
|
||||
#define HIL_EXD_HEADER_LOCALE 0x40
|
||||
|
||||
#define HIL_EXD_NUM_RRG(header_ptr) ((*header_ptr & HIL_EXD_HEADER_RRG) ? (*(header_ptr + 1) & HIL_PKT_DATA_MASK) : 0)
|
||||
|
||||
#define HIL_EXD_NUM_WWG(header_ptr) ((*header_ptr & HIL_EXD_HEADER_WRG) ? (*(header_ptr + 2 - !(*header_ptr & HIL_EXD_HEADER_RRG)) & HIL_PKT_DATA_MASK) : 0)
|
||||
|
||||
#define HIL_EXD_LEN(header_ptr) (!!(*header_ptr & HIL_EXD_HEADER_RRG) + !!(*header_ptr & HIL_EXD_HEADER_WRG) + !!(*header_ptr & HIL_EXD_HEADER_LOCALE) + 2 * !!(*header_ptr & HIL_EXD_HEADER_WRG_TYPE2) + 1)
|
||||
|
||||
#define HIL_EXD_LOCALE(header_ptr) (!(*header_ptr & HIL_EXD_HEADER_LOCALE) ? -1 : (*(header_ptr + HIL_EXD_LEN(header_ptr) - 1) & HIL_PKT_DATA_MASK))
|
||||
|
||||
#define HIL_EXD_WRG_TYPE2_LEN(header_ptr) (!(*header_ptr & HIL_EXD_HEADER_WRG_TYPE2) ? -1 : (*(header_ptr + HIL_EXD_LEN(header_ptr) - 2 - !!(*header_ptr & HIL_EXD_HEADER_LOCALE)) & HIL_PKT_DATA_MASK) + ((*(header_ptr + HIL_EXD_LEN(header_ptr) - 1 - !!(*header_ptr & HIL_EXD_HEADER_LOCALE)) & HIL_PKT_DATA_MASK) << 8))
|
||||
|
||||
#define HIL_LOCALE_MAX 0x1f
|
||||
|
||||
#define HIL_LOCALE_MAP "", "", "", "swiss.french", "portuguese", "arabic", "hebrew", "english.canadian", "turkish", "greek", "thai", "italian", "korean", "dutch", "swedish", "german", "chinese", "chinese", "swiss.french", "spanish", "swiss.german", "flemish", "finnish", "english.uk", "french.canadian", "swiss.german", "norwegian", "french", "danish", "japanese", "spanish", "english.us"
|
||||
|
||||
#define HIL_KEYCODES_SET1_TBLSIZE 128
|
||||
#define HIL_KEYCODES_SET1 KEY_5, KEY_RESERVED, KEY_RIGHTALT, KEY_LEFTALT, KEY_RIGHTSHIFT, KEY_LEFTSHIFT, KEY_LEFTCTRL, KEY_SYSRQ, KEY_KP4, KEY_KP8, KEY_KP5, KEY_KP9, KEY_KP6, KEY_KP7, KEY_KPCOMMA, KEY_KPENTER, KEY_KP1, KEY_KPSLASH, KEY_KP2, KEY_KPPLUS, KEY_KP3, KEY_KPASTERISK, KEY_KP0, KEY_KPMINUS, KEY_B, KEY_V, KEY_C, KEY_X, KEY_Z, KEY_RESERVED, KEY_RESERVED, KEY_ESC, KEY_6, KEY_F10, KEY_3, KEY_F11, KEY_KPDOT, KEY_F9, KEY_TAB , KEY_F12, KEY_H, KEY_G, KEY_F, KEY_D, KEY_S, KEY_A, KEY_RESERVED, KEY_CAPSLOCK, KEY_U, KEY_Y, KEY_T, KEY_R, KEY_E, KEY_W, KEY_Q, KEY_TAB, KEY_7, KEY_6, KEY_5, KEY_4, KEY_3, KEY_2, KEY_1, KEY_GRAVE, KEY_F13, KEY_F14, KEY_F15, KEY_F16, KEY_F17, KEY_F18, KEY_F19, KEY_F20, KEY_MENU, KEY_F4, KEY_F3, KEY_F2, KEY_F1, KEY_VOLUMEUP, KEY_STOP, KEY_SENDFILE, KEY_SYSRQ, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_VOLUMEDOWN, KEY_DEL_EOL, KEY_DEL_EOS, KEY_8, KEY_9, KEY_0, KEY_MINUS, KEY_EQUAL, KEY_BACKSPACE, KEY_INS_LINE, KEY_DEL_LINE, KEY_I, KEY_O, KEY_P, KEY_LEFTBRACE, KEY_RIGHTBRACE, KEY_BACKSLASH, KEY_INSERT, KEY_DELETE, KEY_J, KEY_K, KEY_L, KEY_SEMICOLON, KEY_APOSTROPHE, KEY_ENTER, KEY_HOME, KEY_PAGEUP, KEY_M, KEY_COMMA, KEY_DOT, KEY_SLASH, KEY_BACKSLASH, KEY_SELECT, KEY_102ND, KEY_PAGEDOWN, KEY_N, KEY_SPACE, KEY_NEXT, KEY_RESERVED, KEY_LEFT, KEY_DOWN, KEY_UP, KEY_RIGHT
|
||||
|
||||
#define HIL_KEYCODES_SET3_TBLSIZE 128
|
||||
#define HIL_KEYCODES_SET3 KEY_RESERVED, KEY_ESC, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_0, KEY_MINUS, KEY_EQUAL, KEY_BACKSPACE, KEY_TAB, KEY_Q, KEY_W, KEY_E, KEY_R, KEY_T, KEY_Y, KEY_U, KEY_I, KEY_O, KEY_P, KEY_LEFTBRACE, KEY_RIGHTBRACE, KEY_ENTER, KEY_LEFTCTRL, KEY_A, KEY_S, KEY_D, KEY_F, KEY_G, KEY_H, KEY_J, KEY_K, KEY_L, KEY_SEMICOLON, KEY_APOSTROPHE,KEY_GRAVE, KEY_LEFTSHIFT, KEY_BACKSLASH, KEY_Z, KEY_X, KEY_C, KEY_V, KEY_B, KEY_N, KEY_M, KEY_COMMA, KEY_DOT, KEY_SLASH, KEY_RIGHTSHIFT, KEY_KPASTERISK, KEY_LEFTALT, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_NUMLOCK, KEY_SCROLLLOCK, KEY_KP7, KEY_KP8, KEY_KP9, KEY_KPMINUS, KEY_KP4, KEY_KP5, KEY_KP6, KEY_KPPLUS, KEY_KP1, KEY_KP2, KEY_KP3, KEY_KP0, KEY_KPDOT, KEY_SYSRQ, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_UP, KEY_LEFT, KEY_DOWN, KEY_RIGHT, KEY_HOME, KEY_PAGEUP, KEY_END, KEY_PAGEDOWN, KEY_INSERT, KEY_DELETE, KEY_102ND, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED
|
||||
|
||||
#define HIL_POL_NUM_AXES_MASK 0x03
|
||||
#define HIL_POL_CTS 0x04
|
||||
#define HIL_POL_STATUS_PENDING 0x08
|
||||
#define HIL_POL_CHARTYPE_MASK 0x70
|
||||
#define HIL_POL_CHARTYPE_NONE 0x00
|
||||
#define HIL_POL_CHARTYPE_RSVD1 0x10
|
||||
#define HIL_POL_CHARTYPE_ASCII 0x20
|
||||
#define HIL_POL_CHARTYPE_BINARY 0x30
|
||||
#define HIL_POL_CHARTYPE_SET1 0x40
|
||||
#define HIL_POL_CHARTYPE_RSVD2 0x50
|
||||
#define HIL_POL_CHARTYPE_SET2 0x60
|
||||
#define HIL_POL_CHARTYPE_SET3 0x70
|
||||
#define HIL_POL_AXIS_ALT 0x80
|
||||
|
||||
#endif
|
95
libc/kernel/common/linux/i2c.h
Normal file
95
libc/kernel/common/linux/i2c.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_I2C_H
|
||||
#define _LINUX_I2C_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct i2c_msg {
|
||||
__u16 addr;
|
||||
__u16 flags;
|
||||
#define I2C_M_TEN 0x10
|
||||
#define I2C_M_RD 0x01
|
||||
#define I2C_M_NOSTART 0x4000
|
||||
#define I2C_M_REV_DIR_ADDR 0x2000
|
||||
#define I2C_M_IGNORE_NAK 0x1000
|
||||
#define I2C_M_NO_RD_ACK 0x0800
|
||||
__u16 len;
|
||||
__u8 *buf;
|
||||
};
|
||||
|
||||
#define I2C_FUNC_I2C 0x00000001
|
||||
#define I2C_FUNC_10BIT_ADDR 0x00000002
|
||||
#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004
|
||||
#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008
|
||||
#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000
|
||||
#define I2C_FUNC_SMBUS_QUICK 0x00010000
|
||||
#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
|
||||
#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
|
||||
#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000
|
||||
#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000
|
||||
#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000
|
||||
#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
|
||||
#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
|
||||
#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
|
||||
#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
|
||||
#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000
|
||||
#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000
|
||||
#define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000
|
||||
#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000
|
||||
|
||||
#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | I2C_FUNC_SMBUS_WRITE_BYTE)
|
||||
#define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA | I2C_FUNC_SMBUS_WRITE_BYTE_DATA)
|
||||
#define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA | I2C_FUNC_SMBUS_WRITE_WORD_DATA)
|
||||
#define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
|
||||
#define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
|
||||
#define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2)
|
||||
|
||||
#define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_PROC_CALL | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | I2C_FUNC_SMBUS_I2C_BLOCK)
|
||||
|
||||
#define I2C_SMBUS_BLOCK_MAX 32
|
||||
union i2c_smbus_data {
|
||||
__u8 byte;
|
||||
__u16 word;
|
||||
__u8 block[I2C_SMBUS_BLOCK_MAX + 2];
|
||||
|
||||
};
|
||||
|
||||
#define I2C_SMBUS_READ 1
|
||||
#define I2C_SMBUS_WRITE 0
|
||||
|
||||
#define I2C_SMBUS_QUICK 0
|
||||
#define I2C_SMBUS_BYTE 1
|
||||
#define I2C_SMBUS_BYTE_DATA 2
|
||||
#define I2C_SMBUS_WORD_DATA 3
|
||||
#define I2C_SMBUS_PROC_CALL 4
|
||||
#define I2C_SMBUS_BLOCK_DATA 5
|
||||
#define I2C_SMBUS_I2C_BLOCK_DATA 6
|
||||
#define I2C_SMBUS_BLOCK_PROC_CALL 7
|
||||
|
||||
#define I2C_RETRIES 0x0701
|
||||
|
||||
#define I2C_TIMEOUT 0x0702
|
||||
|
||||
#define I2C_SLAVE 0x0703
|
||||
|
||||
#define I2C_SLAVE_FORCE 0x0706
|
||||
|
||||
#define I2C_TENBIT 0x0704
|
||||
|
||||
#define I2C_FUNCS 0x0705
|
||||
#define I2C_RDWR 0x0707
|
||||
#define I2C_PEC 0x0708
|
||||
|
||||
#define I2C_SMBUS 0x0720
|
||||
|
||||
#endif
|
81
libc/kernel/common/linux/icmp.h
Normal file
81
libc/kernel/common/linux/icmp.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_ICMP_H
|
||||
#define _LINUX_ICMP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define ICMP_ECHOREPLY 0
|
||||
#define ICMP_DEST_UNREACH 3
|
||||
#define ICMP_SOURCE_QUENCH 4
|
||||
#define ICMP_REDIRECT 5
|
||||
#define ICMP_ECHO 8
|
||||
#define ICMP_TIME_EXCEEDED 11
|
||||
#define ICMP_PARAMETERPROB 12
|
||||
#define ICMP_TIMESTAMP 13
|
||||
#define ICMP_TIMESTAMPREPLY 14
|
||||
#define ICMP_INFO_REQUEST 15
|
||||
#define ICMP_INFO_REPLY 16
|
||||
#define ICMP_ADDRESS 17
|
||||
#define ICMP_ADDRESSREPLY 18
|
||||
#define NR_ICMP_TYPES 18
|
||||
|
||||
#define ICMP_NET_UNREACH 0
|
||||
#define ICMP_HOST_UNREACH 1
|
||||
#define ICMP_PROT_UNREACH 2
|
||||
#define ICMP_PORT_UNREACH 3
|
||||
#define ICMP_FRAG_NEEDED 4
|
||||
#define ICMP_SR_FAILED 5
|
||||
#define ICMP_NET_UNKNOWN 6
|
||||
#define ICMP_HOST_UNKNOWN 7
|
||||
#define ICMP_HOST_ISOLATED 8
|
||||
#define ICMP_NET_ANO 9
|
||||
#define ICMP_HOST_ANO 10
|
||||
#define ICMP_NET_UNR_TOS 11
|
||||
#define ICMP_HOST_UNR_TOS 12
|
||||
#define ICMP_PKT_FILTERED 13
|
||||
#define ICMP_PREC_VIOLATION 14
|
||||
#define ICMP_PREC_CUTOFF 15
|
||||
#define NR_ICMP_UNREACH 15
|
||||
|
||||
#define ICMP_REDIR_NET 0
|
||||
#define ICMP_REDIR_HOST 1
|
||||
#define ICMP_REDIR_NETTOS 2
|
||||
#define ICMP_REDIR_HOSTTOS 3
|
||||
|
||||
#define ICMP_EXC_TTL 0
|
||||
#define ICMP_EXC_FRAGTIME 1
|
||||
|
||||
struct icmphdr {
|
||||
__u8 type;
|
||||
__u8 code;
|
||||
__u16 checksum;
|
||||
union {
|
||||
struct {
|
||||
__u16 id;
|
||||
__u16 sequence;
|
||||
} echo;
|
||||
__u32 gateway;
|
||||
struct {
|
||||
__u16 __unused_field;
|
||||
__u16 mtu;
|
||||
} frag;
|
||||
} un;
|
||||
};
|
||||
|
||||
#define ICMP_FILTER 1
|
||||
|
||||
struct icmp_filter {
|
||||
__u32 data;
|
||||
};
|
||||
|
||||
#endif
|
176
libc/kernel/common/linux/if.h
Normal file
176
libc/kernel/common/linux/if.h
Normal file
@@ -0,0 +1,176 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_IF_H
|
||||
#define _LINUX_IF_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/socket.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#define IFNAMSIZ 16
|
||||
#include <linux/hdlc/ioctl.h>
|
||||
|
||||
#define IFF_UP 0x1
|
||||
#define IFF_BROADCAST 0x2
|
||||
#define IFF_DEBUG 0x4
|
||||
#define IFF_LOOPBACK 0x8
|
||||
#define IFF_POINTOPOINT 0x10
|
||||
#define IFF_NOTRAILERS 0x20
|
||||
#define IFF_RUNNING 0x40
|
||||
#define IFF_NOARP 0x80
|
||||
#define IFF_PROMISC 0x100
|
||||
#define IFF_ALLMULTI 0x200
|
||||
|
||||
#define IFF_MASTER 0x400
|
||||
#define IFF_SLAVE 0x800
|
||||
|
||||
#define IFF_MULTICAST 0x1000
|
||||
|
||||
#define IFF_PORTSEL 0x2000
|
||||
#define IFF_AUTOMEDIA 0x4000
|
||||
#define IFF_DYNAMIC 0x8000
|
||||
|
||||
#define IFF_LOWER_UP 0x10000
|
||||
#define IFF_DORMANT 0x20000
|
||||
|
||||
#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST| IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
|
||||
|
||||
#define IFF_802_1Q_VLAN 0x1
|
||||
#define IFF_EBRIDGE 0x2
|
||||
#define IFF_SLAVE_INACTIVE 0x4
|
||||
#define IFF_MASTER_8023AD 0x8
|
||||
#define IFF_MASTER_ALB 0x10
|
||||
|
||||
#define IF_GET_IFACE 0x0001
|
||||
#define IF_GET_PROTO 0x0002
|
||||
|
||||
#define IF_IFACE_V35 0x1000
|
||||
#define IF_IFACE_V24 0x1001
|
||||
#define IF_IFACE_X21 0x1002
|
||||
#define IF_IFACE_T1 0x1003
|
||||
#define IF_IFACE_E1 0x1004
|
||||
#define IF_IFACE_SYNC_SERIAL 0x1005
|
||||
#define IF_IFACE_X21D 0x1006
|
||||
|
||||
#define IF_PROTO_HDLC 0x2000
|
||||
#define IF_PROTO_PPP 0x2001
|
||||
#define IF_PROTO_CISCO 0x2002
|
||||
#define IF_PROTO_FR 0x2003
|
||||
#define IF_PROTO_FR_ADD_PVC 0x2004
|
||||
#define IF_PROTO_FR_DEL_PVC 0x2005
|
||||
#define IF_PROTO_X25 0x2006
|
||||
#define IF_PROTO_HDLC_ETH 0x2007
|
||||
#define IF_PROTO_FR_ADD_ETH_PVC 0x2008
|
||||
#define IF_PROTO_FR_DEL_ETH_PVC 0x2009
|
||||
#define IF_PROTO_FR_PVC 0x200A
|
||||
#define IF_PROTO_FR_ETH_PVC 0x200B
|
||||
#define IF_PROTO_RAW 0x200C
|
||||
|
||||
enum {
|
||||
IF_OPER_UNKNOWN,
|
||||
IF_OPER_NOTPRESENT,
|
||||
IF_OPER_DOWN,
|
||||
IF_OPER_LOWERLAYERDOWN,
|
||||
IF_OPER_TESTING,
|
||||
IF_OPER_DORMANT,
|
||||
IF_OPER_UP,
|
||||
};
|
||||
|
||||
enum {
|
||||
IF_LINK_MODE_DEFAULT,
|
||||
IF_LINK_MODE_DORMANT,
|
||||
};
|
||||
|
||||
struct ifmap
|
||||
{
|
||||
unsigned long mem_start;
|
||||
unsigned long mem_end;
|
||||
unsigned short base_addr;
|
||||
unsigned char irq;
|
||||
unsigned char dma;
|
||||
unsigned char port;
|
||||
|
||||
};
|
||||
|
||||
struct if_settings
|
||||
{
|
||||
unsigned int type;
|
||||
unsigned int size;
|
||||
union {
|
||||
|
||||
raw_hdlc_proto __user *raw_hdlc;
|
||||
cisco_proto __user *cisco;
|
||||
fr_proto __user *fr;
|
||||
fr_proto_pvc __user *fr_pvc;
|
||||
fr_proto_pvc_info __user *fr_pvc_info;
|
||||
|
||||
sync_serial_settings __user *sync;
|
||||
te1_settings __user *te1;
|
||||
} ifs_ifsu;
|
||||
};
|
||||
|
||||
struct ifreq
|
||||
{
|
||||
#define IFHWADDRLEN 6
|
||||
union
|
||||
{
|
||||
char ifrn_name[IFNAMSIZ];
|
||||
} ifr_ifrn;
|
||||
|
||||
union {
|
||||
struct sockaddr ifru_addr;
|
||||
struct sockaddr ifru_dstaddr;
|
||||
struct sockaddr ifru_broadaddr;
|
||||
struct sockaddr ifru_netmask;
|
||||
struct sockaddr ifru_hwaddr;
|
||||
short ifru_flags;
|
||||
int ifru_ivalue;
|
||||
int ifru_mtu;
|
||||
struct ifmap ifru_map;
|
||||
char ifru_slave[IFNAMSIZ];
|
||||
char ifru_newname[IFNAMSIZ];
|
||||
void __user * ifru_data;
|
||||
struct if_settings ifru_settings;
|
||||
} ifr_ifru;
|
||||
};
|
||||
|
||||
#define ifr_name ifr_ifrn.ifrn_name
|
||||
#define ifr_hwaddr ifr_ifru.ifru_hwaddr
|
||||
#define ifr_addr ifr_ifru.ifru_addr
|
||||
#define ifr_dstaddr ifr_ifru.ifru_dstaddr
|
||||
#define ifr_broadaddr ifr_ifru.ifru_broadaddr
|
||||
#define ifr_netmask ifr_ifru.ifru_netmask
|
||||
#define ifr_flags ifr_ifru.ifru_flags
|
||||
#define ifr_metric ifr_ifru.ifru_ivalue
|
||||
#define ifr_mtu ifr_ifru.ifru_mtu
|
||||
#define ifr_map ifr_ifru.ifru_map
|
||||
#define ifr_slave ifr_ifru.ifru_slave
|
||||
#define ifr_data ifr_ifru.ifru_data
|
||||
#define ifr_ifindex ifr_ifru.ifru_ivalue
|
||||
#define ifr_bandwidth ifr_ifru.ifru_ivalue
|
||||
#define ifr_qlen ifr_ifru.ifru_ivalue
|
||||
#define ifr_newname ifr_ifru.ifru_newname
|
||||
#define ifr_settings ifr_ifru.ifru_settings
|
||||
|
||||
struct ifconf
|
||||
{
|
||||
int ifc_len;
|
||||
union
|
||||
{
|
||||
char __user *ifcu_buf;
|
||||
struct ifreq __user *ifcu_req;
|
||||
} ifc_ifcu;
|
||||
};
|
||||
#define ifc_buf ifc_ifcu.ifcu_buf
|
||||
#define ifc_req ifc_ifcu.ifcu_req
|
||||
|
||||
#endif
|
94
libc/kernel/common/linux/if_arcnet.h
Normal file
94
libc/kernel/common/linux/if_arcnet.h
Normal file
@@ -0,0 +1,94 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_IF_ARCNET_H
|
||||
#define _LINUX_IF_ARCNET_H
|
||||
|
||||
#include <linux/if_ether.h>
|
||||
|
||||
#define ARC_P_IP 212
|
||||
#define ARC_P_IPV6 196
|
||||
#define ARC_P_ARP 213
|
||||
#define ARC_P_RARP 214
|
||||
#define ARC_P_IPX 250
|
||||
#define ARC_P_NOVELL_EC 236
|
||||
|
||||
#define ARC_P_IP_RFC1051 240
|
||||
#define ARC_P_ARP_RFC1051 241
|
||||
|
||||
#define ARC_P_ETHER 232
|
||||
|
||||
#define ARC_P_DATAPOINT_BOOT 0
|
||||
#define ARC_P_DATAPOINT_MOUNT 1
|
||||
#define ARC_P_POWERLAN_BEACON 8
|
||||
#define ARC_P_POWERLAN_BEACON2 243
|
||||
#define ARC_P_LANSOFT 251
|
||||
#define ARC_P_ATALK 0xDD
|
||||
|
||||
#define ARCNET_ALEN 1
|
||||
|
||||
struct arc_rfc1201
|
||||
{
|
||||
uint8_t proto;
|
||||
uint8_t split_flag;
|
||||
uint16_t sequence;
|
||||
uint8_t payload[0];
|
||||
};
|
||||
#define RFC1201_HDR_SIZE 4
|
||||
|
||||
struct arc_rfc1051
|
||||
{
|
||||
uint8_t proto;
|
||||
uint8_t payload[0];
|
||||
};
|
||||
#define RFC1051_HDR_SIZE 1
|
||||
|
||||
struct arc_eth_encap
|
||||
{
|
||||
uint8_t proto;
|
||||
struct ethhdr eth;
|
||||
uint8_t payload[0];
|
||||
};
|
||||
#define ETH_ENCAP_HDR_SIZE 14
|
||||
|
||||
struct arc_cap
|
||||
{
|
||||
uint8_t proto;
|
||||
uint8_t cookie[sizeof(int)];
|
||||
union {
|
||||
uint8_t ack;
|
||||
uint8_t raw[0];
|
||||
} mes;
|
||||
};
|
||||
|
||||
struct arc_hardware
|
||||
{
|
||||
uint8_t source,
|
||||
dest,
|
||||
offset[2];
|
||||
};
|
||||
#define ARC_HDR_SIZE 4
|
||||
|
||||
struct archdr
|
||||
{
|
||||
|
||||
struct arc_hardware hard;
|
||||
|
||||
union {
|
||||
struct arc_rfc1201 rfc1201;
|
||||
struct arc_rfc1051 rfc1051;
|
||||
struct arc_eth_encap eth_encap;
|
||||
struct arc_cap cap;
|
||||
uint8_t raw[0];
|
||||
} soft;
|
||||
};
|
||||
|
||||
#endif
|
119
libc/kernel/common/linux/if_arp.h
Normal file
119
libc/kernel/common/linux/if_arp.h
Normal file
@@ -0,0 +1,119 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_IF_ARP_H
|
||||
#define _LINUX_IF_ARP_H
|
||||
|
||||
#include <linux/netdevice.h>
|
||||
|
||||
#define ARPHRD_NETROM 0
|
||||
#define ARPHRD_ETHER 1
|
||||
#define ARPHRD_EETHER 2
|
||||
#define ARPHRD_AX25 3
|
||||
#define ARPHRD_PRONET 4
|
||||
#define ARPHRD_CHAOS 5
|
||||
#define ARPHRD_IEEE802 6
|
||||
#define ARPHRD_ARCNET 7
|
||||
#define ARPHRD_APPLETLK 8
|
||||
#define ARPHRD_DLCI 15
|
||||
#define ARPHRD_ATM 19
|
||||
#define ARPHRD_METRICOM 23
|
||||
#define ARPHRD_IEEE1394 24
|
||||
#define ARPHRD_EUI64 27
|
||||
#define ARPHRD_INFINIBAND 32
|
||||
|
||||
#define ARPHRD_SLIP 256
|
||||
#define ARPHRD_CSLIP 257
|
||||
#define ARPHRD_SLIP6 258
|
||||
#define ARPHRD_CSLIP6 259
|
||||
#define ARPHRD_RSRVD 260
|
||||
#define ARPHRD_ADAPT 264
|
||||
#define ARPHRD_ROSE 270
|
||||
#define ARPHRD_X25 271
|
||||
#define ARPHRD_HWX25 272
|
||||
#define ARPHRD_PPP 512
|
||||
#define ARPHRD_CISCO 513
|
||||
#define ARPHRD_HDLC ARPHRD_CISCO
|
||||
#define ARPHRD_LAPB 516
|
||||
#define ARPHRD_DDCMP 517
|
||||
#define ARPHRD_RAWHDLC 518
|
||||
|
||||
#define ARPHRD_TUNNEL 768
|
||||
#define ARPHRD_TUNNEL6 769
|
||||
#define ARPHRD_FRAD 770
|
||||
#define ARPHRD_SKIP 771
|
||||
#define ARPHRD_LOOPBACK 772
|
||||
#define ARPHRD_LOCALTLK 773
|
||||
#define ARPHRD_FDDI 774
|
||||
#define ARPHRD_BIF 775
|
||||
#define ARPHRD_SIT 776
|
||||
#define ARPHRD_IPDDP 777
|
||||
#define ARPHRD_IPGRE 778
|
||||
#define ARPHRD_PIMREG 779
|
||||
#define ARPHRD_HIPPI 780
|
||||
#define ARPHRD_ASH 781
|
||||
#define ARPHRD_ECONET 782
|
||||
#define ARPHRD_IRDA 783
|
||||
|
||||
#define ARPHRD_FCPP 784
|
||||
#define ARPHRD_FCAL 785
|
||||
#define ARPHRD_FCPL 786
|
||||
#define ARPHRD_FCFABRIC 787
|
||||
|
||||
#define ARPHRD_IEEE802_TR 800
|
||||
#define ARPHRD_IEEE80211 801
|
||||
#define ARPHRD_IEEE80211_PRISM 802
|
||||
#define ARPHRD_IEEE80211_RADIOTAP 803
|
||||
|
||||
#define ARPHRD_VOID 0xFFFF
|
||||
#define ARPHRD_NONE 0xFFFE
|
||||
|
||||
#define ARPOP_REQUEST 1
|
||||
#define ARPOP_REPLY 2
|
||||
#define ARPOP_RREQUEST 3
|
||||
#define ARPOP_RREPLY 4
|
||||
#define ARPOP_InREQUEST 8
|
||||
#define ARPOP_InREPLY 9
|
||||
#define ARPOP_NAK 10
|
||||
|
||||
struct arpreq {
|
||||
struct sockaddr arp_pa;
|
||||
struct sockaddr arp_ha;
|
||||
int arp_flags;
|
||||
struct sockaddr arp_netmask;
|
||||
char arp_dev[16];
|
||||
};
|
||||
|
||||
struct arpreq_old {
|
||||
struct sockaddr arp_pa;
|
||||
struct sockaddr arp_ha;
|
||||
int arp_flags;
|
||||
struct sockaddr arp_netmask;
|
||||
};
|
||||
|
||||
#define ATF_COM 0x02
|
||||
#define ATF_PERM 0x04
|
||||
#define ATF_PUBL 0x08
|
||||
#define ATF_USETRAILERS 0x10
|
||||
#define ATF_NETMASK 0x20
|
||||
#define ATF_DONTPUB 0x40
|
||||
|
||||
struct arphdr
|
||||
{
|
||||
unsigned short ar_hrd;
|
||||
unsigned short ar_pro;
|
||||
unsigned char ar_hln;
|
||||
unsigned char ar_pln;
|
||||
unsigned short ar_op;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
100
libc/kernel/common/linux/if_bridge.h
Normal file
100
libc/kernel/common/linux/if_bridge.h
Normal file
@@ -0,0 +1,100 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_IF_BRIDGE_H
|
||||
#define _LINUX_IF_BRIDGE_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define SYSFS_BRIDGE_ATTR "bridge"
|
||||
#define SYSFS_BRIDGE_FDB "brforward"
|
||||
#define SYSFS_BRIDGE_PORT_SUBDIR "brif"
|
||||
#define SYSFS_BRIDGE_PORT_ATTR "brport"
|
||||
#define SYSFS_BRIDGE_PORT_LINK "bridge"
|
||||
|
||||
#define BRCTL_VERSION 1
|
||||
|
||||
#define BRCTL_GET_VERSION 0
|
||||
#define BRCTL_GET_BRIDGES 1
|
||||
#define BRCTL_ADD_BRIDGE 2
|
||||
#define BRCTL_DEL_BRIDGE 3
|
||||
#define BRCTL_ADD_IF 4
|
||||
#define BRCTL_DEL_IF 5
|
||||
#define BRCTL_GET_BRIDGE_INFO 6
|
||||
#define BRCTL_GET_PORT_LIST 7
|
||||
#define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
|
||||
#define BRCTL_SET_BRIDGE_HELLO_TIME 9
|
||||
#define BRCTL_SET_BRIDGE_MAX_AGE 10
|
||||
#define BRCTL_SET_AGEING_TIME 11
|
||||
#define BRCTL_SET_GC_INTERVAL 12
|
||||
#define BRCTL_GET_PORT_INFO 13
|
||||
#define BRCTL_SET_BRIDGE_STP_STATE 14
|
||||
#define BRCTL_SET_BRIDGE_PRIORITY 15
|
||||
#define BRCTL_SET_PORT_PRIORITY 16
|
||||
#define BRCTL_SET_PATH_COST 17
|
||||
#define BRCTL_GET_FDB_ENTRIES 18
|
||||
|
||||
#define BR_STATE_DISABLED 0
|
||||
#define BR_STATE_LISTENING 1
|
||||
#define BR_STATE_LEARNING 2
|
||||
#define BR_STATE_FORWARDING 3
|
||||
#define BR_STATE_BLOCKING 4
|
||||
|
||||
struct __bridge_info
|
||||
{
|
||||
__u64 designated_root;
|
||||
__u64 bridge_id;
|
||||
__u32 root_path_cost;
|
||||
__u32 max_age;
|
||||
__u32 hello_time;
|
||||
__u32 forward_delay;
|
||||
__u32 bridge_max_age;
|
||||
__u32 bridge_hello_time;
|
||||
__u32 bridge_forward_delay;
|
||||
__u8 topology_change;
|
||||
__u8 topology_change_detected;
|
||||
__u8 root_port;
|
||||
__u8 stp_enabled;
|
||||
__u32 ageing_time;
|
||||
__u32 gc_interval;
|
||||
__u32 hello_timer_value;
|
||||
__u32 tcn_timer_value;
|
||||
__u32 topology_change_timer_value;
|
||||
__u32 gc_timer_value;
|
||||
};
|
||||
|
||||
struct __port_info
|
||||
{
|
||||
__u64 designated_root;
|
||||
__u64 designated_bridge;
|
||||
__u16 port_id;
|
||||
__u16 designated_port;
|
||||
__u32 path_cost;
|
||||
__u32 designated_cost;
|
||||
__u8 state;
|
||||
__u8 top_change_ack;
|
||||
__u8 config_pending;
|
||||
__u8 unused0;
|
||||
__u32 message_age_timer_value;
|
||||
__u32 forward_delay_timer_value;
|
||||
__u32 hold_timer_value;
|
||||
};
|
||||
|
||||
struct __fdb_entry
|
||||
{
|
||||
__u8 mac_addr[6];
|
||||
__u8 port_no;
|
||||
__u8 is_local;
|
||||
__u32 ageing_timer_value;
|
||||
__u32 unused;
|
||||
};
|
||||
|
||||
#endif
|
81
libc/kernel/common/linux/if_ether.h
Normal file
81
libc/kernel/common/linux/if_ether.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_IF_ETHER_H
|
||||
#define _LINUX_IF_ETHER_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define ETH_ALEN 6
|
||||
#define ETH_HLEN 14
|
||||
#define ETH_ZLEN 60
|
||||
#define ETH_DATA_LEN 1500
|
||||
#define ETH_FRAME_LEN 1514
|
||||
|
||||
#define ETH_P_LOOP 0x0060
|
||||
#define ETH_P_PUP 0x0200
|
||||
#define ETH_P_PUPAT 0x0201
|
||||
#define ETH_P_IP 0x0800
|
||||
#define ETH_P_X25 0x0805
|
||||
#define ETH_P_ARP 0x0806
|
||||
#define ETH_P_BPQ 0x08FF
|
||||
#define ETH_P_IEEEPUP 0x0a00
|
||||
#define ETH_P_IEEEPUPAT 0x0a01
|
||||
#define ETH_P_DEC 0x6000
|
||||
#define ETH_P_DNA_DL 0x6001
|
||||
#define ETH_P_DNA_RC 0x6002
|
||||
#define ETH_P_DNA_RT 0x6003
|
||||
#define ETH_P_LAT 0x6004
|
||||
#define ETH_P_DIAG 0x6005
|
||||
#define ETH_P_CUST 0x6006
|
||||
#define ETH_P_SCA 0x6007
|
||||
#define ETH_P_RARP 0x8035
|
||||
#define ETH_P_ATALK 0x809B
|
||||
#define ETH_P_AARP 0x80F3
|
||||
#define ETH_P_8021Q 0x8100
|
||||
#define ETH_P_IPX 0x8137
|
||||
#define ETH_P_IPV6 0x86DD
|
||||
#define ETH_P_SLOW 0x8809
|
||||
#define ETH_P_WCCP 0x883E
|
||||
#define ETH_P_PPP_DISC 0x8863
|
||||
#define ETH_P_PPP_SES 0x8864
|
||||
#define ETH_P_MPLS_UC 0x8847
|
||||
#define ETH_P_MPLS_MC 0x8848
|
||||
#define ETH_P_ATMMPOA 0x884c
|
||||
#define ETH_P_ATMFATE 0x8884
|
||||
#define ETH_P_AOE 0x88A2
|
||||
#define ETH_P_TIPC 0x88CA
|
||||
|
||||
#define ETH_P_802_3 0x0001
|
||||
#define ETH_P_AX25 0x0002
|
||||
#define ETH_P_ALL 0x0003
|
||||
#define ETH_P_802_2 0x0004
|
||||
#define ETH_P_SNAP 0x0005
|
||||
#define ETH_P_DDCMP 0x0006
|
||||
#define ETH_P_WAN_PPP 0x0007
|
||||
#define ETH_P_PPP_MP 0x0008
|
||||
#define ETH_P_LOCALTALK 0x0009
|
||||
#define ETH_P_PPPTALK 0x0010
|
||||
#define ETH_P_TR_802_2 0x0011
|
||||
#define ETH_P_MOBITEX 0x0015
|
||||
#define ETH_P_CONTROL 0x0016
|
||||
#define ETH_P_IRDA 0x0017
|
||||
#define ETH_P_ECONET 0x0018
|
||||
#define ETH_P_HDLC 0x0019
|
||||
#define ETH_P_ARCNET 0x001A
|
||||
|
||||
struct ethhdr {
|
||||
unsigned char h_dest[ETH_ALEN];
|
||||
unsigned char h_source[ETH_ALEN];
|
||||
__be16 h_proto;
|
||||
} __attribute__((packed));
|
||||
|
||||
#endif
|
35
libc/kernel/common/linux/if_fc.h
Normal file
35
libc/kernel/common/linux/if_fc.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_IF_FC_H
|
||||
#define _LINUX_IF_FC_H
|
||||
|
||||
#define FC_ALEN 6
|
||||
#define FC_HLEN (sizeof(struct fch_hdr)+sizeof(struct fcllc))
|
||||
#define FC_ID_LEN 3
|
||||
|
||||
#define EXTENDED_SAP 0xAA
|
||||
#define UI_CMD 0x03
|
||||
|
||||
struct fch_hdr {
|
||||
__u8 daddr[FC_ALEN];
|
||||
__u8 saddr[FC_ALEN];
|
||||
};
|
||||
|
||||
struct fcllc {
|
||||
__u8 dsap;
|
||||
__u8 ssap;
|
||||
__u8 llc;
|
||||
__u8 protid[3];
|
||||
__be16 ethertype;
|
||||
};
|
||||
|
||||
#endif
|
83
libc/kernel/common/linux/if_fddi.h
Normal file
83
libc/kernel/common/linux/if_fddi.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_IF_FDDI_H
|
||||
#define _LINUX_IF_FDDI_H
|
||||
|
||||
#define FDDI_K_ALEN 6
|
||||
#define FDDI_K_8022_HLEN 16
|
||||
#define FDDI_K_SNAP_HLEN 21
|
||||
#define FDDI_K_8022_ZLEN 16
|
||||
#define FDDI_K_SNAP_ZLEN 21
|
||||
#define FDDI_K_8022_DLEN 4475
|
||||
#define FDDI_K_SNAP_DLEN 4470
|
||||
#define FDDI_K_LLC_ZLEN 13
|
||||
#define FDDI_K_LLC_LEN 4491
|
||||
|
||||
#define FDDI_FC_K_VOID 0x00
|
||||
#define FDDI_FC_K_NON_RESTRICTED_TOKEN 0x80
|
||||
#define FDDI_FC_K_RESTRICTED_TOKEN 0xC0
|
||||
#define FDDI_FC_K_SMT_MIN 0x41
|
||||
#define FDDI_FC_K_SMT_MAX 0x4F
|
||||
#define FDDI_FC_K_MAC_MIN 0xC1
|
||||
#define FDDI_FC_K_MAC_MAX 0xCF
|
||||
#define FDDI_FC_K_ASYNC_LLC_MIN 0x50
|
||||
#define FDDI_FC_K_ASYNC_LLC_DEF 0x54
|
||||
#define FDDI_FC_K_ASYNC_LLC_MAX 0x5F
|
||||
#define FDDI_FC_K_SYNC_LLC_MIN 0xD0
|
||||
#define FDDI_FC_K_SYNC_LLC_MAX 0xD7
|
||||
#define FDDI_FC_K_IMPLEMENTOR_MIN 0x60
|
||||
#define FDDI_FC_K_IMPLEMENTOR_MAX 0x6F
|
||||
#define FDDI_FC_K_RESERVED_MIN 0x70
|
||||
#define FDDI_FC_K_RESERVED_MAX 0x7F
|
||||
|
||||
#define FDDI_EXTENDED_SAP 0xAA
|
||||
#define FDDI_UI_CMD 0x03
|
||||
|
||||
struct fddi_8022_1_hdr
|
||||
{
|
||||
__u8 dsap;
|
||||
__u8 ssap;
|
||||
__u8 ctrl;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fddi_8022_2_hdr
|
||||
{
|
||||
__u8 dsap;
|
||||
__u8 ssap;
|
||||
__u8 ctrl_1;
|
||||
__u8 ctrl_2;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define FDDI_K_OUI_LEN 3
|
||||
struct fddi_snap_hdr
|
||||
{
|
||||
__u8 dsap;
|
||||
__u8 ssap;
|
||||
__u8 ctrl;
|
||||
__u8 oui[FDDI_K_OUI_LEN];
|
||||
__be16 ethertype;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fddihdr
|
||||
{
|
||||
__u8 fc;
|
||||
__u8 daddr[FDDI_K_ALEN];
|
||||
__u8 saddr[FDDI_K_ALEN];
|
||||
union
|
||||
{
|
||||
struct fddi_8022_1_hdr llc_8022_1;
|
||||
struct fddi_8022_2_hdr llc_8022_2;
|
||||
struct fddi_snap_hdr llc_snap;
|
||||
} hdr;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#endif
|
99
libc/kernel/common/linux/if_hippi.h
Normal file
99
libc/kernel/common/linux/if_hippi.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef _LINUX_IF_HIPPI_H
|
||||
#define _LINUX_IF_HIPPI_H
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#define HIPPI_ALEN 6
|
||||
#define HIPPI_HLEN sizeof(struct hippi_hdr)
|
||||
#define HIPPI_ZLEN 0
|
||||
#define HIPPI_DATA_LEN 65280
|
||||
#define HIPPI_FRAME_LEN (HIPPI_DATA_LEN + HIPPI_HLEN)
|
||||
|
||||
#define HIPPI_EXTENDED_SAP 0xAA
|
||||
#define HIPPI_UI_CMD 0x03
|
||||
|
||||
struct hipnet_statistics
|
||||
{
|
||||
int rx_packets;
|
||||
int tx_packets;
|
||||
int rx_errors;
|
||||
int tx_errors;
|
||||
int rx_dropped;
|
||||
int tx_dropped;
|
||||
|
||||
int rx_length_errors;
|
||||
int rx_over_errors;
|
||||
int rx_crc_errors;
|
||||
int rx_frame_errors;
|
||||
int rx_fifo_errors;
|
||||
int rx_missed_errors;
|
||||
|
||||
int tx_aborted_errors;
|
||||
int tx_carrier_errors;
|
||||
int tx_fifo_errors;
|
||||
int tx_heartbeat_errors;
|
||||
int tx_window_errors;
|
||||
};
|
||||
|
||||
struct hippi_fp_hdr
|
||||
{
|
||||
__be32 fixed;
|
||||
__be32 d2_size;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct hippi_le_hdr
|
||||
{
|
||||
#ifdef __BIG_ENDIAN_BITFIELD
|
||||
__u8 fc:3;
|
||||
__u8 double_wide:1;
|
||||
__u8 message_type:4;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 message_type:4;
|
||||
__u8 double_wide:1;
|
||||
__u8 fc:3;
|
||||
#endif
|
||||
__u8 dest_switch_addr[3];
|
||||
#ifdef __BIG_ENDIAN_BITFIELD
|
||||
__u8 dest_addr_type:4,
|
||||
src_addr_type:4;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 src_addr_type:4,
|
||||
dest_addr_type:4;
|
||||
#endif
|
||||
__u8 src_switch_addr[3];
|
||||
__u16 reserved;
|
||||
__u8 daddr[HIPPI_ALEN];
|
||||
__u16 locally_administered;
|
||||
__u8 saddr[HIPPI_ALEN];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define HIPPI_OUI_LEN 3
|
||||
|
||||
struct hippi_snap_hdr
|
||||
{
|
||||
__u8 dsap;
|
||||
__u8 ssap;
|
||||
__u8 ctrl;
|
||||
__u8 oui[HIPPI_OUI_LEN];
|
||||
__be16 ethertype;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct hippi_hdr
|
||||
{
|
||||
struct hippi_fp_hdr fp;
|
||||
struct hippi_le_hdr le;
|
||||
struct hippi_snap_hdr snap;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#endif
|
96
libc/kernel/common/linux/if_packet.h
Normal file
96
libc/kernel/common/linux/if_packet.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
***
|
||||
*** This header was automatically generated from a Linux kernel header
|
||||
*** of the same name, to make information necessary for userspace to
|
||||
*** call into the kernel available to libc. It contains only constants,
|
||||
*** structures, and macros generated from the original header, and thus,
|
||||
*** contains no copyrightable information.
|
||||
***
|
||||
****************************************************************************
|
||||
****************************************************************************/
|
||||
#ifndef __LINUX_IF_PACKET_H
|
||||
#define __LINUX_IF_PACKET_H
|
||||
|
||||
struct sockaddr_pkt
|
||||
{
|
||||
unsigned short spkt_family;
|
||||
unsigned char spkt_device[14];
|
||||
unsigned short spkt_protocol;
|
||||
};
|
||||
|
||||
struct sockaddr_ll
|
||||
{
|
||||
unsigned short sll_family;
|
||||
unsigned short sll_protocol;
|
||||
int sll_ifindex;
|
||||
unsigned short sll_hatype;
|
||||
unsigned char sll_pkttype;
|
||||
unsigned char sll_halen;
|
||||
unsigned char sll_addr[8];
|
||||
};
|
||||
|
||||
#define PACKET_HOST 0
|
||||
#define PACKET_BROADCAST 1
|
||||
#define PACKET_MULTICAST 2
|
||||
#define PACKET_OTHERHOST 3
|
||||
#define PACKET_OUTGOING 4
|
||||
|
||||
#define PACKET_LOOPBACK 5
|
||||
#define PACKET_FASTROUTE 6
|
||||
|
||||
#define PACKET_ADD_MEMBERSHIP 1
|
||||
#define PACKET_DROP_MEMBERSHIP 2
|
||||
#define PACKET_RECV_OUTPUT 3
|
||||
|
||||
#define PACKET_RX_RING 5
|
||||
#define PACKET_STATISTICS 6
|
||||
#define PACKET_COPY_THRESH 7
|
||||
|
||||
struct tpacket_stats
|
||||
{
|
||||
unsigned int tp_packets;
|
||||
unsigned int tp_drops;
|
||||
};
|
||||
|
||||
struct tpacket_hdr
|
||||
{
|
||||
unsigned long tp_status;
|
||||
#define TP_STATUS_KERNEL 0
|
||||
#define TP_STATUS_USER 1
|
||||
#define TP_STATUS_COPY 2
|
||||
#define TP_STATUS_LOSING 4
|
||||
#define TP_STATUS_CSUMNOTREADY 8
|
||||
unsigned int tp_len;
|
||||
unsigned int tp_snaplen;
|
||||
unsigned short tp_mac;
|
||||
unsigned short tp_net;
|
||||
unsigned int tp_sec;
|
||||
unsigned int tp_usec;
|
||||
};
|
||||
|
||||
#define TPACKET_ALIGNMENT 16
|
||||
#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1))
|
||||
#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll))
|
||||
|
||||
struct tpacket_req
|
||||
{
|
||||
unsigned int tp_block_size;
|
||||
unsigned int tp_block_nr;
|
||||
unsigned int tp_frame_size;
|
||||
unsigned int tp_frame_nr;
|
||||
};
|
||||
|
||||
struct packet_mreq
|
||||
{
|
||||
int mr_ifindex;
|
||||
unsigned short mr_type;
|
||||
unsigned short mr_alen;
|
||||
unsigned char mr_address[8];
|
||||
};
|
||||
|
||||
#define PACKET_MR_MULTICAST 0
|
||||
#define PACKET_MR_PROMISC 1
|
||||
#define PACKET_MR_ALLMULTI 2
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user