# Generated by h2py from /usr/include/sys/socket.h

# Included from machine/param.h

# Included from machine/cpu.h

# Included from machine/trap.h
T_NONEXIST = 0
T_HPMC = 1
T_POWERFAIL = 2
T_RECOVERY = 3
T_INTERRUPT = 4
T_LPMC = 5
T_ITLBMISS = 6
T_IPROT = 7
T_ILLEGAL = 8
T_IBREAK = 9
T_PRIV_OP = 10
T_PRIV_REG = 11
T_OVERFLOW = 12
T_CONDITION = 13
T_EXCEPTION = 14
T_DTLBMISS = 15
T_ITLBMISSNA = 16
T_DTLBMISSNA = 17
T_DPROT = 18
T_DBREAK = 19
T_TLB_DIRTY = 20
T_PAGEREF = 21
T_EMULATION = 22
T_HIGHERPL = 23
T_LOWERPL = 24
T_TAKENBR = 25
T_DATACC = 26
T_DATAPID = 27
T_DATALIGN = 28
T_USER_POS = 25
T_USER = (1 << (31 - T_USER_POS))
TFF_LAST_POS = 0
TFF_ITLB_POS = 1
TFF_SYS_POS = 2
TFF_INTR_POS = 3
TFF_LAST = (1 << (31 - TFF_LAST_POS))
TFF_ITLB = (1 << (31 - TFF_ITLB_POS))
TFF_SYS = (1 << (31 - TFF_SYS_POS))
TFF_INTR = (1 << (31 - TFF_INTR_POS))
T_BITS = "\020\07user\036intr\037itlb\040last"
HPPA_BREAK_KERNEL = 0
HPPA_BREAK_KGDB = 5
HPPA_BREAK_GET_PSW = 9
HPPA_BREAK_SET_PSW = 10
HPPA_BREAK_SPLLOWER = 11
def break5(i): return ((i) & 0x1f)

def break13(i): return (((i) >> 13) & 0x1fff)


# Included from machine/frame.h
HPPA_FRAME_NARGS = (12)
HPPA_FRAME_MAXARGS = (HPPA_FRAME_NARGS * 4)
def HPPA_FRAME_ARG(n): return (-(32 + 4*((n) + 1)))

HPPA_FRAME_SIZE = (64)
HPPA_FRAME_PSP = (-4)
HPPA_FRAME_EP = (-8)
HPPA_FRAME_CLUP = (-12)
HPPA_FRAME_SL = (-16)
HPPA_FRAME_CRP = (-20)
HPPA_FRAME_ERP = (-24)
HPPA_FRAME_ESR4 = (-28)
HPPA_FRAME_EDP = (-32)
HPPA_PC_PRIV_MASK = 3
HPPA_PC_PRIV_KERN = 0
HPPA_PC_PRIV_USER = 3
HPPA_FTRS_TLBU = 0x00000001
HPPA_FTRS_BTLBU = 0x00000002
HPPA_FTRS_HVT = 0x00000004
HPPA_FTRS_W32B = 0x00000008
HPPA_FPUS = 0xc0
def HPPA_FPUVER(w): return (((w) & 0x003ff800) >> 11)

def HPPA_FPU_OP(w): return ((w) >> 26)

HPPA_FPU_UNMPL = 0x01
HPPA_FPU_ILL = 0x80
HPPA_FPU_I = 0x01
HPPA_FPU_U = 0x02
HPPA_FPU_O = 0x04
HPPA_FPU_Z = 0x08
HPPA_FPU_V = 0x10
HPPA_FPU_D = 0x20
HPPA_FPU_T = 0x40
HPPA_FPU_XMASK = 0x7f
HPPA_FPU_T_POS = 25
HPPA_FPU_RM = 0x00000600
HPPA_FPU_CQ = 0x00fff800
HPPA_FPU_C = 0x04000000
HPPA_FPU_FLSH = 27
HPPA_FPU_INIT = (0)
def HPPA_FPU_FORK(s): return ((s) & ~((u_int64_t)(HPPA_FPU_XMASK)<<32))

HPPA_PMSFUS = 0x20
HPPA_PGALIAS = 0x00100000
HPPA_PGAMASK = 0xfff00000
HPPA_PGAOFF = 0x000fffff
HPPA_IOSPACE = 0xf0000000
HPPA_IOBCAST = 0xfffc0000
HPPA_PDC_LOW = 0xef000000
HPPA_PDC_HIGH = 0xf1000000
HPPA_FPA = 0xfff80000
HPPA_FLEX_DATA = 0xfff80001
HPPA_DMA_ENABLE = 0x00000001
HPPA_FLEX_MASK = 0xfffc0000
def HPPA_FLEX(a): return (((a) & HPPA_FLEX_MASK) >> 18)

HPPA_SPA_ENABLE = 0x00000020
HPPA_NMODSPBUS = 64
def signotify(p): return (setsoftast())

MD_CACHE_FLUSH = 0
MD_CACHE_PURGE = 1
def DELAY(x): return delay(x)

BOOTARG_OFF = (0x10000)
CPU_CONSDEV = 1
CPU_FPU = 2
CPU_MAXID = 3

# Included from machine/intr.h

# Included from machine/psl.h
PSL_Y_POS = (0)
PSL_Z_POS = (1)
PSL_SS_POS = (3)
PSL_E_POS = (5)
PSL_S_POS = (6)
PSL_T_POS = (7)
PSL_H_POS = (8)
PSL_L_POS = (9)
PSL_N_POS = (10)
PSL_X_POS = (11)
PSL_B_POS = (12)
PSL_C_POS = (13)
PSL_V_POS = (14)
PSL_M_POS = (15)
PSL_CB_POS = (16)
PSL_G_POS = (25)
PSL_F_POS = (26)
PSL_R_POS = (27)
PSL_Q_POS = (28)
PSL_P_POS = (29)
PSL_D_POS = (30)
PSL_I_POS = (31)
PSL_BITS = "\020\001I\002D\003P\004Q\005R\006F\007G"  \
			"\021M\022V\023C\024B\025X\026N\027L\030H" \
			"\031T\032S\033E\037Z\040Y"
PSL_Y = (1 << (31-PSL_Y_POS))
PSL_Z = (1 << (31-PSL_Z_POS))
PSL_SS = (1 << (31-PSL_SS_POS))
PSL_E = (1 << (31-PSL_E_POS))
PSL_S = (1 << (31-PSL_S_POS))
PSL_T = (1 << (31-PSL_T_POS))
PSL_H = (1 << (31-PSL_H_POS))
PSL_L = (1 << (31-PSL_L_POS))
PSL_N = (1 << (31-PSL_N_POS))
PSL_X = (1 << (31-PSL_X_POS))
PSL_B = (1 << (31-PSL_B_POS))
PSL_C = (1 << (31-PSL_C_POS))
PSL_V = (1 << (31-PSL_V_POS))
PSL_M = (1 << (31-PSL_M_POS))
PSL_CB = (1 << (31-PSL_CB_POS))
PSL_G = (1 << (31-PSL_G_POS))
PSL_F = (1 << (31-PSL_F_POS))
PSL_R = (1 << (31-PSL_R_POS))
PSL_Q = (1 << (31-PSL_Q_POS))
PSL_P = (1 << (31-PSL_P_POS))
PSL_D = (1 << (31-PSL_D_POS))
PSL_I = (1 << (31-PSL_I_POS))
RESET_PSL = (PSL_R | PSL_Q | PSL_P | PSL_D | PSL_I)
CPU_NINTS = 32
NIPL = 16
IPL_NONE = 0
IPL_SOFTCLOCK = 1
IPL_SOFTNET = 2
IPL_BIO = 3
IPL_NET = 4
IPL_SOFTTTY = 5
IPL_TTY = 6
IPL_VM = 7
IPL_AUDIO = 8
IPL_CLOCK = 9
IPL_STATCLOCK = 10
IPL_HIGH = 10
IPL_NESTED = 11
IST_NONE = 0
IST_PULSE = 1
IST_EDGE = 2
IST_LEVEL = 3
SOFTINT_MASK = ((1 << (IPL_SOFTCLOCK - 1)) | \
    (1 << (IPL_SOFTNET - 1)) | (1 << (IPL_SOFTTTY - 1)))
MACHINE = "hppa"
MACHINE_ARCH = "hppa"
ALIGNBYTES = 7
def ALIGN(p): return (((u_long)(p) + ALIGNBYTES) &~ ALIGNBYTES)

PAGE_SIZE = 4096
PAGE_MASK = (PAGE_SIZE-1)
PAGE_SHIFT = 12
NBPG = 4096
PGOFSET = (NBPG-1)
PGSHIFT = 12
KERNBASE = 0x00000000
DEV_BSIZE = 512
DEV_BSHIFT = 9
BLKDEV_IOSIZE = 2048
MAXPHYS = (64 * 1024)
MACHINE_STACK_GROWS_UP = 1
SSIZE = (4)
SINCR = (1)
USPACE = (4 * NBPG)
USPACE_ALIGN = (0)
MSGBUFSIZE = 2*NBPG
MSIZE = 256
MCLSHIFT = 11
MCLBYTES = (1 << MCLSHIFT)
MCLOFSET = (MCLBYTES - 1)
NMBCLUSTERS = 4096
NKMEMPAGES_MIN_DEFAULT = ((4 * 1024 * 1024) >> PAGE_SHIFT)
NKMEMPAGES_MAX_DEFAULT = ((64 * 1024 * 1024) >> PAGE_SHIFT)
def ctod(x): return ((x) << (PGSHIFT - DEV_BSHIFT))

def dtoc(x): return ((x) >> (PGSHIFT - DEV_BSHIFT))

def ctob(x): return ((x) << PGSHIFT)

def btoc(x): return (((x) + PGOFSET) >> PGSHIFT)

def btodb(x): return ((x) >> DEV_BSHIFT)

def dbtob(x): return ((x) << DEV_BSHIFT)

def bdbtofsb(bn): return ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))

HPMMMASK = 0xF0000000
def ISHPMMADDR(v): return 0		 

def HPMMBASEADDR(v): return ((unsigned)(v) & ~HPMMMASK)

COM_FREQ = 7372800
SOCK_STREAM = 1
SOCK_DGRAM = 2
SOCK_RAW = 3
SOCK_RDM = 4
SOCK_SEQPACKET = 5
SO_DEBUG = 0x0001
SO_ACCEPTCONN = 0x0002
SO_REUSEADDR = 0x0004
SO_KEEPALIVE = 0x0008
SO_DONTROUTE = 0x0010
SO_BROADCAST = 0x0020
SO_USELOOPBACK = 0x0040
SO_LINGER = 0x0080
SO_OOBINLINE = 0x0100
SO_REUSEPORT = 0x0200
SO_SNDBUF = 0x1001
SO_RCVBUF = 0x1002
SO_SNDLOWAT = 0x1003
SO_RCVLOWAT = 0x1004
SO_SNDTIMEO = 0x1005
SO_RCVTIMEO = 0x1006
SO_ERROR = 0x1007
SO_TYPE = 0x1008
SO_NETPROC = 0x1020
SOL_SOCKET = 0xffff
AF_UNSPEC = 0
AF_LOCAL = 1
AF_UNIX = AF_LOCAL
AF_INET = 2
AF_IMPLINK = 3
AF_PUP = 4
AF_CHAOS = 5
AF_NS = 6
AF_ISO = 7
AF_OSI = AF_ISO
AF_ECMA = 8
AF_DATAKIT = 9
AF_CCITT = 10
AF_SNA = 11
AF_DECnet = 12
AF_DLI = 13
AF_LAT = 14
AF_HYLINK = 15
AF_APPLETALK = 16
AF_ROUTE = 17
AF_LINK = 18
pseudo_AF_XTP = 19
AF_COIP = 20
AF_CNT = 21
pseudo_AF_RTIP = 22
AF_IPX = 23
AF_INET6 = 24
pseudo_AF_PIP = 25
AF_ISDN = 26
AF_E164 = AF_ISDN
AF_NATM = 27
AF_ENCAP = 28
AF_SIP = 29
AF_KEY = 30
pseudo_AF_HDRCMPLT = 31
AF_MAX = 32
PF_UNSPEC = AF_UNSPEC
PF_LOCAL = AF_LOCAL
PF_UNIX = PF_LOCAL
PF_INET = AF_INET
PF_IMPLINK = AF_IMPLINK
PF_PUP = AF_PUP
PF_CHAOS = AF_CHAOS
PF_NS = AF_NS
PF_ISO = AF_ISO
PF_OSI = AF_ISO
PF_ECMA = AF_ECMA
PF_DATAKIT = AF_DATAKIT
PF_CCITT = AF_CCITT
PF_SNA = AF_SNA
PF_DECnet = AF_DECnet
PF_DLI = AF_DLI
PF_LAT = AF_LAT
PF_HYLINK = AF_HYLINK
PF_APPLETALK = AF_APPLETALK
PF_ROUTE = AF_ROUTE
PF_LINK = AF_LINK
PF_XTP = pseudo_AF_XTP
PF_COIP = AF_COIP
PF_CNT = AF_CNT
PF_IPX = AF_IPX
PF_INET6 = AF_INET6
PF_PIP = pseudo_AF_PIP
PF_ISDN = AF_ISDN
PF_NATM = AF_NATM
PF_ENCAP = AF_ENCAP
PF_SIP = AF_SIP
PF_KEY = AF_KEY
PF_BPF = pseudo_AF_HDRCMPLT
PF_MAX = AF_MAX
SHUT_RD = 0
SHUT_WR = 1
SHUT_RDWR = 2
def SOCKCREDSIZE(ngrps): return \

NET_MAXID = AF_MAX
NET_RT_DUMP = 1
NET_RT_FLAGS = 2
NET_RT_IFLIST = 3
NET_RT_MAXID = 4
NET_BPF_BUFSIZE = 1
NET_BPF_MAXBUFSIZE = 2
NET_BPF_MAXID = 3
SOMAXCONN = 128
MSG_OOB = 0x1
MSG_PEEK = 0x2
MSG_DONTROUTE = 0x4
MSG_EOR = 0x8
MSG_TRUNC = 0x10
MSG_CTRUNC = 0x20
MSG_WAITALL = 0x40
MSG_DONTWAIT = 0x80
MSG_BCAST = 0x100
MSG_MCAST = 0x200
def CMSG_DATA(cmsg): return \

def CMSG_FIRSTHDR(mhdr): return \

def __CMSG_ALIGN(len): return ALIGN(len)

def CMSG_ALIGN(n): return __CMSG_ALIGN(n)

SCM_RIGHTS = 0x01
SCM_CREDS = 0x02

# Included from sys/cdefs.h

# Included from machine/cdefs.h
def __P(protos): return protos		 

def __STRING(x): return #x

def __P(protos): return ()		 

def __STRING(x): return "x"

def __attribute__(x): return  

def __predict_true(exp): return __builtin_expect(((exp) != 0), 1)

def __predict_false(exp): return __builtin_expect(((exp) != 0), 0)

def __predict_true(exp): return ((exp) != 0)

def __predict_false(exp): return ((exp) != 0)

MSG_COMPAT = 0x8000
