am 0ac6d235: am b13ad93f: am 3820229b: am d504eee9: Merge "MIPS support to sys/ headers"

* commit '0ac6d23515cbeb8462b62be713119edb8718cd70':
  MIPS support to sys/ headers
This commit is contained in:
Elliott Hughes 2012-08-08 17:49:39 -07:00 committed by Android Git Automerger
commit 1ab6f486de
5 changed files with 98 additions and 0 deletions

View File

@ -41,15 +41,45 @@ __BIONIC_SIGDEF(QUIT,3,"Quit")
__BIONIC_SIGDEF(ILL,4,"Illegal instruction") __BIONIC_SIGDEF(ILL,4,"Illegal instruction")
__BIONIC_SIGDEF(TRAP,5,"Trap") __BIONIC_SIGDEF(TRAP,5,"Trap")
__BIONIC_SIGDEF(ABRT,6,"Aborted") __BIONIC_SIGDEF(ABRT,6,"Aborted")
#ifdef __mips__
__BIONIC_SIGDEF(EMT,7,"EMT")
#else
__BIONIC_SIGDEF(BUS,7,"Bus error") __BIONIC_SIGDEF(BUS,7,"Bus error")
#endif
__BIONIC_SIGDEF(FPE,8,"Floating point exception") __BIONIC_SIGDEF(FPE,8,"Floating point exception")
__BIONIC_SIGDEF(KILL,9,"Killed") __BIONIC_SIGDEF(KILL,9,"Killed")
#ifdef __mips__
__BIONIC_SIGDEF(BUS,10,"Bus error")
#else
__BIONIC_SIGDEF(USR1,10,"User signal 1") __BIONIC_SIGDEF(USR1,10,"User signal 1")
#endif
__BIONIC_SIGDEF(SEGV,11,"Segmentation fault") __BIONIC_SIGDEF(SEGV,11,"Segmentation fault")
#ifdef __mips__
__BIONIC_SIGDEF(SYS,12,"Bad system call")
#else
__BIONIC_SIGDEF(USR2,12,"User signal 2") __BIONIC_SIGDEF(USR2,12,"User signal 2")
#endif
__BIONIC_SIGDEF(PIPE,13,"Broken pipe") __BIONIC_SIGDEF(PIPE,13,"Broken pipe")
__BIONIC_SIGDEF(ALRM,14,"Alarm clock") __BIONIC_SIGDEF(ALRM,14,"Alarm clock")
__BIONIC_SIGDEF(TERM,15,"Terminated") __BIONIC_SIGDEF(TERM,15,"Terminated")
#ifdef __mips__
__BIONIC_SIGDEF(USR1,16,"User signal 1")
__BIONIC_SIGDEF(USR2,17,"User signal 2")
__BIONIC_SIGDEF(CHLD,18,"Child exited")
__BIONIC_SIGDEF(PWR,19,"Power failure")
__BIONIC_SIGDEF(WINCH,20,"Window size changed")
__BIONIC_SIGDEF(URG,21,"Urgent I/O condition")
__BIONIC_SIGDEF(IO,22,"I/O possible")
__BIONIC_SIGDEF(STOP,23,"Stopped (signal)")
__BIONIC_SIGDEF(TSTP,24,"Stopped")
__BIONIC_SIGDEF(CONT,25,"Continue")
__BIONIC_SIGDEF(TTIN,26,"Stopped (tty input)")
__BIONIC_SIGDEF(TTOU,27,"Stopped (tty output)")
__BIONIC_SIGDEF(VTALRM,28,"Virtual timer expired")
__BIONIC_SIGDEF(PROF,29,"Profiling timer expired")
__BIONIC_SIGDEF(XCPU,30,"CPU time limit exceeded")
__BIONIC_SIGDEF(XFSZ,31,"File size limit exceeded")
#else
__BIONIC_SIGDEF(STKFLT,16,"Stack fault") __BIONIC_SIGDEF(STKFLT,16,"Stack fault")
__BIONIC_SIGDEF(CHLD,17,"Child exited") __BIONIC_SIGDEF(CHLD,17,"Child exited")
__BIONIC_SIGDEF(CONT,18,"Continue") __BIONIC_SIGDEF(CONT,18,"Continue")
@ -66,5 +96,6 @@ __BIONIC_SIGDEF(WINCH,28,"Window size changed")
__BIONIC_SIGDEF(IO,29,"I/O possible") __BIONIC_SIGDEF(IO,29,"I/O possible")
__BIONIC_SIGDEF(PWR,30,"Power failure") __BIONIC_SIGDEF(PWR,30,"Power failure")
__BIONIC_SIGDEF(SYS,31,"Bad system call") __BIONIC_SIGDEF(SYS,31,"Bad system call")
#endif
#undef __BIONIC_SIGDEF #undef __BIONIC_SIGDEF

View File

@ -42,6 +42,7 @@
/*#include <sys/ttychars.h>*/ /*#include <sys/ttychars.h>*/
/*#include <sys/ttydev.h>*/ /*#include <sys/ttydev.h>*/
#if !defined(__mips__)
struct tchars { struct tchars {
char t_intrc; /* interrupt */ char t_intrc; /* interrupt */
char t_quitc; /* quit */ char t_quitc; /* quit */
@ -73,6 +74,7 @@ struct sgttyb {
short sg_flags; /* mode flags */ short sg_flags; /* mode flags */
}; };
#endif #endif
#endif
#ifdef USE_OLD_TTY #ifdef USE_OLD_TTY
# undef TIOCGETD # undef TIOCGETD
@ -84,9 +86,11 @@ struct sgttyb {
# define OTIOCSETD _IOW('t', 1, int) /* set line discipline */ # define OTIOCSETD _IOW('t', 1, int) /* set line discipline */
#endif #endif
#define TIOCHPCL _IO('t', 2) /* hang up on last close */ #define TIOCHPCL _IO('t', 2) /* hang up on last close */
#if !defined(__mips__)
#define TIOCGETP _IOR('t', 8,struct sgttyb)/* get parameters -- gtty */ #define TIOCGETP _IOR('t', 8,struct sgttyb)/* get parameters -- gtty */
#define TIOCSETP _IOW('t', 9,struct sgttyb)/* set parameters -- stty */ #define TIOCSETP _IOW('t', 9,struct sgttyb)/* set parameters -- stty */
#define TIOCSETN _IOW('t',10,struct sgttyb)/* as above, but no flushtty*/ #define TIOCSETN _IOW('t',10,struct sgttyb)/* as above, but no flushtty*/
#endif
#define TIOCSETC _IOW('t',17,struct tchars)/* set special characters */ #define TIOCSETC _IOW('t',17,struct tchars)/* set special characters */
#define TIOCGETC _IOR('t',18,struct tchars)/* get special characters */ #define TIOCGETC _IOR('t',18,struct tchars)/* get special characters */
#if 0 #if 0
@ -158,8 +162,10 @@ struct sgttyb {
#define LPENDIN (PENDIN>>16) #define LPENDIN (PENDIN>>16)
#define LDECCTQ (DECCTQ>>16) #define LDECCTQ (DECCTQ>>16)
#define LNOFLSH (NOFLSH>>16) #define LNOFLSH (NOFLSH>>16)
#if !defined(__mips__)
#define TIOCSLTC _IOW('t',117,struct ltchars)/* set local special chars*/ #define TIOCSLTC _IOW('t',117,struct ltchars)/* set local special chars*/
#define TIOCGLTC _IOR('t',116,struct ltchars)/* get local special chars*/ #define TIOCGLTC _IOR('t',116,struct ltchars)/* get local special chars*/
#endif
#define OTIOCCONS _IO('t', 98) /* for hp300 -- sans int arg */ #define OTIOCCONS _IO('t', 98) /* for hp300 -- sans int arg */
#define OTTYDISC 0 #define OTTYDISC 0
#define NETLDISC 1 #define NETLDISC 1

View File

@ -34,12 +34,22 @@
__BEGIN_DECLS __BEGIN_DECLS
#ifdef __mips__
#define SOCK_DGRAM 1
#define SOCK_STREAM 2
#define SOCK_RAW 3
#define SOCK_RDM 4
#define SOCK_SEQPACKET 5
#define SOCK_DCCP 6
#define SOCK_PACKET 10
#else
#define SOCK_STREAM 1 #define SOCK_STREAM 1
#define SOCK_DGRAM 2 #define SOCK_DGRAM 2
#define SOCK_RAW 3 #define SOCK_RAW 3
#define SOCK_RDM 4 #define SOCK_RDM 4
#define SOCK_SEQPACKET 5 #define SOCK_SEQPACKET 5
#define SOCK_PACKET 10 #define SOCK_PACKET 10
#endif
#ifdef __i386__ #ifdef __i386__
# define __socketcall extern __attribute__((__cdecl__)) # define __socketcall extern __attribute__((__cdecl__))

View File

@ -41,6 +41,39 @@ __BEGIN_DECLS
* Note: The kernel zero's the padded region because glibc might read them * Note: The kernel zero's the padded region because glibc might read them
* in the hope that the kernel has stretched to using larger sizes. * in the hope that the kernel has stretched to using larger sizes.
*/ */
#ifdef __mips__
struct stat {
unsigned long st_dev;
unsigned long __pad0[3];
unsigned long long st_ino;
unsigned int st_mode;
unsigned int st_nlink;
unsigned long st_uid;
unsigned long st_gid;
unsigned long st_rdev;
unsigned long __pad1[3];
long long st_size;
unsigned long st_atime;
unsigned long st_atime_nsec;
unsigned long st_mtime;
unsigned long st_mtime_nsec;
unsigned long st_ctime;
unsigned long st_ctime_nsec;
unsigned long st_blksize;
unsigned long __pad2;
unsigned long long st_blocks;
};
#else
struct stat { struct stat {
unsigned long long st_dev; unsigned long long st_dev;
unsigned char __pad0[4]; unsigned char __pad0[4];
@ -70,6 +103,7 @@ struct stat {
unsigned long long st_ino; unsigned long long st_ino;
}; };
#endif
/* For compatibility with GLibc, we provide macro aliases /* For compatibility with GLibc, we provide macro aliases
* for the non-Posix nano-seconds accessors. * for the non-Posix nano-seconds accessors.

View File

@ -35,6 +35,22 @@
__BEGIN_DECLS __BEGIN_DECLS
/* note: this corresponds to the kernel's statfs64 type */ /* note: this corresponds to the kernel's statfs64 type */
#ifdef __mips__
struct statfs {
uint32_t f_type;
uint32_t f_bsize;
uint32_t f_frsize;
uint32_t __pad;
uint64_t f_blocks;
uint64_t f_bfree;
uint64_t f_files;
uint64_t f_ffree;
uint64_t f_bavail;
__kernel_fsid_t f_fsid;
uint32_t f_namelen;
uint32_t f_spare[6];
};
#else
struct statfs { struct statfs {
uint32_t f_type; uint32_t f_type;
uint32_t f_bsize; uint32_t f_bsize;
@ -48,6 +64,7 @@ struct statfs {
uint32_t f_frsize; uint32_t f_frsize;
uint32_t f_spare[5]; uint32_t f_spare[5];
}; };
#endif
#define ADFS_SUPER_MAGIC 0xadf5 #define ADFS_SUPER_MAGIC 0xadf5
#define AFFS_SUPER_MAGIC 0xADFF #define AFFS_SUPER_MAGIC 0xADFF