Commit 9836d345 authored by David S. Miller's avatar David S. Miller

Merge tag 'disintegrate-sparc-20121009' of git://git.infradead.org/users/dhowells/linux-headers

UAPI Disintegration 2012-10-09
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 547b1e81 54579826
# User exported sparc header files
include include/asm-generic/Kbuild.asm
header-y += apc.h
header-y += asi.h
header-y += display7seg.h
header-y += envctrl.h
header-y += fbio.h
header-y += jsflash.h
header-y += openpromio.h
header-y += perfctr.h
header-y += psrcompat.h
header-y += psr.h
header-y += pstate.h
header-y += traps.h
header-y += uctx.h
header-y += utrap.h
header-y += watchdog.h
generic-y += clkdev.h
generic-y += div64.h
......
#ifndef __LINUX_FBIO_H
#define __LINUX_FBIO_H
#include <linux/compiler.h>
#include <linux/types.h>
#include <uapi/asm/fbio.h>
/* Constants used for fbio SunOS compatibility */
/* (C) 1996 Miguel de Icaza */
/* Frame buffer types */
#define FBTYPE_NOTYPE -1
#define FBTYPE_SUN1BW 0 /* mono */
#define FBTYPE_SUN1COLOR 1
#define FBTYPE_SUN2BW 2
#define FBTYPE_SUN2COLOR 3
#define FBTYPE_SUN2GP 4
#define FBTYPE_SUN5COLOR 5
#define FBTYPE_SUN3COLOR 6
#define FBTYPE_MEMCOLOR 7
#define FBTYPE_SUN4COLOR 8
#define FBTYPE_NOTSUN1 9
#define FBTYPE_NOTSUN2 10
#define FBTYPE_NOTSUN3 11
#define FBTYPE_SUNFAST_COLOR 12 /* cg6 */
#define FBTYPE_SUNROP_COLOR 13
#define FBTYPE_SUNFB_VIDEO 14
#define FBTYPE_SUNGIFB 15
#define FBTYPE_SUNGPLAS 16
#define FBTYPE_SUNGP3 17
#define FBTYPE_SUNGT 18
#define FBTYPE_SUNLEO 19 /* zx Leo card */
#define FBTYPE_MDICOLOR 20 /* cg14 */
#define FBTYPE_TCXCOLOR 21 /* SUNW,tcx card */
#define FBTYPE_LASTPLUSONE 21 /* This is not last + 1 in fact... */
/* Does not seem to be listed in the Sun file either */
#define FBTYPE_CREATOR 22
#define FBTYPE_PCI_IGA1682 23
#define FBTYPE_P9100COLOR 24
#define FBTYPE_PCI_GENERIC 1000
#define FBTYPE_PCI_MACH64 1001
/* fbio ioctls */
/* Returned by FBIOGTYPE */
struct fbtype {
int fb_type; /* fb type, see above */
int fb_height; /* pixels */
int fb_width; /* pixels */
int fb_depth;
int fb_cmsize; /* color map entries */
int fb_size; /* fb size in bytes */
};
#define FBIOGTYPE _IOR('F', 0, struct fbtype)
struct fbcmap {
int index; /* first element (0 origin) */
int count;
unsigned char __user *red;
unsigned char __user *green;
unsigned char __user *blue;
};
#ifdef __KERNEL__
#define FBIOPUTCMAP_SPARC _IOW('F', 3, struct fbcmap)
#define FBIOGETCMAP_SPARC _IOW('F', 4, struct fbcmap)
#else
#define FBIOPUTCMAP _IOW('F', 3, struct fbcmap)
#define FBIOGETCMAP _IOW('F', 4, struct fbcmap)
#endif
/* # of device specific values */
#define FB_ATTR_NDEVSPECIFIC 8
/* # of possible emulations */
#define FB_ATTR_NEMUTYPES 4
struct fbsattr {
int flags;
int emu_type; /* -1 if none */
int dev_specific[FB_ATTR_NDEVSPECIFIC];
};
struct fbgattr {
int real_type; /* real frame buffer type */
int owner; /* unknown */
struct fbtype fbtype; /* real frame buffer fbtype */
struct fbsattr sattr;
int emu_types[FB_ATTR_NEMUTYPES]; /* supported emulations */
};
#define FBIOSATTR _IOW('F', 5, struct fbgattr) /* Unsupported: */
#define FBIOGATTR _IOR('F', 6, struct fbgattr) /* supported */
#define FBIOSVIDEO _IOW('F', 7, int)
#define FBIOGVIDEO _IOR('F', 8, int)
struct fbcursor {
short set; /* what to set, choose from the list above */
short enable; /* cursor on/off */
struct fbcurpos pos; /* cursor position */
struct fbcurpos hot; /* cursor hot spot */
struct fbcmap cmap; /* color map info */
struct fbcurpos size; /* cursor bit map size */
char __user *image; /* cursor image bits */
char __user *mask; /* cursor mask bits */
};
/* set/get cursor attributes/shape */
#define FBIOSCURSOR _IOW('F', 24, struct fbcursor)
#define FBIOGCURSOR _IOWR('F', 25, struct fbcursor)
/* set/get cursor position */
#define FBIOSCURPOS _IOW('F', 26, struct fbcurpos)
#define FBIOGCURPOS _IOW('F', 27, struct fbcurpos)
/* get max cursor size */
#define FBIOGCURMAX _IOR('F', 28, struct fbcurpos)
/* wid manipulation */
struct fb_wid_alloc {
#define FB_WID_SHARED_8 0
#define FB_WID_SHARED_24 1
#define FB_WID_DBL_8 2
#define FB_WID_DBL_24 3
__u32 wa_type;
__s32 wa_index; /* Set on return */
__u32 wa_count;
};
struct fb_wid_item {
__u32 wi_type;
__s32 wi_index;
__u32 wi_attrs;
__u32 wi_values[32];
};
struct fb_wid_list {
__u32 wl_flags;
__u32 wl_count;
struct fb_wid_item *wl_list;
};
#define FBIO_WID_ALLOC _IOWR('F', 30, struct fb_wid_alloc)
#define FBIO_WID_FREE _IOW('F', 31, struct fb_wid_alloc)
#define FBIO_WID_PUT _IOW('F', 32, struct fb_wid_list)
#define FBIO_WID_GET _IOWR('F', 33, struct fb_wid_list)
/* Creator ioctls */
#define FFB_IOCTL ('F'<<8)
#define FFB_SYS_INFO (FFB_IOCTL|80)
#define FFB_CLUTREAD (FFB_IOCTL|81)
#define FFB_CLUTPOST (FFB_IOCTL|82)
#define FFB_SETDIAGMODE (FFB_IOCTL|83)
#define FFB_GETMONITORID (FFB_IOCTL|84)
#define FFB_GETVIDEOMODE (FFB_IOCTL|85)
#define FFB_SETVIDEOMODE (FFB_IOCTL|86)
#define FFB_SETSERVER (FFB_IOCTL|87)
#define FFB_SETOVCTL (FFB_IOCTL|88)
#define FFB_GETOVCTL (FFB_IOCTL|89)
#define FFB_GETSAXNUM (FFB_IOCTL|90)
#define FFB_FBDEBUG (FFB_IOCTL|91)
/* Cg14 ioctls */
#define MDI_IOCTL ('M'<<8)
#define MDI_RESET (MDI_IOCTL|1)
#define MDI_GET_CFGINFO (MDI_IOCTL|2)
#define MDI_SET_PIXELMODE (MDI_IOCTL|3)
# define MDI_32_PIX 32
# define MDI_16_PIX 16
# define MDI_8_PIX 8
struct mdi_cfginfo {
int mdi_ncluts; /* Number of implemented CLUTs in this MDI */
int mdi_type; /* FBTYPE name */
int mdi_height; /* height */
int mdi_width; /* width */
int mdi_size; /* available ram */
int mdi_mode; /* 8bpp, 16bpp or 32bpp */
int mdi_pixfreq; /* pixel clock (from PROM) */
};
/* SparcLinux specific ioctl for the MDI, should be replaced for
* the SET_XLUT/SET_CLUTn ioctls instead
*/
#define MDI_CLEAR_XLUT (MDI_IOCTL|9)
/* leo & ffb ioctls */
struct fb_clut_alloc {
__u32 clutid; /* Set on return */
__u32 flag;
__u32 index;
};
struct fb_clut {
#define FB_CLUT_WAIT 0x00000001 /* Not yet implemented */
__u32 flag;
__u32 clutid;
__u32 offset;
__u32 count;
char * red;
char * green;
char * blue;
};
struct fb_clut32 {
__u32 flag;
__u32 clutid;
__u32 offset;
__u32 count;
__u32 red;
__u32 green;
__u32 blue;
};
#define LEO_CLUTALLOC _IOWR('L', 53, struct fb_clut_alloc)
#define LEO_CLUTFREE _IOW('L', 54, struct fb_clut_alloc)
#define LEO_CLUTREAD _IOW('L', 55, struct fb_clut)
#define LEO_CLUTPOST _IOW('L', 56, struct fb_clut)
#define LEO_SETGAMMA _IOW('L', 68, int) /* Not yet implemented */
#define LEO_GETGAMMA _IOR('L', 69, int) /* Not yet implemented */
#ifdef __KERNEL__
/* Addresses on the fd of a cgsix that are mappable */
#define CG6_FBC 0x70000000
#define CG6_TEC 0x70001000
......@@ -260,47 +45,6 @@ struct fb_clut32 {
#define CG14_CLUT3 0x6000 /* Color Look Up Table */
#define CG14_AUTO 0xf000
#endif /* KERNEL */
/* These are exported to userland for applications to use */
/* Mappable offsets for the cg14: control registers */
#define MDI_DIRECT_MAP 0x10000000
#define MDI_CTLREG_MAP 0x20000000
#define MDI_CURSOR_MAP 0x30000000
#define MDI_SHDW_VRT_MAP 0x40000000
/* Mappable offsets for the cg14: frame buffer resolutions */
/* 32 bits */
#define MDI_CHUNKY_XBGR_MAP 0x50000000
#define MDI_CHUNKY_BGR_MAP 0x60000000
/* 16 bits */
#define MDI_PLANAR_X16_MAP 0x70000000
#define MDI_PLANAR_C16_MAP 0x80000000
/* 8 bit is done as CG3 MMAP offset */
/* 32 bits, planar */
#define MDI_PLANAR_X32_MAP 0x90000000
#define MDI_PLANAR_B32_MAP 0xa0000000
#define MDI_PLANAR_G32_MAP 0xb0000000
#define MDI_PLANAR_R32_MAP 0xc0000000
/* Mappable offsets on leo */
#define LEO_SS0_MAP 0x00000000
#define LEO_LC_SS0_USR_MAP 0x00800000
#define LEO_LD_SS0_MAP 0x00801000
#define LEO_LX_CURSOR_MAP 0x00802000
#define LEO_SS1_MAP 0x00803000
#define LEO_LC_SS1_USR_MAP 0x01003000
#define LEO_LD_SS1_MAP 0x01004000
#define LEO_UNK_MAP 0x01005000
#define LEO_LX_KRN_MAP 0x01006000
#define LEO_LC_SS0_KRN_MAP 0x01007000
#define LEO_LC_SS1_KRN_MAP 0x01008000
#define LEO_LD_GBL_MAP 0x01009000
#define LEO_UNK2_MAP 0x0100a000
#ifdef __KERNEL__
struct fbcmap32 {
int index; /* first element (0 origin) */
int count;
......@@ -325,6 +69,4 @@ struct fbcursor32 {
#define FBIOSCURSOR32 _IOW('F', 24, struct fbcursor32)
#define FBIOGCURSOR32 _IOW('F', 25, struct fbcursor32)
#endif
#endif /* __LINUX_FBIO_H */
#ifndef _ASM_SPARC_IOCTLS_H
#define _ASM_SPARC_IOCTLS_H
#include <asm/ioctl.h>
#include <uapi/asm/ioctls.h>
/* Big T */
#define TCGETA _IOR('T', 1, struct termio)
#define TCSETA _IOW('T', 2, struct termio)
#define TCSETAW _IOW('T', 3, struct termio)
#define TCSETAF _IOW('T', 4, struct termio)
#define TCSBRK _IO('T', 5)
#define TCXONC _IO('T', 6)
#define TCFLSH _IO('T', 7)
#define TCGETS _IOR('T', 8, struct termios)
#define TCSETS _IOW('T', 9, struct termios)
#define TCSETSW _IOW('T', 10, struct termios)
#define TCSETSF _IOW('T', 11, struct termios)
#define TCGETS2 _IOR('T', 12, struct termios2)
#define TCSETS2 _IOW('T', 13, struct termios2)
#define TCSETSW2 _IOW('T', 14, struct termios2)
#define TCSETSF2 _IOW('T', 15, struct termios2)
#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
#define TIOCVHANGUP _IO('T', 0x37)
/* Note that all the ioctls that are not available in Linux have a
* double underscore on the front to: a) avoid some programs to
* think we support some ioctls under Linux (autoconfiguration stuff)
*/
/* Little t */
#define TIOCGETD _IOR('t', 0, int)
#define TIOCSETD _IOW('t', 1, int)
#define __TIOCHPCL _IO('t', 2) /* SunOS Specific */
#define __TIOCMODG _IOR('t', 3, int) /* SunOS Specific */
#define __TIOCMODS _IOW('t', 4, int) /* SunOS Specific */
#define __TIOCGETP _IOR('t', 8, struct sgttyb) /* SunOS Specific */
#define __TIOCSETP _IOW('t', 9, struct sgttyb) /* SunOS Specific */
#define __TIOCSETN _IOW('t', 10, struct sgttyb) /* SunOS Specific */
#define TIOCEXCL _IO('t', 13)
#define TIOCNXCL _IO('t', 14)
#define __TIOCFLUSH _IOW('t', 16, int) /* SunOS Specific */
#define __TIOCSETC _IOW('t', 17, struct tchars) /* SunOS Specific */
#define __TIOCGETC _IOR('t', 18, struct tchars) /* SunOS Specific */
#define __TIOCTCNTL _IOW('t', 32, int) /* SunOS Specific */
#define __TIOCSIGNAL _IOW('t', 33, int) /* SunOS Specific */
#define __TIOCSETX _IOW('t', 34, int) /* SunOS Specific */
#define __TIOCGETX _IOR('t', 35, int) /* SunOS Specific */
#define TIOCCONS _IO('t', 36)
#define TIOCGSOFTCAR _IOR('t', 100, int)
#define TIOCSSOFTCAR _IOW('t', 101, int)
#define __TIOCUCNTL _IOW('t', 102, int) /* SunOS Specific */
#define TIOCSWINSZ _IOW('t', 103, struct winsize)
#define TIOCGWINSZ _IOR('t', 104, struct winsize)
#define __TIOCREMOTE _IOW('t', 105, int) /* SunOS Specific */
#define TIOCMGET _IOR('t', 106, int)
#define TIOCMBIC _IOW('t', 107, int)
#define TIOCMBIS _IOW('t', 108, int)
#define TIOCMSET _IOW('t', 109, int)
#define TIOCSTART _IO('t', 110)
#define TIOCSTOP _IO('t', 111)
#define TIOCPKT _IOW('t', 112, int)
#define TIOCNOTTY _IO('t', 113)
#define TIOCSTI _IOW('t', 114, char)
#define TIOCOUTQ _IOR('t', 115, int)
#define __TIOCGLTC _IOR('t', 116, struct ltchars) /* SunOS Specific */
#define __TIOCSLTC _IOW('t', 117, struct ltchars) /* SunOS Specific */
/* 118 is the non-posix setpgrp tty ioctl */
/* 119 is the non-posix getpgrp tty ioctl */
#define __TIOCCDTR _IO('t', 120) /* SunOS Specific */
#define __TIOCSDTR _IO('t', 121) /* SunOS Specific */
#define TIOCCBRK _IO('t', 122)
#define TIOCSBRK _IO('t', 123)
#define __TIOCLGET _IOW('t', 124, int) /* SunOS Specific */
#define __TIOCLSET _IOW('t', 125, int) /* SunOS Specific */
#define __TIOCLBIC _IOW('t', 126, int) /* SunOS Specific */
#define __TIOCLBIS _IOW('t', 127, int) /* SunOS Specific */
#define __TIOCISPACE _IOR('t', 128, int) /* SunOS Specific */
#define __TIOCISIZE _IOR('t', 129, int) /* SunOS Specific */
#define TIOCSPGRP _IOW('t', 130, int)
#define TIOCGPGRP _IOR('t', 131, int)
#define TIOCSCTTY _IO('t', 132)
#define TIOCGSID _IOR('t', 133, int)
/* Get minor device of a pty master's FD -- Solaris equiv is ISPTM */
#define TIOCGPTN _IOR('t', 134, unsigned int) /* Get Pty Number */
#define TIOCSPTLCK _IOW('t', 135, int) /* Lock/unlock PTY */
#define TIOCSIG _IOW('t', 136, int) /* Generate signal on Pty slave */
/* Little f */
#define FIOCLEX _IO('f', 1)
#define FIONCLEX _IO('f', 2)
#define FIOASYNC _IOW('f', 125, int)
#define FIONBIO _IOW('f', 126, int)
#define FIONREAD _IOR('f', 127, int)
#define TIOCINQ FIONREAD
#define FIOQSIZE _IOR('f', 128, loff_t)
/* SCARY Rutgers local SunOS kernel hackery, perhaps I will support it
* someday. This is completely bogus, I know...
*/
#define __TCGETSTAT _IO('T', 200) /* Rutgers specific */
#define __TCSETSTAT _IO('T', 201) /* Rutgers specific */
/* Linux specific, no SunOS equivalent. */
#define TIOCLINUX 0x541C
#define TIOCGSERIAL 0x541E
#define TIOCSSERIAL 0x541F
#define TCSBRKP 0x5425
#define TIOCSERCONFIG 0x5453
#define TIOCSERGWILD 0x5454
#define TIOCSERSWILD 0x5455
#define TIOCGLCKTRMIOS 0x5456
#define TIOCSLCKTRMIOS 0x5457
#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
#define TIOCSERGETLSR 0x5459 /* Get line status register */
#define TIOCSERGETMULTI 0x545A /* Get multiport config */
#define TIOCSERSETMULTI 0x545B /* Set multiport config */
#define TIOCMIWAIT 0x545C /* Wait for change on serial input line(s) */
#define TIOCGICOUNT 0x545D /* Read serial port inline interrupt counts */
/* Kernel definitions */
#ifdef __KERNEL__
#define TIOCGETC __TIOCGETC
#define TIOCGETP __TIOCGETP
#define TIOCGLTC __TIOCGLTC
......@@ -125,16 +10,4 @@
#define TIOCSETP __TIOCSETP
#define TIOCSETN __TIOCSETN
#define TIOCSETC __TIOCSETC
#endif
/* Used for packet mode */
#define TIOCPKT_DATA 0
#define TIOCPKT_FLUSHREAD 1
#define TIOCPKT_FLUSHWRITE 2
#define TIOCPKT_STOP 4
#define TIOCPKT_START 8
#define TIOCPKT_NOSTOP 16
#define TIOCPKT_DOSTOP 32
#define TIOCPKT_IOCTL 64
#endif /* !(_ASM_SPARC_IOCTLS_H) */
#ifndef __SPARC_MMAN_H__
#define __SPARC_MMAN_H__
#include <asm-generic/mman-common.h>
#include <uapi/asm/mman.h>
/* SunOS'ified... */
#define MAP_RENAME MAP_ANONYMOUS /* In SunOS terminology */
#define MAP_NORESERVE 0x40 /* don't reserve swap pages */
#define MAP_INHERIT 0x80 /* SunOS doesn't do this, but... */
#define MAP_LOCKED 0x100 /* lock the mapping */
#define _MAP_NEW 0x80000000 /* Binary compatibility is fun... */
#define MAP_GROWSDOWN 0x0200 /* stack-like segment */
#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
#define MCL_CURRENT 0x2000 /* lock all currently mapped pages */
#define MCL_FUTURE 0x4000 /* lock all additions to address space */
#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
#define MAP_NONBLOCK 0x10000 /* do not block on IO */
#define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */
#define MAP_HUGETLB 0x40000 /* create a huge page mapping */
#ifdef __KERNEL__
#ifndef __ASSEMBLY__
#define arch_mmap_check(addr,len,flags) sparc_mmap_check(addr,len)
int sparc_mmap_check(unsigned long addr, unsigned long len);
#endif
#endif
#endif /* __SPARC_MMAN_H__ */
......@@ -7,43 +7,11 @@
*
* Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
*/
#ifndef __LINUX_SPARC_PSR_H
#define __LINUX_SPARC_PSR_H
/* The Sparc PSR fields are laid out as the following:
*
* ------------------------------------------------------------------------
* | impl | vers | icc | resv | EC | EF | PIL | S | PS | ET | CWP |
* | 31-28 | 27-24 | 23-20 | 19-14 | 13 | 12 | 11-8 | 7 | 6 | 5 | 4-0 |
* ------------------------------------------------------------------------
*/
#define PSR_CWP 0x0000001f /* current window pointer */
#define PSR_ET 0x00000020 /* enable traps field */
#define PSR_PS 0x00000040 /* previous privilege level */
#define PSR_S 0x00000080 /* current privilege level */
#define PSR_PIL 0x00000f00 /* processor interrupt level */
#define PSR_EF 0x00001000 /* enable floating point */
#define PSR_EC 0x00002000 /* enable co-processor */
#define PSR_SYSCALL 0x00004000 /* inside of a syscall */
#define PSR_LE 0x00008000 /* SuperSparcII little-endian */
#define PSR_ICC 0x00f00000 /* integer condition codes */
#define PSR_C 0x00100000 /* carry bit */
#define PSR_V 0x00200000 /* overflow bit */
#define PSR_Z 0x00400000 /* zero bit */
#define PSR_N 0x00800000 /* negative bit */
#define PSR_VERS 0x0f000000 /* cpu-version field */
#define PSR_IMPL 0xf0000000 /* cpu-implementation field */
#define PSR_VERS_SHIFT 24
#define PSR_IMPL_SHIFT 28
#define PSR_VERS_SHIFTED_MASK 0xf
#define PSR_IMPL_SHIFTED_MASK 0xf
#define PSR_IMPL_TI 0x4
#define PSR_IMPL_LEON 0xf
#include <uapi/asm/psr.h>
#ifdef __KERNEL__
#ifndef __ASSEMBLY__
/* Get the %psr register. */
......@@ -96,6 +64,4 @@ static inline unsigned int get_fsr(void)
#endif /* !(__ASSEMBLY__) */
#endif /* (__KERNEL__) */
#endif /* !(__LINUX_SPARC_PSR_H) */
#ifndef __SPARC_PTRACE_H
#define __SPARC_PTRACE_H
#if defined(__sparc__) && defined(__arch64__)
/* 64 bit sparc */
#include <asm/pstate.h>
/* This struct defines the way the registers are stored on the
* stack during a system call and basically all traps.
*/
/* This magic value must have the low 9 bits clear,
* as that is where we encode the %tt value, see below.
*/
#define PT_REGS_MAGIC 0x57ac6c00
#ifndef __ASSEMBLY__
#include <linux/types.h>
struct pt_regs {
unsigned long u_regs[16]; /* globals and ins */
unsigned long tstate;
unsigned long tpc;
unsigned long tnpc;
unsigned int y;
/* We encode a magic number, PT_REGS_MAGIC, along
* with the %tt (trap type) register value at trap
* entry time. The magic number allows us to identify
* accurately a trap stack frame in the stack
* unwinder, and the %tt value allows us to test
* things like "in a system call" etc. for an arbitray
* process.
*
* The PT_REGS_MAGIC is chosen such that it can be
* loaded completely using just a sethi instruction.
*/
unsigned int magic;
};
struct pt_regs32 {
unsigned int psr;
unsigned int pc;
unsigned int npc;
unsigned int y;
unsigned int u_regs[16]; /* globals and ins */
};
/* A V9 register window */
struct reg_window {
unsigned long locals[8];
unsigned long ins[8];
};
/* A 32-bit register window. */
struct reg_window32 {
unsigned int locals[8];
unsigned int ins[8];
};
/* A V9 Sparc stack frame */
struct sparc_stackf {
unsigned long locals[8];
unsigned long ins[6];
struct sparc_stackf *fp;
unsigned long callers_pc;
char *structptr;
unsigned long xargs[6];
unsigned long xxargs[1];
};
/* A 32-bit Sparc stack frame */
struct sparc_stackf32 {
unsigned int locals[8];
unsigned int ins[6];
unsigned int fp;
unsigned int callers_pc;
unsigned int structptr;
unsigned int xargs[6];
unsigned int xxargs[1];
};
struct sparc_trapf {
unsigned long locals[8];
unsigned long ins[8];
unsigned long _unused;
struct pt_regs *regs;
};
#endif /* (!__ASSEMBLY__) */
#else
/* 32 bit sparc */
#include <asm/psr.h>
/* This struct defines the way the registers are stored on the
* stack during a system call and basically all traps.
*/
#ifndef __ASSEMBLY__
#include <linux/types.h>
struct pt_regs {
unsigned long psr;
unsigned long pc;
unsigned long npc;
unsigned long y;
unsigned long u_regs[16]; /* globals and ins */
};
/* A 32-bit register window. */
struct reg_window32 {
unsigned long locals[8];
unsigned long ins[8];
};
/* A Sparc stack frame */
struct sparc_stackf {
unsigned long locals[8];
unsigned long ins[6];
struct sparc_stackf *fp;
unsigned long callers_pc;
char *structptr;
unsigned long xargs[6];
unsigned long xxargs[1];
};
#endif /* (!__ASSEMBLY__) */
#endif /* (defined(__sparc__) && defined(__arch64__))*/
#ifndef __ASSEMBLY__
#define TRACEREG_SZ sizeof(struct pt_regs)
#define STACKFRAME_SZ sizeof(struct sparc_stackf)
#define TRACEREG32_SZ sizeof(struct pt_regs32)
#define STACKFRAME32_SZ sizeof(struct sparc_stackf32)
#endif /* (!__ASSEMBLY__) */
#define UREG_G0 0
#define UREG_G1 1
#define UREG_G2 2
#define UREG_G3 3
#define UREG_G4 4
#define UREG_G5 5
#define UREG_G6 6
#define UREG_G7 7
#define UREG_I0 8
#define UREG_I1 9
#define UREG_I2 10
#define UREG_I3 11
#define UREG_I4 12
#define UREG_I5 13
#define UREG_I6 14
#define UREG_I7 15
#define UREG_FP UREG_I6
#define UREG_RETPC UREG_I7
#include <uapi/asm/ptrace.h>
#if defined(__sparc__) && defined(__arch64__)
/* 64 bit sparc */
#ifndef __ASSEMBLY__
#ifdef __KERNEL__
#include <linux/threads.h>
#include <asm/switch_to.h>
......@@ -223,24 +65,10 @@ extern unsigned long profile_pc(struct pt_regs *);
#else
#define profile_pc(regs) instruction_pointer(regs)
#endif
#endif /* (__KERNEL__) */
#else /* __ASSEMBLY__ */
/* For assembly code. */
#define TRACEREG_SZ 0xa0
#define STACKFRAME_SZ 0xc0
#define TRACEREG32_SZ 0x50
#define STACKFRAME32_SZ 0x60
#endif /* __ASSEMBLY__ */
#else /* (defined(__sparc__) && defined(__arch64__)) */
/* 32 bit sparc */
#ifndef __ASSEMBLY__
#ifdef __KERNEL__
#include <asm/switch_to.h>
static inline bool pt_regs_is_syscall(struct pt_regs *regs)
......@@ -265,158 +93,10 @@ static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
#define instruction_pointer(regs) ((regs)->pc)
#define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP])
unsigned long profile_pc(struct pt_regs *);
#endif /* (__KERNEL__) */
#else /* (!__ASSEMBLY__) */
/* For assembly code. */
#define TRACEREG_SZ 0x50
#define STACKFRAME_SZ 0x60
#endif /* (!__ASSEMBLY__) */
#endif /* (defined(__sparc__) && defined(__arch64__)) */
#ifdef __KERNEL__
#define STACK_BIAS 2047
#endif
/* These are for pt_regs. */
#define PT_V9_G0 0x00
#define PT_V9_G1 0x08
#define PT_V9_G2 0x10
#define PT_V9_G3 0x18
#define PT_V9_G4 0x20
#define PT_V9_G5 0x28
#define PT_V9_G6 0x30
#define PT_V9_G7 0x38
#define PT_V9_I0 0x40
#define PT_V9_I1 0x48
#define PT_V9_I2 0x50
#define PT_V9_I3 0x58
#define PT_V9_I4 0x60
#define PT_V9_I5 0x68
#define PT_V9_I6 0x70
#define PT_V9_FP PT_V9_I6
#define PT_V9_I7 0x78
#define PT_V9_TSTATE 0x80
#define PT_V9_TPC 0x88
#define PT_V9_TNPC 0x90
#define PT_V9_Y 0x98
#define PT_V9_MAGIC 0x9c
#define PT_TSTATE PT_V9_TSTATE
#define PT_TPC PT_V9_TPC
#define PT_TNPC PT_V9_TNPC
/* These for pt_regs32. */
#define PT_PSR 0x0
#define PT_PC 0x4
#define PT_NPC 0x8
#define PT_Y 0xc
#define PT_G0 0x10
#define PT_WIM PT_G0
#define PT_G1 0x14
#define PT_G2 0x18
#define PT_G3 0x1c
#define PT_G4 0x20
#define PT_G5 0x24
#define PT_G6 0x28
#define PT_G7 0x2c
#define PT_I0 0x30
#define PT_I1 0x34
#define PT_I2 0x38
#define PT_I3 0x3c
#define PT_I4 0x40
#define PT_I5 0x44
#define PT_I6 0x48
#define PT_FP PT_I6
#define PT_I7 0x4c
/* Reg_window offsets */
#define RW_V9_L0 0x00
#define RW_V9_L1 0x08
#define RW_V9_L2 0x10
#define RW_V9_L3 0x18
#define RW_V9_L4 0x20
#define RW_V9_L5 0x28
#define RW_V9_L6 0x30
#define RW_V9_L7 0x38
#define RW_V9_I0 0x40
#define RW_V9_I1 0x48
#define RW_V9_I2 0x50
#define RW_V9_I3 0x58
#define RW_V9_I4 0x60
#define RW_V9_I5 0x68
#define RW_V9_I6 0x70
#define RW_V9_I7 0x78
#define RW_L0 0x00
#define RW_L1 0x04
#define RW_L2 0x08
#define RW_L3 0x0c
#define RW_L4 0x10
#define RW_L5 0x14
#define RW_L6 0x18
#define RW_L7 0x1c
#define RW_I0 0x20
#define RW_I1 0x24
#define RW_I2 0x28
#define RW_I3 0x2c
#define RW_I4 0x30
#define RW_I5 0x34
#define RW_I6 0x38
#define RW_I7 0x3c
/* Stack_frame offsets */
#define SF_V9_L0 0x00
#define SF_V9_L1 0x08
#define SF_V9_L2 0x10
#define SF_V9_L3 0x18
#define SF_V9_L4 0x20
#define SF_V9_L5 0x28
#define SF_V9_L6 0x30
#define SF_V9_L7 0x38
#define SF_V9_I0 0x40
#define SF_V9_I1 0x48
#define SF_V9_I2 0x50
#define SF_V9_I3 0x58
#define SF_V9_I4 0x60
#define SF_V9_I5 0x68
#define SF_V9_FP 0x70
#define SF_V9_PC 0x78
#define SF_V9_RETP 0x80
#define SF_V9_XARG0 0x88
#define SF_V9_XARG1 0x90
#define SF_V9_XARG2 0x98
#define SF_V9_XARG3 0xa0
#define SF_V9_XARG4 0xa8
#define SF_V9_XARG5 0xb0
#define SF_V9_XXARG 0xb8
#define SF_L0 0x00
#define SF_L1 0x04
#define SF_L2 0x08
#define SF_L3 0x0c
#define SF_L4 0x10
#define SF_L5 0x14
#define SF_L6 0x18
#define SF_L7 0x1c
#define SF_I0 0x20
#define SF_I1 0x24
#define SF_I2 0x28
#define SF_I3 0x2c
#define SF_I4 0x30
#define SF_I5 0x34
#define SF_FP 0x38
#define SF_PC 0x3c
#define SF_RETP 0x40
#define SF_XARG0 0x44
#define SF_XARG1 0x48
#define SF_XARG2 0x4c
#define SF_XARG3 0x50
#define SF_XARG4 0x54
#define SF_XARG5 0x58
#define SF_XXARG 0x5c
#ifdef __KERNEL__
/* global_reg_snapshot offsets */
#define GR_SNAP_TSTATE 0x00
......@@ -428,29 +108,4 @@ unsigned long profile_pc(struct pt_regs *);
#define GR_SNAP_THREAD 0x30
#define GR_SNAP_PAD1 0x38
#endif /* __KERNEL__ */
/* Stuff for the ptrace system call */
#define PTRACE_SPARC_DETACH 11
#define PTRACE_GETREGS 12
#define PTRACE_SETREGS 13
#define PTRACE_GETFPREGS 14
#define PTRACE_SETFPREGS 15
#define PTRACE_READDATA 16
#define PTRACE_WRITEDATA 17
#define PTRACE_READTEXT 18
#define PTRACE_WRITETEXT 19
#define PTRACE_GETFPAREGS 20
#define PTRACE_SETFPAREGS 21
/* There are for debugging 64-bit processes, either from a 32 or 64 bit
* parent. Thus their complements are for debugging 32-bit processes only.
*/
#define PTRACE_GETREGS64 22
#define PTRACE_SETREGS64 23
/* PTRACE_SYSCALL is 24 */
#define PTRACE_GETFPREGS64 25
#define PTRACE_SETFPREGS64 26
#endif /* !(__SPARC_PTRACE_H) */
/*
* Just a place holder.
*/
#ifndef _SPARC_SETUP_H
#define _SPARC_SETUP_H
#if defined(__sparc__) && defined(__arch64__)
# define COMMAND_LINE_SIZE 2048
#else
# define COMMAND_LINE_SIZE 256
#endif
#include <uapi/asm/setup.h>
#ifdef __KERNEL__
extern char reboot_command[];
......@@ -34,6 +28,4 @@ extern void sun_do_break(void);
extern int stop_a_enabled;
extern int scons_pwroff;
#endif /* __KERNEL__ */
#endif /* _SPARC_SETUP_H */
#ifndef __SPARC_SIGCONTEXT_H
#define __SPARC_SIGCONTEXT_H
#ifdef __KERNEL__
#include <asm/ptrace.h>
#include <uapi/asm/sigcontext.h>
#ifndef __ASSEMBLY__
......@@ -105,6 +105,4 @@ typedef struct {
#endif /* !(__ASSEMBLY__) */
#endif /* (__KERNEL__) */
#endif /* !(__SPARC_SIGCONTEXT_H) */
#ifndef __SPARC_SIGINFO_H
#define __SPARC_SIGINFO_H
#if defined(__sparc__) && defined(__arch64__)
#include <uapi/asm/siginfo.h>
#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
#define __ARCH_SI_BAND_T int
#endif /* defined(__sparc__) && defined(__arch64__) */
#define __ARCH_SI_TRAPNO
#include <asm-generic/siginfo.h>
#ifdef __KERNEL__
#ifdef CONFIG_COMPAT
......@@ -21,14 +10,4 @@ struct compat_siginfo;
#endif /* CONFIG_COMPAT */
#endif /* __KERNEL__ */
#define SI_NOINFO 32767 /* no information in siginfo_t */
/*
* SIGEMT si_codes
*/
#define EMT_TAGOVF (__SI_FAULT|1) /* tag overflow */
#define NSIGEMT 1
#endif /* !(__SPARC_SIGINFO_H) */
#ifndef __SPARC_SIGNAL_H
#define __SPARC_SIGNAL_H
#include <asm/sigcontext.h>
#include <linux/compiler.h>
#ifdef __KERNEL__
#ifndef __ASSEMBLY__
#include <linux/personality.h>
#include <linux/types.h>
#endif
#endif
/* On the Sparc the signal handlers get passed a 'sub-signal' code
* for certain signal types, which we document here.
*/
#define SIGHUP 1
#define SIGINT 2
#define SIGQUIT 3
#define SIGILL 4
#define SUBSIG_STACK 0
#define SUBSIG_ILLINST 2
#define SUBSIG_PRIVINST 3
#define SUBSIG_BADTRAP(t) (0x80 + (t))
#define SIGTRAP 5
#define SIGABRT 6
#define SIGIOT 6
#define SIGEMT 7
#define SUBSIG_TAG 10
#define SIGFPE 8
#define SUBSIG_FPDISABLED 0x400
#define SUBSIG_FPERROR 0x404
#define SUBSIG_FPINTOVFL 0x001
#define SUBSIG_FPSTSIG 0x002
#define SUBSIG_IDIVZERO 0x014
#define SUBSIG_FPINEXACT 0x0c4
#define SUBSIG_FPDIVZERO 0x0c8
#define SUBSIG_FPUNFLOW 0x0cc
#define SUBSIG_FPOPERROR 0x0d0
#define SUBSIG_FPOVFLOW 0x0d4
#define SIGKILL 9
#define SIGBUS 10
#define SUBSIG_BUSTIMEOUT 1
#define SUBSIG_ALIGNMENT 2
#define SUBSIG_MISCERROR 5
#define SIGSEGV 11
#define SUBSIG_NOMAPPING 3
#define SUBSIG_PROTECTION 4
#define SUBSIG_SEGERROR 5
#define SIGSYS 12
#define SIGPIPE 13
#define SIGALRM 14
#define SIGTERM 15
#define SIGURG 16
/* SunOS values which deviate from the Linux/i386 ones */
#define SIGSTOP 17
#define SIGTSTP 18
#define SIGCONT 19
#define SIGCHLD 20
#define SIGTTIN 21
#define SIGTTOU 22
#define SIGIO 23
#define SIGPOLL SIGIO /* SysV name for SIGIO */
#define SIGXCPU 24
#define SIGXFSZ 25
#define SIGVTALRM 26
#define SIGPROF 27
#define SIGWINCH 28
#define SIGLOST 29
#define SIGPWR SIGLOST
#define SIGUSR1 30
#define SIGUSR2 31
/* Most things should be clean enough to redefine this at will, if care
is taken to make libc match. */
#define __OLD_NSIG 32
#define __NEW_NSIG 64
#ifdef __arch64__
#define _NSIG_BPW 64
#else
#define _NSIG_BPW 32
#endif
#define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
#define SIGRTMIN 32
#define SIGRTMAX __NEW_NSIG
#if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
#define _NSIG __NEW_NSIG
#define __new_sigset_t sigset_t
#define __new_sigaction sigaction
#define __new_sigaction32 sigaction32
#define __old_sigset_t old_sigset_t
#define __old_sigaction old_sigaction
#define __old_sigaction32 old_sigaction32
#else
#define _NSIG __OLD_NSIG
#define NSIG _NSIG
#define __old_sigset_t sigset_t
#define __old_sigaction sigaction
#define __old_sigaction32 sigaction32
#endif
#include <uapi/asm/signal.h>
#ifndef __ASSEMBLY__
typedef unsigned long __old_sigset_t; /* at least 32 bits */
typedef struct {
unsigned long sig[_NSIG_WORDS];
} __new_sigset_t;
/* A SunOS sigstack */
struct sigstack {
/* XXX 32-bit pointers pinhead XXX */
char *the_stack;
int cur_status;
};
/* Sigvec flags */
#define _SV_SSTACK 1u /* This signal handler should use sig-stack */
#define _SV_INTR 2u /* Sig return should not restart system call */
#define _SV_RESET 4u /* Set handler to SIG_DFL upon taken signal */
#define _SV_IGNCHILD 8u /* Do not send SIGCHLD */
/*
* sa_flags values: SA_STACK is not currently supported, but will allow the
* usage of signal stacks by using the (now obsolete) sa_restorer field in
* the sigaction structure as a stack pointer. This is now possible due to
* the changes in signal handling. LBT 010493.
* SA_RESTART flag to get restarting signals (which were the default long ago)
*/
#define SA_NOCLDSTOP _SV_IGNCHILD
#define SA_STACK _SV_SSTACK
#define SA_ONSTACK _SV_SSTACK
#define SA_RESTART _SV_INTR
#define SA_ONESHOT _SV_RESET
#define SA_NODEFER 0x20u
#define SA_NOCLDWAIT 0x100u
#define SA_SIGINFO 0x200u
#define SA_NOMASK SA_NODEFER
#define SIG_BLOCK 0x01 /* for blocking signals */
#define SIG_UNBLOCK 0x02 /* for unblocking signals */
#define SIG_SETMASK 0x04 /* for setting the signal mask */
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 4096
#define SIGSTKSZ 16384
#ifdef __KERNEL__
/*
* DJHR
* SA_STATIC_ALLOC is used for the sparc32 system to indicate that this
......@@ -175,31 +20,6 @@ struct sigstack {
*
*/
#define SA_STATIC_ALLOC 0x8000
#endif
#include <asm-generic/signal-defs.h>
struct __new_sigaction {
__sighandler_t sa_handler;
unsigned long sa_flags;
__sigrestore_t sa_restorer; /* not used by Linux/SPARC yet */
__new_sigset_t sa_mask;
};
struct __old_sigaction {
__sighandler_t sa_handler;
__old_sigset_t sa_mask;
unsigned long sa_flags;
void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
};
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
size_t ss_size;
} stack_t;
#ifdef __KERNEL__
struct k_sigaction {
struct __new_sigaction sa;
......@@ -208,8 +28,5 @@ struct k_sigaction {
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#endif /* !(__KERNEL__) */
#endif /* !(__ASSEMBLY__) */
#endif /* !(__SPARC_SIGNAL_H) */
#ifndef _SPARC_TERMBITS_H
#define _SPARC_TERMBITS_H
#include <linux/posix_types.h>
#include <uapi/asm/termbits.h>
typedef unsigned char cc_t;
typedef unsigned int speed_t;
#if defined(__sparc__) && defined(__arch64__)
typedef unsigned int tcflag_t;
#else
typedef unsigned long tcflag_t;
#endif
#define NCC 8
struct termio {
unsigned short c_iflag; /* input mode flags */
unsigned short c_oflag; /* output mode flags */
unsigned short c_cflag; /* control mode flags */
unsigned short c_lflag; /* local mode flags */
unsigned char c_line; /* line discipline */
unsigned char c_cc[NCC]; /* control characters */
};
#define NCCS 17
struct termios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
tcflag_t c_cflag; /* control mode flags */
tcflag_t c_lflag; /* local mode flags */
cc_t c_line; /* line discipline */
#ifndef __KERNEL__
cc_t c_cc[NCCS]; /* control characters */
#else
cc_t c_cc[NCCS+2]; /* kernel needs 2 more to hold vmin/vtime */
#define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t))
#endif
};
struct termios2 {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
tcflag_t c_cflag; /* control mode flags */
tcflag_t c_lflag; /* local mode flags */
cc_t c_line; /* line discipline */
cc_t c_cc[NCCS+2]; /* control characters */
speed_t c_ispeed; /* input speed */
speed_t c_ospeed; /* output speed */
};
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
tcflag_t c_cflag; /* control mode flags */
tcflag_t c_lflag; /* local mode flags */
cc_t c_line; /* line discipline */
cc_t c_cc[NCCS+2]; /* control characters */
speed_t c_ispeed; /* input speed */
speed_t c_ospeed; /* output speed */
};
/* c_cc characters */
#define VINTR 0
#define VQUIT 1
#define VERASE 2
#define VKILL 3
#define VEOF 4
#define VEOL 5
#define VEOL2 6
#define VSWTC 7
#define VSTART 8
#define VSTOP 9
#define VSUSP 10
#define VDSUSP 11 /* SunOS POSIX nicety I do believe... */
#define VREPRINT 12
#define VDISCARD 13
#define VWERASE 14
#define VLNEXT 15
/* Kernel keeps vmin/vtime separated, user apps assume vmin/vtime is
* shared with eof/eol
*/
#ifdef __KERNEL__
#define VMIN 16
#define VTIME 17
#else
#define VMIN VEOF
#define VTIME VEOL
#endif
/* c_iflag bits */
#define IGNBRK 0x00000001
#define BRKINT 0x00000002
#define IGNPAR 0x00000004
#define PARMRK 0x00000008
#define INPCK 0x00000010
#define ISTRIP 0x00000020
#define INLCR 0x00000040
#define IGNCR 0x00000080
#define ICRNL 0x00000100
#define IUCLC 0x00000200
#define IXON 0x00000400
#define IXANY 0x00000800
#define IXOFF 0x00001000
#define IMAXBEL 0x00002000
#define IUTF8 0x00004000
/* c_oflag bits */
#define OPOST 0x00000001
#define OLCUC 0x00000002
#define ONLCR 0x00000004
#define OCRNL 0x00000008
#define ONOCR 0x00000010
#define ONLRET 0x00000020
#define OFILL 0x00000040
#define OFDEL 0x00000080
#define NLDLY 0x00000100
#define NL0 0x00000000
#define NL1 0x00000100
#define CRDLY 0x00000600
#define CR0 0x00000000
#define CR1 0x00000200
#define CR2 0x00000400
#define CR3 0x00000600
#define TABDLY 0x00001800
#define TAB0 0x00000000
#define TAB1 0x00000800
#define TAB2 0x00001000
#define TAB3 0x00001800
#define XTABS 0x00001800
#define BSDLY 0x00002000
#define BS0 0x00000000
#define BS1 0x00002000
#define VTDLY 0x00004000
#define VT0 0x00000000
#define VT1 0x00004000
#define FFDLY 0x00008000
#define FF0 0x00000000
#define FF1 0x00008000
#define PAGEOUT 0x00010000 /* SUNOS specific */
#define WRAP 0x00020000 /* SUNOS specific */
/* c_cflag bit meaning */
#define CBAUD 0x0000100f
#define B0 0x00000000 /* hang up */
#define B50 0x00000001
#define B75 0x00000002
#define B110 0x00000003
#define B134 0x00000004
#define B150 0x00000005
#define B200 0x00000006
#define B300 0x00000007
#define B600 0x00000008
#define B1200 0x00000009
#define B1800 0x0000000a
#define B2400 0x0000000b
#define B4800 0x0000000c
#define B9600 0x0000000d
#define B19200 0x0000000e
#define B38400 0x0000000f
#define EXTA B19200
#define EXTB B38400
#define CSIZE 0x00000030
#define CS5 0x00000000
#define CS6 0x00000010
#define CS7 0x00000020
#define CS8 0x00000030
#define CSTOPB 0x00000040
#define CREAD 0x00000080
#define PARENB 0x00000100
#define PARODD 0x00000200
#define HUPCL 0x00000400
#define CLOCAL 0x00000800
#define CBAUDEX 0x00001000
/* We'll never see these speeds with the Zilogs, but for completeness... */
#define BOTHER 0x00001000
#define B57600 0x00001001
#define B115200 0x00001002
#define B230400 0x00001003
#define B460800 0x00001004
/* This is what we can do with the Zilogs. */
#define B76800 0x00001005
/* This is what we can do with the SAB82532. */
#define B153600 0x00001006
#define B307200 0x00001007
#define B614400 0x00001008
#define B921600 0x00001009
/* And these are the rest... */
#define B500000 0x0000100a
#define B576000 0x0000100b
#define B1000000 0x0000100c
#define B1152000 0x0000100d
#define B1500000 0x0000100e
#define B2000000 0x0000100f
/* These have totally bogus values and nobody uses them
so far. Later on we'd have to use say 0x10000x and
adjust CBAUD constant and drivers accordingly.
#define B2500000 0x00001010
#define B3000000 0x00001011
#define B3500000 0x00001012
#define B4000000 0x00001013 */
#define CIBAUD 0x100f0000 /* input baud rate (not used) */
#define CMSPAR 0x40000000 /* mark or space (stick) parity */
#define CRTSCTS 0x80000000 /* flow control */
#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
/* c_lflag bits */
#define ISIG 0x00000001
#define ICANON 0x00000002
#define XCASE 0x00000004
#define ECHO 0x00000008
#define ECHOE 0x00000010
#define ECHOK 0x00000020
#define ECHONL 0x00000040
#define NOFLSH 0x00000080
#define TOSTOP 0x00000100
#define ECHOCTL 0x00000200
#define ECHOPRT 0x00000400
#define ECHOKE 0x00000800
#define DEFECHO 0x00001000 /* SUNOS thing, what is it? */
#define FLUSHO 0x00002000
#define PENDIN 0x00004000
#define IEXTEN 0x00008000
#define EXTPROC 0x00010000
/* modem lines */
#define TIOCM_LE 0x001
#define TIOCM_DTR 0x002
#define TIOCM_RTS 0x004
#define TIOCM_ST 0x008
#define TIOCM_SR 0x010
#define TIOCM_CTS 0x020
#define TIOCM_CAR 0x040
#define TIOCM_RNG 0x080
#define TIOCM_DSR 0x100
#define TIOCM_CD TIOCM_CAR
#define TIOCM_RI TIOCM_RNG
#define TIOCM_OUT1 0x2000
#define TIOCM_OUT2 0x4000
#define TIOCM_LOOP 0x8000
/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
/* tcflow() and TCXONC use these */
#define TCOOFF 0
#define TCOON 1
#define TCIOFF 2
#define TCION 3
/* tcflush() and TCFLSH use these */
#define TCIFLUSH 0
#define TCOFLUSH 1
#define TCIOFLUSH 2
/* tcsetattr uses these */
#define TCSANOW 0
#define TCSADRAIN 1
#define TCSAFLUSH 2
#endif /* !(_SPARC_TERMBITS_H) */
#ifndef _SPARC_TERMIOS_H
#define _SPARC_TERMIOS_H
#include <asm/ioctls.h>
#include <asm/termbits.h>
#include <uapi/asm/termios.h>
#if defined(__KERNEL__) || defined(__DEFINE_BSD_TERMIOS)
struct sgttyb {
char sg_ispeed;
char sg_ospeed;
char sg_erase;
char sg_kill;
short sg_flags;
};
struct tchars {
char t_intrc;
char t_quitc;
char t_startc;
char t_stopc;
char t_eofc;
char t_brkc;
};
struct ltchars {
char t_suspc;
char t_dsuspc;
char t_rprntc;
char t_flushc;
char t_werasc;
char t_lnextc;
};
#endif /* __KERNEL__ */
struct winsize {
unsigned short ws_row;
unsigned short ws_col;
unsigned short ws_xpixel;
unsigned short ws_ypixel;
};
#ifdef __KERNEL__
/*
* c_cc characters in the termio structure. Oh, how I love being
......@@ -180,6 +143,4 @@ struct winsize {
err; \
})
#endif /* __KERNEL__ */
#endif /* _SPARC_TERMIOS_H */
......@@ -3,14 +3,12 @@
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
*/
#ifndef _SPARC_TRAPS_H
#define _SPARC_TRAPS_H
#define NUM_SPARC_TRAPS 255
#include <uapi/asm/traps.h>
#ifndef __ASSEMBLY__
#ifdef __KERNEL__
/* This is for V8 compliant Sparc CPUS */
struct tt_entry {
unsigned long inst_one;
......@@ -22,112 +20,5 @@ struct tt_entry {
/* We set this to _start in system setup. */
extern struct tt_entry *sparc_ttable;
#endif /* (__KERNEL__) */
#endif /* !(__ASSEMBLY__) */
/* For patching the trap table at boot time, we need to know how to
* form various common Sparc instructions. Thus these macros...
*/
#define SPARC_MOV_CONST_L3(const) (0xa6102000 | (const&0xfff))
/* The following assumes that the branch lies before the place we
* are branching to. This is the case for a trap vector...
* You have been warned.
*/
#define SPARC_BRANCH(dest_addr, inst_addr) \
(0x10800000 | (((dest_addr-inst_addr)>>2)&0x3fffff))
#define SPARC_RD_PSR_L0 (0xa1480000)
#define SPARC_RD_WIM_L3 (0xa7500000)
#define SPARC_NOP (0x01000000)
/* Various interesting trap levels. */
/* First, hardware traps. */
#define SP_TRAP_TFLT 0x1 /* Text fault */
#define SP_TRAP_II 0x2 /* Illegal Instruction */
#define SP_TRAP_PI 0x3 /* Privileged Instruction */
#define SP_TRAP_FPD 0x4 /* Floating Point Disabled */
#define SP_TRAP_WOVF 0x5 /* Window Overflow */
#define SP_TRAP_WUNF 0x6 /* Window Underflow */
#define SP_TRAP_MNA 0x7 /* Memory Address Unaligned */
#define SP_TRAP_FPE 0x8 /* Floating Point Exception */
#define SP_TRAP_DFLT 0x9 /* Data Fault */
#define SP_TRAP_TOF 0xa /* Tag Overflow */
#define SP_TRAP_WDOG 0xb /* Watchpoint Detected */
#define SP_TRAP_IRQ1 0x11 /* IRQ level 1 */
#define SP_TRAP_IRQ2 0x12 /* IRQ level 2 */
#define SP_TRAP_IRQ3 0x13 /* IRQ level 3 */
#define SP_TRAP_IRQ4 0x14 /* IRQ level 4 */
#define SP_TRAP_IRQ5 0x15 /* IRQ level 5 */
#define SP_TRAP_IRQ6 0x16 /* IRQ level 6 */
#define SP_TRAP_IRQ7 0x17 /* IRQ level 7 */
#define SP_TRAP_IRQ8 0x18 /* IRQ level 8 */
#define SP_TRAP_IRQ9 0x19 /* IRQ level 9 */
#define SP_TRAP_IRQ10 0x1a /* IRQ level 10 */
#define SP_TRAP_IRQ11 0x1b /* IRQ level 11 */
#define SP_TRAP_IRQ12 0x1c /* IRQ level 12 */
#define SP_TRAP_IRQ13 0x1d /* IRQ level 13 */
#define SP_TRAP_IRQ14 0x1e /* IRQ level 14 */
#define SP_TRAP_IRQ15 0x1f /* IRQ level 15 Non-maskable */
#define SP_TRAP_RACC 0x20 /* Register Access Error ??? */
#define SP_TRAP_IACC 0x21 /* Instruction Access Error */
#define SP_TRAP_CPDIS 0x24 /* Co-Processor Disabled */
#define SP_TRAP_BADFL 0x25 /* Unimplemented Flush Instruction */
#define SP_TRAP_CPEXP 0x28 /* Co-Processor Exception */
#define SP_TRAP_DACC 0x29 /* Data Access Error */
#define SP_TRAP_DIVZ 0x2a /* Divide By Zero */
#define SP_TRAP_DSTORE 0x2b /* Data Store Error ??? */
#define SP_TRAP_DMM 0x2c /* Data Access MMU Miss ??? */
#define SP_TRAP_IMM 0x3c /* Instruction Access MMU Miss ??? */
/* Now the Software Traps... */
#define SP_TRAP_SUNOS 0x80 /* SunOS System Call */
#define SP_TRAP_SBPT 0x81 /* Software Breakpoint */
#define SP_TRAP_SDIVZ 0x82 /* Software Divide-by-Zero trap */
#define SP_TRAP_FWIN 0x83 /* Flush Windows */
#define SP_TRAP_CWIN 0x84 /* Clean Windows */
#define SP_TRAP_RCHK 0x85 /* Range Check */
#define SP_TRAP_FUNA 0x86 /* Fix Unaligned Access */
#define SP_TRAP_IOWFL 0x87 /* Integer Overflow */
#define SP_TRAP_SOLARIS 0x88 /* Solaris System Call */
#define SP_TRAP_NETBSD 0x89 /* NetBSD System Call */
#define SP_TRAP_LINUX 0x90 /* Linux System Call */
/* Names used for compatibility with SunOS */
#define ST_SYSCALL 0x00
#define ST_BREAKPOINT 0x01
#define ST_DIV0 0x02
#define ST_FLUSH_WINDOWS 0x03
#define ST_CLEAN_WINDOWS 0x04
#define ST_RANGE_CHECK 0x05
#define ST_FIX_ALIGN 0x06
#define ST_INT_OVERFLOW 0x07
/* Special traps... */
#define SP_TRAP_KBPT1 0xfe /* KADB/PROM Breakpoint one */
#define SP_TRAP_KBPT2 0xff /* KADB/PROM Breakpoint two */
/* Handy Macros */
/* Is this a trap we never expect to get? */
#define BAD_TRAP_P(level) \
((level > SP_TRAP_WDOG && level < SP_TRAP_IRQ1) || \
(level > SP_TRAP_IACC && level < SP_TRAP_CPDIS) || \
(level > SP_TRAP_BADFL && level < SP_TRAP_CPEXP) || \
(level > SP_TRAP_DMM && level < SP_TRAP_IMM) || \
(level > SP_TRAP_IMM && level < SP_TRAP_SUNOS) || \
(level > SP_TRAP_LINUX && level < SP_TRAP_KBPT1))
/* Is this a Hardware trap? */
#define HW_TRAP_P(level) ((level > 0) && (level < SP_TRAP_SUNOS))
/* Is this a Software trap? */
#define SW_TRAP_P(level) ((level >= SP_TRAP_SUNOS) && (level <= SP_TRAP_KBPT2))
/* Is this a system call for some OS we know about? */
#define SCALL_TRAP_P(level) ((level == SP_TRAP_SUNOS) || \
(level == SP_TRAP_SOLARIS) || \
(level == SP_TRAP_NETBSD) || \
(level == SP_TRAP_LINUX))
#endif /* !(_SPARC_TRAPS_H) */
This diff is collapsed.
......@@ -3,3 +3,49 @@
include include/uapi/asm-generic/Kbuild.asm
header-y += apc.h
header-y += asi.h
header-y += auxvec.h
header-y += bitsperlong.h
header-y += byteorder.h
header-y += display7seg.h
header-y += envctrl.h
header-y += errno.h
header-y += fbio.h
header-y += fcntl.h
header-y += ioctl.h
header-y += ioctls.h
header-y += ipcbuf.h
header-y += jsflash.h
header-y += kvm_para.h
header-y += mman.h
header-y += msgbuf.h
header-y += openpromio.h
header-y += param.h
header-y += perfctr.h
header-y += poll.h
header-y += posix_types.h
header-y += psr.h
header-y += psrcompat.h
header-y += pstate.h
header-y += ptrace.h
header-y += resource.h
header-y += sembuf.h
header-y += setup.h
header-y += shmbuf.h
header-y += sigcontext.h
header-y += siginfo.h
header-y += signal.h
header-y += socket.h
header-y += sockios.h
header-y += stat.h
header-y += statfs.h
header-y += swab.h
header-y += termbits.h
header-y += termios.h
header-y += traps.h
header-y += types.h
header-y += uctx.h
header-y += unistd.h
header-y += utrap.h
header-y += watchdog.h
#ifndef _UAPI__LINUX_FBIO_H
#define _UAPI__LINUX_FBIO_H
#include <linux/compiler.h>
#include <linux/types.h>
/* Constants used for fbio SunOS compatibility */
/* (C) 1996 Miguel de Icaza */
/* Frame buffer types */
#define FBTYPE_NOTYPE -1
#define FBTYPE_SUN1BW 0 /* mono */
#define FBTYPE_SUN1COLOR 1
#define FBTYPE_SUN2BW 2
#define FBTYPE_SUN2COLOR 3
#define FBTYPE_SUN2GP 4
#define FBTYPE_SUN5COLOR 5
#define FBTYPE_SUN3COLOR 6
#define FBTYPE_MEMCOLOR 7
#define FBTYPE_SUN4COLOR 8
#define FBTYPE_NOTSUN1 9
#define FBTYPE_NOTSUN2 10
#define FBTYPE_NOTSUN3 11
#define FBTYPE_SUNFAST_COLOR 12 /* cg6 */
#define FBTYPE_SUNROP_COLOR 13
#define FBTYPE_SUNFB_VIDEO 14
#define FBTYPE_SUNGIFB 15
#define FBTYPE_SUNGPLAS 16
#define FBTYPE_SUNGP3 17
#define FBTYPE_SUNGT 18
#define FBTYPE_SUNLEO 19 /* zx Leo card */
#define FBTYPE_MDICOLOR 20 /* cg14 */
#define FBTYPE_TCXCOLOR 21 /* SUNW,tcx card */
#define FBTYPE_LASTPLUSONE 21 /* This is not last + 1 in fact... */
/* Does not seem to be listed in the Sun file either */
#define FBTYPE_CREATOR 22
#define FBTYPE_PCI_IGA1682 23
#define FBTYPE_P9100COLOR 24
#define FBTYPE_PCI_GENERIC 1000
#define FBTYPE_PCI_MACH64 1001
/* fbio ioctls */
/* Returned by FBIOGTYPE */
struct fbtype {
int fb_type; /* fb type, see above */
int fb_height; /* pixels */
int fb_width; /* pixels */
int fb_depth;
int fb_cmsize; /* color map entries */
int fb_size; /* fb size in bytes */
};
#define FBIOGTYPE _IOR('F', 0, struct fbtype)
struct fbcmap {
int index; /* first element (0 origin) */
int count;
unsigned char __user *red;
unsigned char __user *green;
unsigned char __user *blue;
};
#ifndef __KERNEL__
#define FBIOPUTCMAP _IOW('F', 3, struct fbcmap)
#define FBIOGETCMAP _IOW('F', 4, struct fbcmap)
#endif
/* # of device specific values */
#define FB_ATTR_NDEVSPECIFIC 8
/* # of possible emulations */
#define FB_ATTR_NEMUTYPES 4
struct fbsattr {
int flags;
int emu_type; /* -1 if none */
int dev_specific[FB_ATTR_NDEVSPECIFIC];
};
struct fbgattr {
int real_type; /* real frame buffer type */
int owner; /* unknown */
struct fbtype fbtype; /* real frame buffer fbtype */
struct fbsattr sattr;
int emu_types[FB_ATTR_NEMUTYPES]; /* supported emulations */
};
#define FBIOSATTR _IOW('F', 5, struct fbgattr) /* Unsupported: */
#define FBIOGATTR _IOR('F', 6, struct fbgattr) /* supported */
#define FBIOSVIDEO _IOW('F', 7, int)
#define FBIOGVIDEO _IOR('F', 8, int)
struct fbcursor {
short set; /* what to set, choose from the list above */
short enable; /* cursor on/off */
struct fbcurpos pos; /* cursor position */
struct fbcurpos hot; /* cursor hot spot */
struct fbcmap cmap; /* color map info */
struct fbcurpos size; /* cursor bit map size */
char __user *image; /* cursor image bits */
char __user *mask; /* cursor mask bits */
};
/* set/get cursor attributes/shape */
#define FBIOSCURSOR _IOW('F', 24, struct fbcursor)
#define FBIOGCURSOR _IOWR('F', 25, struct fbcursor)
/* set/get cursor position */
#define FBIOSCURPOS _IOW('F', 26, struct fbcurpos)
#define FBIOGCURPOS _IOW('F', 27, struct fbcurpos)
/* get max cursor size */
#define FBIOGCURMAX _IOR('F', 28, struct fbcurpos)
/* wid manipulation */
struct fb_wid_alloc {
#define FB_WID_SHARED_8 0
#define FB_WID_SHARED_24 1
#define FB_WID_DBL_8 2
#define FB_WID_DBL_24 3
__u32 wa_type;
__s32 wa_index; /* Set on return */
__u32 wa_count;
};
struct fb_wid_item {
__u32 wi_type;
__s32 wi_index;
__u32 wi_attrs;
__u32 wi_values[32];
};
struct fb_wid_list {
__u32 wl_flags;
__u32 wl_count;
struct fb_wid_item *wl_list;
};
#define FBIO_WID_ALLOC _IOWR('F', 30, struct fb_wid_alloc)
#define FBIO_WID_FREE _IOW('F', 31, struct fb_wid_alloc)
#define FBIO_WID_PUT _IOW('F', 32, struct fb_wid_list)
#define FBIO_WID_GET _IOWR('F', 33, struct fb_wid_list)
/* Creator ioctls */
#define FFB_IOCTL ('F'<<8)
#define FFB_SYS_INFO (FFB_IOCTL|80)
#define FFB_CLUTREAD (FFB_IOCTL|81)
#define FFB_CLUTPOST (FFB_IOCTL|82)
#define FFB_SETDIAGMODE (FFB_IOCTL|83)
#define FFB_GETMONITORID (FFB_IOCTL|84)
#define FFB_GETVIDEOMODE (FFB_IOCTL|85)
#define FFB_SETVIDEOMODE (FFB_IOCTL|86)
#define FFB_SETSERVER (FFB_IOCTL|87)
#define FFB_SETOVCTL (FFB_IOCTL|88)
#define FFB_GETOVCTL (FFB_IOCTL|89)
#define FFB_GETSAXNUM (FFB_IOCTL|90)
#define FFB_FBDEBUG (FFB_IOCTL|91)
/* Cg14 ioctls */
#define MDI_IOCTL ('M'<<8)
#define MDI_RESET (MDI_IOCTL|1)
#define MDI_GET_CFGINFO (MDI_IOCTL|2)
#define MDI_SET_PIXELMODE (MDI_IOCTL|3)
# define MDI_32_PIX 32
# define MDI_16_PIX 16
# define MDI_8_PIX 8
struct mdi_cfginfo {
int mdi_ncluts; /* Number of implemented CLUTs in this MDI */
int mdi_type; /* FBTYPE name */
int mdi_height; /* height */
int mdi_width; /* width */
int mdi_size; /* available ram */
int mdi_mode; /* 8bpp, 16bpp or 32bpp */
int mdi_pixfreq; /* pixel clock (from PROM) */
};
/* SparcLinux specific ioctl for the MDI, should be replaced for
* the SET_XLUT/SET_CLUTn ioctls instead
*/
#define MDI_CLEAR_XLUT (MDI_IOCTL|9)
/* leo & ffb ioctls */
struct fb_clut_alloc {
__u32 clutid; /* Set on return */
__u32 flag;
__u32 index;
};
struct fb_clut {
#define FB_CLUT_WAIT 0x00000001 /* Not yet implemented */
__u32 flag;
__u32 clutid;
__u32 offset;
__u32 count;
char * red;
char * green;
char * blue;
};
struct fb_clut32 {
__u32 flag;
__u32 clutid;
__u32 offset;
__u32 count;
__u32 red;
__u32 green;
__u32 blue;
};
#define LEO_CLUTALLOC _IOWR('L', 53, struct fb_clut_alloc)
#define LEO_CLUTFREE _IOW('L', 54, struct fb_clut_alloc)
#define LEO_CLUTREAD _IOW('L', 55, struct fb_clut)
#define LEO_CLUTPOST _IOW('L', 56, struct fb_clut)
#define LEO_SETGAMMA _IOW('L', 68, int) /* Not yet implemented */
#define LEO_GETGAMMA _IOR('L', 69, int) /* Not yet implemented */
/* These are exported to userland for applications to use */
/* Mappable offsets for the cg14: control registers */
#define MDI_DIRECT_MAP 0x10000000
#define MDI_CTLREG_MAP 0x20000000
#define MDI_CURSOR_MAP 0x30000000
#define MDI_SHDW_VRT_MAP 0x40000000
/* Mappable offsets for the cg14: frame buffer resolutions */
/* 32 bits */
#define MDI_CHUNKY_XBGR_MAP 0x50000000
#define MDI_CHUNKY_BGR_MAP 0x60000000
/* 16 bits */
#define MDI_PLANAR_X16_MAP 0x70000000
#define MDI_PLANAR_C16_MAP 0x80000000
/* 8 bit is done as CG3 MMAP offset */
/* 32 bits, planar */
#define MDI_PLANAR_X32_MAP 0x90000000
#define MDI_PLANAR_B32_MAP 0xa0000000
#define MDI_PLANAR_G32_MAP 0xb0000000
#define MDI_PLANAR_R32_MAP 0xc0000000
/* Mappable offsets on leo */
#define LEO_SS0_MAP 0x00000000
#define LEO_LC_SS0_USR_MAP 0x00800000
#define LEO_LD_SS0_MAP 0x00801000
#define LEO_LX_CURSOR_MAP 0x00802000
#define LEO_SS1_MAP 0x00803000
#define LEO_LC_SS1_USR_MAP 0x01003000
#define LEO_LD_SS1_MAP 0x01004000
#define LEO_UNK_MAP 0x01005000
#define LEO_LX_KRN_MAP 0x01006000
#define LEO_LC_SS0_KRN_MAP 0x01007000
#define LEO_LC_SS1_KRN_MAP 0x01008000
#define LEO_LD_GBL_MAP 0x01009000
#define LEO_UNK2_MAP 0x0100a000
#endif /* _UAPI__LINUX_FBIO_H */
#ifndef _UAPI_ASM_SPARC_IOCTLS_H
#define _UAPI_ASM_SPARC_IOCTLS_H
#include <asm/ioctl.h>
/* Big T */
#define TCGETA _IOR('T', 1, struct termio)
#define TCSETA _IOW('T', 2, struct termio)
#define TCSETAW _IOW('T', 3, struct termio)
#define TCSETAF _IOW('T', 4, struct termio)
#define TCSBRK _IO('T', 5)
#define TCXONC _IO('T', 6)
#define TCFLSH _IO('T', 7)
#define TCGETS _IOR('T', 8, struct termios)
#define TCSETS _IOW('T', 9, struct termios)
#define TCSETSW _IOW('T', 10, struct termios)
#define TCSETSF _IOW('T', 11, struct termios)
#define TCGETS2 _IOR('T', 12, struct termios2)
#define TCSETS2 _IOW('T', 13, struct termios2)
#define TCSETSW2 _IOW('T', 14, struct termios2)
#define TCSETSF2 _IOW('T', 15, struct termios2)
#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
#define TIOCVHANGUP _IO('T', 0x37)
/* Note that all the ioctls that are not available in Linux have a
* double underscore on the front to: a) avoid some programs to
* think we support some ioctls under Linux (autoconfiguration stuff)
*/
/* Little t */
#define TIOCGETD _IOR('t', 0, int)
#define TIOCSETD _IOW('t', 1, int)
#define __TIOCHPCL _IO('t', 2) /* SunOS Specific */
#define __TIOCMODG _IOR('t', 3, int) /* SunOS Specific */
#define __TIOCMODS _IOW('t', 4, int) /* SunOS Specific */
#define __TIOCGETP _IOR('t', 8, struct sgttyb) /* SunOS Specific */
#define __TIOCSETP _IOW('t', 9, struct sgttyb) /* SunOS Specific */
#define __TIOCSETN _IOW('t', 10, struct sgttyb) /* SunOS Specific */
#define TIOCEXCL _IO('t', 13)
#define TIOCNXCL _IO('t', 14)
#define __TIOCFLUSH _IOW('t', 16, int) /* SunOS Specific */
#define __TIOCSETC _IOW('t', 17, struct tchars) /* SunOS Specific */
#define __TIOCGETC _IOR('t', 18, struct tchars) /* SunOS Specific */
#define __TIOCTCNTL _IOW('t', 32, int) /* SunOS Specific */
#define __TIOCSIGNAL _IOW('t', 33, int) /* SunOS Specific */
#define __TIOCSETX _IOW('t', 34, int) /* SunOS Specific */
#define __TIOCGETX _IOR('t', 35, int) /* SunOS Specific */
#define TIOCCONS _IO('t', 36)
#define TIOCGSOFTCAR _IOR('t', 100, int)
#define TIOCSSOFTCAR _IOW('t', 101, int)
#define __TIOCUCNTL _IOW('t', 102, int) /* SunOS Specific */
#define TIOCSWINSZ _IOW('t', 103, struct winsize)
#define TIOCGWINSZ _IOR('t', 104, struct winsize)
#define __TIOCREMOTE _IOW('t', 105, int) /* SunOS Specific */
#define TIOCMGET _IOR('t', 106, int)
#define TIOCMBIC _IOW('t', 107, int)
#define TIOCMBIS _IOW('t', 108, int)
#define TIOCMSET _IOW('t', 109, int)
#define TIOCSTART _IO('t', 110)
#define TIOCSTOP _IO('t', 111)
#define TIOCPKT _IOW('t', 112, int)
#define TIOCNOTTY _IO('t', 113)
#define TIOCSTI _IOW('t', 114, char)
#define TIOCOUTQ _IOR('t', 115, int)
#define __TIOCGLTC _IOR('t', 116, struct ltchars) /* SunOS Specific */
#define __TIOCSLTC _IOW('t', 117, struct ltchars) /* SunOS Specific */
/* 118 is the non-posix setpgrp tty ioctl */
/* 119 is the non-posix getpgrp tty ioctl */
#define __TIOCCDTR _IO('t', 120) /* SunOS Specific */
#define __TIOCSDTR _IO('t', 121) /* SunOS Specific */
#define TIOCCBRK _IO('t', 122)
#define TIOCSBRK _IO('t', 123)
#define __TIOCLGET _IOW('t', 124, int) /* SunOS Specific */
#define __TIOCLSET _IOW('t', 125, int) /* SunOS Specific */
#define __TIOCLBIC _IOW('t', 126, int) /* SunOS Specific */
#define __TIOCLBIS _IOW('t', 127, int) /* SunOS Specific */
#define __TIOCISPACE _IOR('t', 128, int) /* SunOS Specific */
#define __TIOCISIZE _IOR('t', 129, int) /* SunOS Specific */
#define TIOCSPGRP _IOW('t', 130, int)
#define TIOCGPGRP _IOR('t', 131, int)
#define TIOCSCTTY _IO('t', 132)
#define TIOCGSID _IOR('t', 133, int)
/* Get minor device of a pty master's FD -- Solaris equiv is ISPTM */
#define TIOCGPTN _IOR('t', 134, unsigned int) /* Get Pty Number */
#define TIOCSPTLCK _IOW('t', 135, int) /* Lock/unlock PTY */
#define TIOCSIG _IOW('t', 136, int) /* Generate signal on Pty slave */
/* Little f */
#define FIOCLEX _IO('f', 1)
#define FIONCLEX _IO('f', 2)
#define FIOASYNC _IOW('f', 125, int)
#define FIONBIO _IOW('f', 126, int)
#define FIONREAD _IOR('f', 127, int)
#define TIOCINQ FIONREAD
#define FIOQSIZE _IOR('f', 128, loff_t)
/* SCARY Rutgers local SunOS kernel hackery, perhaps I will support it
* someday. This is completely bogus, I know...
*/
#define __TCGETSTAT _IO('T', 200) /* Rutgers specific */
#define __TCSETSTAT _IO('T', 201) /* Rutgers specific */
/* Linux specific, no SunOS equivalent. */
#define TIOCLINUX 0x541C
#define TIOCGSERIAL 0x541E
#define TIOCSSERIAL 0x541F
#define TCSBRKP 0x5425
#define TIOCSERCONFIG 0x5453
#define TIOCSERGWILD 0x5454
#define TIOCSERSWILD 0x5455
#define TIOCGLCKTRMIOS 0x5456
#define TIOCSLCKTRMIOS 0x5457
#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
#define TIOCSERGETLSR 0x5459 /* Get line status register */
#define TIOCSERGETMULTI 0x545A /* Get multiport config */
#define TIOCSERSETMULTI 0x545B /* Set multiport config */
#define TIOCMIWAIT 0x545C /* Wait for change on serial input line(s) */
#define TIOCGICOUNT 0x545D /* Read serial port inline interrupt counts */
/* Kernel definitions */
/* Used for packet mode */
#define TIOCPKT_DATA 0
#define TIOCPKT_FLUSHREAD 1
#define TIOCPKT_FLUSHWRITE 2
#define TIOCPKT_STOP 4
#define TIOCPKT_START 8
#define TIOCPKT_NOSTOP 16
#define TIOCPKT_DOSTOP 32
#define TIOCPKT_IOCTL 64
#endif /* _UAPI_ASM_SPARC_IOCTLS_H */
#ifndef _UAPI__SPARC_MMAN_H__
#define _UAPI__SPARC_MMAN_H__
#include <asm-generic/mman-common.h>
/* SunOS'ified... */
#define MAP_RENAME MAP_ANONYMOUS /* In SunOS terminology */
#define MAP_NORESERVE 0x40 /* don't reserve swap pages */
#define MAP_INHERIT 0x80 /* SunOS doesn't do this, but... */
#define MAP_LOCKED 0x100 /* lock the mapping */
#define _MAP_NEW 0x80000000 /* Binary compatibility is fun... */
#define MAP_GROWSDOWN 0x0200 /* stack-like segment */
#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
#define MCL_CURRENT 0x2000 /* lock all currently mapped pages */
#define MCL_FUTURE 0x4000 /* lock all additions to address space */
#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
#define MAP_NONBLOCK 0x10000 /* do not block on IO */
#define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */
#define MAP_HUGETLB 0x40000 /* create a huge page mapping */
#endif /* _UAPI__SPARC_MMAN_H__ */
/*
* psr.h: This file holds the macros for masking off various parts of
* the processor status register on the Sparc. This is valid
* for Version 8. On the V9 this is renamed to the PSTATE
* register and its members are accessed as fields like
* PSTATE.PRIV for the current CPU privilege level.
*
* Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
*/
#ifndef _UAPI__LINUX_SPARC_PSR_H
#define _UAPI__LINUX_SPARC_PSR_H
/* The Sparc PSR fields are laid out as the following:
*
* ------------------------------------------------------------------------
* | impl | vers | icc | resv | EC | EF | PIL | S | PS | ET | CWP |
* | 31-28 | 27-24 | 23-20 | 19-14 | 13 | 12 | 11-8 | 7 | 6 | 5 | 4-0 |
* ------------------------------------------------------------------------
*/
#define PSR_CWP 0x0000001f /* current window pointer */
#define PSR_ET 0x00000020 /* enable traps field */
#define PSR_PS 0x00000040 /* previous privilege level */
#define PSR_S 0x00000080 /* current privilege level */
#define PSR_PIL 0x00000f00 /* processor interrupt level */
#define PSR_EF 0x00001000 /* enable floating point */
#define PSR_EC 0x00002000 /* enable co-processor */
#define PSR_SYSCALL 0x00004000 /* inside of a syscall */
#define PSR_LE 0x00008000 /* SuperSparcII little-endian */
#define PSR_ICC 0x00f00000 /* integer condition codes */
#define PSR_C 0x00100000 /* carry bit */
#define PSR_V 0x00200000 /* overflow bit */
#define PSR_Z 0x00400000 /* zero bit */
#define PSR_N 0x00800000 /* negative bit */
#define PSR_VERS 0x0f000000 /* cpu-version field */
#define PSR_IMPL 0xf0000000 /* cpu-implementation field */
#define PSR_VERS_SHIFT 24
#define PSR_IMPL_SHIFT 28
#define PSR_VERS_SHIFTED_MASK 0xf
#define PSR_IMPL_SHIFTED_MASK 0xf
#define PSR_IMPL_TI 0x4
#define PSR_IMPL_LEON 0xf
#endif /* _UAPI__LINUX_SPARC_PSR_H */
#ifndef _UAPI__SPARC_PTRACE_H
#define _UAPI__SPARC_PTRACE_H
#if defined(__sparc__) && defined(__arch64__)
/* 64 bit sparc */
#include <asm/pstate.h>
/* This struct defines the way the registers are stored on the
* stack during a system call and basically all traps.
*/
/* This magic value must have the low 9 bits clear,
* as that is where we encode the %tt value, see below.
*/
#define PT_REGS_MAGIC 0x57ac6c00
#ifndef __ASSEMBLY__
#include <linux/types.h>
struct pt_regs {
unsigned long u_regs[16]; /* globals and ins */
unsigned long tstate;
unsigned long tpc;
unsigned long tnpc;
unsigned int y;
/* We encode a magic number, PT_REGS_MAGIC, along
* with the %tt (trap type) register value at trap
* entry time. The magic number allows us to identify
* accurately a trap stack frame in the stack
* unwinder, and the %tt value allows us to test
* things like "in a system call" etc. for an arbitray
* process.
*
* The PT_REGS_MAGIC is chosen such that it can be
* loaded completely using just a sethi instruction.
*/
unsigned int magic;
};
struct pt_regs32 {
unsigned int psr;
unsigned int pc;
unsigned int npc;
unsigned int y;
unsigned int u_regs[16]; /* globals and ins */
};
/* A V9 register window */
struct reg_window {
unsigned long locals[8];
unsigned long ins[8];
};
/* A 32-bit register window. */
struct reg_window32 {
unsigned int locals[8];
unsigned int ins[8];
};
/* A V9 Sparc stack frame */
struct sparc_stackf {
unsigned long locals[8];
unsigned long ins[6];
struct sparc_stackf *fp;
unsigned long callers_pc;
char *structptr;
unsigned long xargs[6];
unsigned long xxargs[1];
};
/* A 32-bit Sparc stack frame */
struct sparc_stackf32 {
unsigned int locals[8];
unsigned int ins[6];
unsigned int fp;
unsigned int callers_pc;
unsigned int structptr;
unsigned int xargs[6];
unsigned int xxargs[1];
};
struct sparc_trapf {
unsigned long locals[8];
unsigned long ins[8];
unsigned long _unused;
struct pt_regs *regs;
};
#endif /* (!__ASSEMBLY__) */
#else
/* 32 bit sparc */
#include <asm/psr.h>
/* This struct defines the way the registers are stored on the
* stack during a system call and basically all traps.
*/
#ifndef __ASSEMBLY__
#include <linux/types.h>
struct pt_regs {
unsigned long psr;
unsigned long pc;
unsigned long npc;
unsigned long y;
unsigned long u_regs[16]; /* globals and ins */
};
/* A 32-bit register window. */
struct reg_window32 {
unsigned long locals[8];
unsigned long ins[8];
};
/* A Sparc stack frame */
struct sparc_stackf {
unsigned long locals[8];
unsigned long ins[6];
struct sparc_stackf *fp;
unsigned long callers_pc;
char *structptr;
unsigned long xargs[6];
unsigned long xxargs[1];
};
#endif /* (!__ASSEMBLY__) */
#endif /* (defined(__sparc__) && defined(__arch64__))*/
#ifndef __ASSEMBLY__
#define TRACEREG_SZ sizeof(struct pt_regs)
#define STACKFRAME_SZ sizeof(struct sparc_stackf)
#define TRACEREG32_SZ sizeof(struct pt_regs32)
#define STACKFRAME32_SZ sizeof(struct sparc_stackf32)
#endif /* (!__ASSEMBLY__) */
#define UREG_G0 0
#define UREG_G1 1
#define UREG_G2 2
#define UREG_G3 3
#define UREG_G4 4
#define UREG_G5 5
#define UREG_G6 6
#define UREG_G7 7
#define UREG_I0 8
#define UREG_I1 9
#define UREG_I2 10
#define UREG_I3 11
#define UREG_I4 12
#define UREG_I5 13
#define UREG_I6 14
#define UREG_I7 15
#define UREG_FP UREG_I6
#define UREG_RETPC UREG_I7
#if defined(__sparc__) && defined(__arch64__)
/* 64 bit sparc */
#ifndef __ASSEMBLY__
#else /* __ASSEMBLY__ */
/* For assembly code. */
#define TRACEREG_SZ 0xa0
#define STACKFRAME_SZ 0xc0
#define TRACEREG32_SZ 0x50
#define STACKFRAME32_SZ 0x60
#endif /* __ASSEMBLY__ */
#else /* (defined(__sparc__) && defined(__arch64__)) */
/* 32 bit sparc */
#ifndef __ASSEMBLY__
#else /* (!__ASSEMBLY__) */
/* For assembly code. */
#define TRACEREG_SZ 0x50
#define STACKFRAME_SZ 0x60
#endif /* (!__ASSEMBLY__) */
#endif /* (defined(__sparc__) && defined(__arch64__)) */
/* These are for pt_regs. */
#define PT_V9_G0 0x00
#define PT_V9_G1 0x08
#define PT_V9_G2 0x10
#define PT_V9_G3 0x18
#define PT_V9_G4 0x20
#define PT_V9_G5 0x28
#define PT_V9_G6 0x30
#define PT_V9_G7 0x38
#define PT_V9_I0 0x40
#define PT_V9_I1 0x48
#define PT_V9_I2 0x50
#define PT_V9_I3 0x58
#define PT_V9_I4 0x60
#define PT_V9_I5 0x68
#define PT_V9_I6 0x70
#define PT_V9_FP PT_V9_I6
#define PT_V9_I7 0x78
#define PT_V9_TSTATE 0x80
#define PT_V9_TPC 0x88
#define PT_V9_TNPC 0x90
#define PT_V9_Y 0x98
#define PT_V9_MAGIC 0x9c
#define PT_TSTATE PT_V9_TSTATE
#define PT_TPC PT_V9_TPC
#define PT_TNPC PT_V9_TNPC
/* These for pt_regs32. */
#define PT_PSR 0x0
#define PT_PC 0x4
#define PT_NPC 0x8
#define PT_Y 0xc
#define PT_G0 0x10
#define PT_WIM PT_G0
#define PT_G1 0x14
#define PT_G2 0x18
#define PT_G3 0x1c
#define PT_G4 0x20
#define PT_G5 0x24
#define PT_G6 0x28
#define PT_G7 0x2c
#define PT_I0 0x30
#define PT_I1 0x34
#define PT_I2 0x38
#define PT_I3 0x3c
#define PT_I4 0x40
#define PT_I5 0x44
#define PT_I6 0x48
#define PT_FP PT_I6
#define PT_I7 0x4c
/* Reg_window offsets */
#define RW_V9_L0 0x00
#define RW_V9_L1 0x08
#define RW_V9_L2 0x10
#define RW_V9_L3 0x18
#define RW_V9_L4 0x20
#define RW_V9_L5 0x28
#define RW_V9_L6 0x30
#define RW_V9_L7 0x38
#define RW_V9_I0 0x40
#define RW_V9_I1 0x48
#define RW_V9_I2 0x50
#define RW_V9_I3 0x58
#define RW_V9_I4 0x60
#define RW_V9_I5 0x68
#define RW_V9_I6 0x70
#define RW_V9_I7 0x78
#define RW_L0 0x00
#define RW_L1 0x04
#define RW_L2 0x08
#define RW_L3 0x0c
#define RW_L4 0x10
#define RW_L5 0x14
#define RW_L6 0x18
#define RW_L7 0x1c
#define RW_I0 0x20
#define RW_I1 0x24
#define RW_I2 0x28
#define RW_I3 0x2c
#define RW_I4 0x30
#define RW_I5 0x34
#define RW_I6 0x38
#define RW_I7 0x3c
/* Stack_frame offsets */
#define SF_V9_L0 0x00
#define SF_V9_L1 0x08
#define SF_V9_L2 0x10
#define SF_V9_L3 0x18
#define SF_V9_L4 0x20
#define SF_V9_L5 0x28
#define SF_V9_L6 0x30
#define SF_V9_L7 0x38
#define SF_V9_I0 0x40
#define SF_V9_I1 0x48
#define SF_V9_I2 0x50
#define SF_V9_I3 0x58
#define SF_V9_I4 0x60
#define SF_V9_I5 0x68
#define SF_V9_FP 0x70
#define SF_V9_PC 0x78
#define SF_V9_RETP 0x80
#define SF_V9_XARG0 0x88
#define SF_V9_XARG1 0x90
#define SF_V9_XARG2 0x98
#define SF_V9_XARG3 0xa0
#define SF_V9_XARG4 0xa8
#define SF_V9_XARG5 0xb0
#define SF_V9_XXARG 0xb8
#define SF_L0 0x00
#define SF_L1 0x04
#define SF_L2 0x08
#define SF_L3 0x0c
#define SF_L4 0x10
#define SF_L5 0x14
#define SF_L6 0x18
#define SF_L7 0x1c
#define SF_I0 0x20
#define SF_I1 0x24
#define SF_I2 0x28
#define SF_I3 0x2c
#define SF_I4 0x30
#define SF_I5 0x34
#define SF_FP 0x38
#define SF_PC 0x3c
#define SF_RETP 0x40
#define SF_XARG0 0x44
#define SF_XARG1 0x48
#define SF_XARG2 0x4c
#define SF_XARG3 0x50
#define SF_XARG4 0x54
#define SF_XARG5 0x58
#define SF_XXARG 0x5c
/* Stuff for the ptrace system call */
#define PTRACE_SPARC_DETACH 11
#define PTRACE_GETREGS 12
#define PTRACE_SETREGS 13
#define PTRACE_GETFPREGS 14
#define PTRACE_SETFPREGS 15
#define PTRACE_READDATA 16
#define PTRACE_WRITEDATA 17
#define PTRACE_READTEXT 18
#define PTRACE_WRITETEXT 19
#define PTRACE_GETFPAREGS 20
#define PTRACE_SETFPAREGS 21
/* There are for debugging 64-bit processes, either from a 32 or 64 bit
* parent. Thus their complements are for debugging 32-bit processes only.
*/
#define PTRACE_GETREGS64 22
#define PTRACE_SETREGS64 23
/* PTRACE_SYSCALL is 24 */
#define PTRACE_GETFPREGS64 25
#define PTRACE_SETFPREGS64 26
#endif /* _UAPI__SPARC_PTRACE_H */
/*
* Just a place holder.
*/
#ifndef _UAPI_SPARC_SETUP_H
#define _UAPI_SPARC_SETUP_H
#if defined(__sparc__) && defined(__arch64__)
# define COMMAND_LINE_SIZE 2048
#else
# define COMMAND_LINE_SIZE 256
#endif
#endif /* _UAPI_SPARC_SETUP_H */
#ifndef _UAPI__SPARC_SIGINFO_H
#define _UAPI__SPARC_SIGINFO_H
#if defined(__sparc__) && defined(__arch64__)
#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
#define __ARCH_SI_BAND_T int
#endif /* defined(__sparc__) && defined(__arch64__) */
#define __ARCH_SI_TRAPNO
#include <asm-generic/siginfo.h>
#define SI_NOINFO 32767 /* no information in siginfo_t */
/*
* SIGEMT si_codes
*/
#define EMT_TAGOVF (__SI_FAULT|1) /* tag overflow */
#define NSIGEMT 1
#endif /* _UAPI__SPARC_SIGINFO_H */
#ifndef _UAPI__SPARC_SIGNAL_H
#define _UAPI__SPARC_SIGNAL_H
#include <asm/sigcontext.h>
#include <linux/compiler.h>
/* On the Sparc the signal handlers get passed a 'sub-signal' code
* for certain signal types, which we document here.
*/
#define SIGHUP 1
#define SIGINT 2
#define SIGQUIT 3
#define SIGILL 4
#define SUBSIG_STACK 0
#define SUBSIG_ILLINST 2
#define SUBSIG_PRIVINST 3
#define SUBSIG_BADTRAP(t) (0x80 + (t))
#define SIGTRAP 5
#define SIGABRT 6
#define SIGIOT 6
#define SIGEMT 7
#define SUBSIG_TAG 10
#define SIGFPE 8
#define SUBSIG_FPDISABLED 0x400
#define SUBSIG_FPERROR 0x404
#define SUBSIG_FPINTOVFL 0x001
#define SUBSIG_FPSTSIG 0x002
#define SUBSIG_IDIVZERO 0x014
#define SUBSIG_FPINEXACT 0x0c4
#define SUBSIG_FPDIVZERO 0x0c8
#define SUBSIG_FPUNFLOW 0x0cc
#define SUBSIG_FPOPERROR 0x0d0
#define SUBSIG_FPOVFLOW 0x0d4
#define SIGKILL 9
#define SIGBUS 10
#define SUBSIG_BUSTIMEOUT 1
#define SUBSIG_ALIGNMENT 2
#define SUBSIG_MISCERROR 5
#define SIGSEGV 11
#define SUBSIG_NOMAPPING 3
#define SUBSIG_PROTECTION 4
#define SUBSIG_SEGERROR 5
#define SIGSYS 12
#define SIGPIPE 13
#define SIGALRM 14
#define SIGTERM 15
#define SIGURG 16
/* SunOS values which deviate from the Linux/i386 ones */
#define SIGSTOP 17
#define SIGTSTP 18
#define SIGCONT 19
#define SIGCHLD 20
#define SIGTTIN 21
#define SIGTTOU 22
#define SIGIO 23
#define SIGPOLL SIGIO /* SysV name for SIGIO */
#define SIGXCPU 24
#define SIGXFSZ 25
#define SIGVTALRM 26
#define SIGPROF 27
#define SIGWINCH 28
#define SIGLOST 29
#define SIGPWR SIGLOST
#define SIGUSR1 30
#define SIGUSR2 31
/* Most things should be clean enough to redefine this at will, if care
is taken to make libc match. */
#define __OLD_NSIG 32
#define __NEW_NSIG 64
#ifdef __arch64__
#define _NSIG_BPW 64
#else
#define _NSIG_BPW 32
#endif
#define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
#define SIGRTMIN 32
#define SIGRTMAX __NEW_NSIG
#if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
#define _NSIG __NEW_NSIG
#define __new_sigset_t sigset_t
#define __new_sigaction sigaction
#define __new_sigaction32 sigaction32
#define __old_sigset_t old_sigset_t
#define __old_sigaction old_sigaction
#define __old_sigaction32 old_sigaction32
#else
#define _NSIG __OLD_NSIG
#define NSIG _NSIG
#define __old_sigset_t sigset_t
#define __old_sigaction sigaction
#define __old_sigaction32 sigaction32
#endif
#ifndef __ASSEMBLY__
typedef unsigned long __old_sigset_t; /* at least 32 bits */
typedef struct {
unsigned long sig[_NSIG_WORDS];
} __new_sigset_t;
/* A SunOS sigstack */
struct sigstack {
/* XXX 32-bit pointers pinhead XXX */
char *the_stack;
int cur_status;
};
/* Sigvec flags */
#define _SV_SSTACK 1u /* This signal handler should use sig-stack */
#define _SV_INTR 2u /* Sig return should not restart system call */
#define _SV_RESET 4u /* Set handler to SIG_DFL upon taken signal */
#define _SV_IGNCHILD 8u /* Do not send SIGCHLD */
/*
* sa_flags values: SA_STACK is not currently supported, but will allow the
* usage of signal stacks by using the (now obsolete) sa_restorer field in
* the sigaction structure as a stack pointer. This is now possible due to
* the changes in signal handling. LBT 010493.
* SA_RESTART flag to get restarting signals (which were the default long ago)
*/
#define SA_NOCLDSTOP _SV_IGNCHILD
#define SA_STACK _SV_SSTACK
#define SA_ONSTACK _SV_SSTACK
#define SA_RESTART _SV_INTR
#define SA_ONESHOT _SV_RESET
#define SA_NODEFER 0x20u
#define SA_NOCLDWAIT 0x100u
#define SA_SIGINFO 0x200u
#define SA_NOMASK SA_NODEFER
#define SIG_BLOCK 0x01 /* for blocking signals */
#define SIG_UNBLOCK 0x02 /* for unblocking signals */
#define SIG_SETMASK 0x04 /* for setting the signal mask */
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 4096
#define SIGSTKSZ 16384
#include <asm-generic/signal-defs.h>
struct __new_sigaction {
__sighandler_t sa_handler;
unsigned long sa_flags;
__sigrestore_t sa_restorer; /* not used by Linux/SPARC yet */
__new_sigset_t sa_mask;
};
struct __old_sigaction {
__sighandler_t sa_handler;
__old_sigset_t sa_mask;
unsigned long sa_flags;
void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
};
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
size_t ss_size;
} stack_t;
#endif /* !(__ASSEMBLY__) */
#endif /* _UAPI__SPARC_SIGNAL_H */
#ifndef _UAPI_SPARC_TERMBITS_H
#define _UAPI_SPARC_TERMBITS_H
#include <linux/posix_types.h>
typedef unsigned char cc_t;
typedef unsigned int speed_t;
#if defined(__sparc__) && defined(__arch64__)
typedef unsigned int tcflag_t;
#else
typedef unsigned long tcflag_t;
#endif
#define NCC 8
struct termio {
unsigned short c_iflag; /* input mode flags */
unsigned short c_oflag; /* output mode flags */
unsigned short c_cflag; /* control mode flags */
unsigned short c_lflag; /* local mode flags */
unsigned char c_line; /* line discipline */
unsigned char c_cc[NCC]; /* control characters */
};
#define NCCS 17
struct termios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
tcflag_t c_cflag; /* control mode flags */
tcflag_t c_lflag; /* local mode flags */
cc_t c_line; /* line discipline */
#ifndef __KERNEL__
cc_t c_cc[NCCS]; /* control characters */
#else
cc_t c_cc[NCCS+2]; /* kernel needs 2 more to hold vmin/vtime */
#define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t))
#endif
};
struct termios2 {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
tcflag_t c_cflag; /* control mode flags */
tcflag_t c_lflag; /* local mode flags */
cc_t c_line; /* line discipline */
cc_t c_cc[NCCS+2]; /* control characters */
speed_t c_ispeed; /* input speed */
speed_t c_ospeed; /* output speed */
};
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
tcflag_t c_cflag; /* control mode flags */
tcflag_t c_lflag; /* local mode flags */
cc_t c_line; /* line discipline */
cc_t c_cc[NCCS+2]; /* control characters */
speed_t c_ispeed; /* input speed */
speed_t c_ospeed; /* output speed */
};
/* c_cc characters */
#define VINTR 0
#define VQUIT 1
#define VERASE 2
#define VKILL 3
#define VEOF 4
#define VEOL 5
#define VEOL2 6
#define VSWTC 7
#define VSTART 8
#define VSTOP 9
#define VSUSP 10
#define VDSUSP 11 /* SunOS POSIX nicety I do believe... */
#define VREPRINT 12
#define VDISCARD 13
#define VWERASE 14
#define VLNEXT 15
/* Kernel keeps vmin/vtime separated, user apps assume vmin/vtime is
* shared with eof/eol
*/
#ifndef __KERNEL__
#define VMIN VEOF
#define VTIME VEOL
#endif
/* c_iflag bits */
#define IGNBRK 0x00000001
#define BRKINT 0x00000002
#define IGNPAR 0x00000004
#define PARMRK 0x00000008
#define INPCK 0x00000010
#define ISTRIP 0x00000020
#define INLCR 0x00000040
#define IGNCR 0x00000080
#define ICRNL 0x00000100
#define IUCLC 0x00000200
#define IXON 0x00000400
#define IXANY 0x00000800
#define IXOFF 0x00001000
#define IMAXBEL 0x00002000
#define IUTF8 0x00004000
/* c_oflag bits */
#define OPOST 0x00000001
#define OLCUC 0x00000002
#define ONLCR 0x00000004
#define OCRNL 0x00000008
#define ONOCR 0x00000010
#define ONLRET 0x00000020
#define OFILL 0x00000040
#define OFDEL 0x00000080
#define NLDLY 0x00000100
#define NL0 0x00000000
#define NL1 0x00000100
#define CRDLY 0x00000600
#define CR0 0x00000000
#define CR1 0x00000200
#define CR2 0x00000400
#define CR3 0x00000600
#define TABDLY 0x00001800
#define TAB0 0x00000000
#define TAB1 0x00000800
#define TAB2 0x00001000
#define TAB3 0x00001800
#define XTABS 0x00001800
#define BSDLY 0x00002000
#define BS0 0x00000000
#define BS1 0x00002000
#define VTDLY 0x00004000
#define VT0 0x00000000
#define VT1 0x00004000
#define FFDLY 0x00008000
#define FF0 0x00000000
#define FF1 0x00008000
#define PAGEOUT 0x00010000 /* SUNOS specific */
#define WRAP 0x00020000 /* SUNOS specific */
/* c_cflag bit meaning */
#define CBAUD 0x0000100f
#define B0 0x00000000 /* hang up */
#define B50 0x00000001
#define B75 0x00000002
#define B110 0x00000003
#define B134 0x00000004
#define B150 0x00000005
#define B200 0x00000006
#define B300 0x00000007
#define B600 0x00000008
#define B1200 0x00000009
#define B1800 0x0000000a
#define B2400 0x0000000b
#define B4800 0x0000000c
#define B9600 0x0000000d
#define B19200 0x0000000e
#define B38400 0x0000000f
#define EXTA B19200
#define EXTB B38400
#define CSIZE 0x00000030
#define CS5 0x00000000
#define CS6 0x00000010
#define CS7 0x00000020
#define CS8 0x00000030
#define CSTOPB 0x00000040
#define CREAD 0x00000080
#define PARENB 0x00000100
#define PARODD 0x00000200
#define HUPCL 0x00000400
#define CLOCAL 0x00000800
#define CBAUDEX 0x00001000
/* We'll never see these speeds with the Zilogs, but for completeness... */
#define BOTHER 0x00001000
#define B57600 0x00001001
#define B115200 0x00001002
#define B230400 0x00001003
#define B460800 0x00001004
/* This is what we can do with the Zilogs. */
#define B76800 0x00001005
/* This is what we can do with the SAB82532. */
#define B153600 0x00001006
#define B307200 0x00001007
#define B614400 0x00001008
#define B921600 0x00001009
/* And these are the rest... */
#define B500000 0x0000100a
#define B576000 0x0000100b
#define B1000000 0x0000100c
#define B1152000 0x0000100d
#define B1500000 0x0000100e
#define B2000000 0x0000100f
/* These have totally bogus values and nobody uses them
so far. Later on we'd have to use say 0x10000x and
adjust CBAUD constant and drivers accordingly.
#define B2500000 0x00001010
#define B3000000 0x00001011
#define B3500000 0x00001012
#define B4000000 0x00001013 */
#define CIBAUD 0x100f0000 /* input baud rate (not used) */
#define CMSPAR 0x40000000 /* mark or space (stick) parity */
#define CRTSCTS 0x80000000 /* flow control */
#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
/* c_lflag bits */
#define ISIG 0x00000001
#define ICANON 0x00000002
#define XCASE 0x00000004
#define ECHO 0x00000008
#define ECHOE 0x00000010
#define ECHOK 0x00000020
#define ECHONL 0x00000040
#define NOFLSH 0x00000080
#define TOSTOP 0x00000100
#define ECHOCTL 0x00000200
#define ECHOPRT 0x00000400
#define ECHOKE 0x00000800
#define DEFECHO 0x00001000 /* SUNOS thing, what is it? */
#define FLUSHO 0x00002000
#define PENDIN 0x00004000
#define IEXTEN 0x00008000
#define EXTPROC 0x00010000
/* modem lines */
#define TIOCM_LE 0x001
#define TIOCM_DTR 0x002
#define TIOCM_RTS 0x004
#define TIOCM_ST 0x008
#define TIOCM_SR 0x010
#define TIOCM_CTS 0x020
#define TIOCM_CAR 0x040
#define TIOCM_RNG 0x080
#define TIOCM_DSR 0x100
#define TIOCM_CD TIOCM_CAR
#define TIOCM_RI TIOCM_RNG
#define TIOCM_OUT1 0x2000
#define TIOCM_OUT2 0x4000
#define TIOCM_LOOP 0x8000
/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
/* tcflow() and TCXONC use these */
#define TCOOFF 0
#define TCOON 1
#define TCIOFF 2
#define TCION 3
/* tcflush() and TCFLSH use these */
#define TCIFLUSH 0
#define TCOFLUSH 1
#define TCIOFLUSH 2
/* tcsetattr uses these */
#define TCSANOW 0
#define TCSADRAIN 1
#define TCSAFLUSH 2
#endif /* _UAPI_SPARC_TERMBITS_H */
#ifndef _UAPI_SPARC_TERMIOS_H
#define _UAPI_SPARC_TERMIOS_H
#include <asm/ioctls.h>
#include <asm/termbits.h>
#if defined(__KERNEL__) || defined(__DEFINE_BSD_TERMIOS)
struct sgttyb {
char sg_ispeed;
char sg_ospeed;
char sg_erase;
char sg_kill;
short sg_flags;
};
struct tchars {
char t_intrc;
char t_quitc;
char t_startc;
char t_stopc;
char t_eofc;
char t_brkc;
};
struct ltchars {
char t_suspc;
char t_dsuspc;
char t_rprntc;
char t_flushc;
char t_werasc;
char t_lnextc;
};
#endif /* __KERNEL__ */
struct winsize {
unsigned short ws_row;
unsigned short ws_col;
unsigned short ws_xpixel;
unsigned short ws_ypixel;
};
#endif /* _UAPI_SPARC_TERMIOS_H */
/*
* traps.h: Format of entries for the Sparc trap table.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
*/
#ifndef _UAPI_SPARC_TRAPS_H
#define _UAPI_SPARC_TRAPS_H
#define NUM_SPARC_TRAPS 255
#ifndef __ASSEMBLY__
#endif /* !(__ASSEMBLY__) */
/* For patching the trap table at boot time, we need to know how to
* form various common Sparc instructions. Thus these macros...
*/
#define SPARC_MOV_CONST_L3(const) (0xa6102000 | (const&0xfff))
/* The following assumes that the branch lies before the place we
* are branching to. This is the case for a trap vector...
* You have been warned.
*/
#define SPARC_BRANCH(dest_addr, inst_addr) \
(0x10800000 | (((dest_addr-inst_addr)>>2)&0x3fffff))
#define SPARC_RD_PSR_L0 (0xa1480000)
#define SPARC_RD_WIM_L3 (0xa7500000)
#define SPARC_NOP (0x01000000)
/* Various interesting trap levels. */
/* First, hardware traps. */
#define SP_TRAP_TFLT 0x1 /* Text fault */
#define SP_TRAP_II 0x2 /* Illegal Instruction */
#define SP_TRAP_PI 0x3 /* Privileged Instruction */
#define SP_TRAP_FPD 0x4 /* Floating Point Disabled */
#define SP_TRAP_WOVF 0x5 /* Window Overflow */
#define SP_TRAP_WUNF 0x6 /* Window Underflow */
#define SP_TRAP_MNA 0x7 /* Memory Address Unaligned */
#define SP_TRAP_FPE 0x8 /* Floating Point Exception */
#define SP_TRAP_DFLT 0x9 /* Data Fault */
#define SP_TRAP_TOF 0xa /* Tag Overflow */
#define SP_TRAP_WDOG 0xb /* Watchpoint Detected */
#define SP_TRAP_IRQ1 0x11 /* IRQ level 1 */
#define SP_TRAP_IRQ2 0x12 /* IRQ level 2 */
#define SP_TRAP_IRQ3 0x13 /* IRQ level 3 */
#define SP_TRAP_IRQ4 0x14 /* IRQ level 4 */
#define SP_TRAP_IRQ5 0x15 /* IRQ level 5 */
#define SP_TRAP_IRQ6 0x16 /* IRQ level 6 */
#define SP_TRAP_IRQ7 0x17 /* IRQ level 7 */
#define SP_TRAP_IRQ8 0x18 /* IRQ level 8 */
#define SP_TRAP_IRQ9 0x19 /* IRQ level 9 */
#define SP_TRAP_IRQ10 0x1a /* IRQ level 10 */
#define SP_TRAP_IRQ11 0x1b /* IRQ level 11 */
#define SP_TRAP_IRQ12 0x1c /* IRQ level 12 */
#define SP_TRAP_IRQ13 0x1d /* IRQ level 13 */
#define SP_TRAP_IRQ14 0x1e /* IRQ level 14 */
#define SP_TRAP_IRQ15 0x1f /* IRQ level 15 Non-maskable */
#define SP_TRAP_RACC 0x20 /* Register Access Error ??? */
#define SP_TRAP_IACC 0x21 /* Instruction Access Error */
#define SP_TRAP_CPDIS 0x24 /* Co-Processor Disabled */
#define SP_TRAP_BADFL 0x25 /* Unimplemented Flush Instruction */
#define SP_TRAP_CPEXP 0x28 /* Co-Processor Exception */
#define SP_TRAP_DACC 0x29 /* Data Access Error */
#define SP_TRAP_DIVZ 0x2a /* Divide By Zero */
#define SP_TRAP_DSTORE 0x2b /* Data Store Error ??? */
#define SP_TRAP_DMM 0x2c /* Data Access MMU Miss ??? */
#define SP_TRAP_IMM 0x3c /* Instruction Access MMU Miss ??? */
/* Now the Software Traps... */
#define SP_TRAP_SUNOS 0x80 /* SunOS System Call */
#define SP_TRAP_SBPT 0x81 /* Software Breakpoint */
#define SP_TRAP_SDIVZ 0x82 /* Software Divide-by-Zero trap */
#define SP_TRAP_FWIN 0x83 /* Flush Windows */
#define SP_TRAP_CWIN 0x84 /* Clean Windows */
#define SP_TRAP_RCHK 0x85 /* Range Check */
#define SP_TRAP_FUNA 0x86 /* Fix Unaligned Access */
#define SP_TRAP_IOWFL 0x87 /* Integer Overflow */
#define SP_TRAP_SOLARIS 0x88 /* Solaris System Call */
#define SP_TRAP_NETBSD 0x89 /* NetBSD System Call */
#define SP_TRAP_LINUX 0x90 /* Linux System Call */
/* Names used for compatibility with SunOS */
#define ST_SYSCALL 0x00
#define ST_BREAKPOINT 0x01
#define ST_DIV0 0x02
#define ST_FLUSH_WINDOWS 0x03
#define ST_CLEAN_WINDOWS 0x04
#define ST_RANGE_CHECK 0x05
#define ST_FIX_ALIGN 0x06
#define ST_INT_OVERFLOW 0x07
/* Special traps... */
#define SP_TRAP_KBPT1 0xfe /* KADB/PROM Breakpoint one */
#define SP_TRAP_KBPT2 0xff /* KADB/PROM Breakpoint two */
/* Handy Macros */
/* Is this a trap we never expect to get? */
#define BAD_TRAP_P(level) \
((level > SP_TRAP_WDOG && level < SP_TRAP_IRQ1) || \
(level > SP_TRAP_IACC && level < SP_TRAP_CPDIS) || \
(level > SP_TRAP_BADFL && level < SP_TRAP_CPEXP) || \
(level > SP_TRAP_DMM && level < SP_TRAP_IMM) || \
(level > SP_TRAP_IMM && level < SP_TRAP_SUNOS) || \
(level > SP_TRAP_LINUX && level < SP_TRAP_KBPT1))
/* Is this a Hardware trap? */
#define HW_TRAP_P(level) ((level > 0) && (level < SP_TRAP_SUNOS))
/* Is this a Software trap? */
#define SW_TRAP_P(level) ((level >= SP_TRAP_SUNOS) && (level <= SP_TRAP_KBPT2))
/* Is this a system call for some OS we know about? */
#define SCALL_TRAP_P(level) ((level == SP_TRAP_SUNOS) || \
(level == SP_TRAP_SOLARIS) || \
(level == SP_TRAP_NETBSD) || \
(level == SP_TRAP_LINUX))
#endif /* _UAPI_SPARC_TRAPS_H */
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment