Statistics
| Branch: | Revision:

root / linux-user / ppc / syscall.h @ 192c7bd9

History | View | Annotate | Download (3.6 kB)

1 79aceca5 bellard
/*
2 79aceca5 bellard
 *  PPC emulation for qemu: syscall definitions.
3 79aceca5 bellard
 * 
4 79aceca5 bellard
 *  Copyright (c) 2003 Jocelyn Mayer
5 79aceca5 bellard
 *
6 79aceca5 bellard
 * This library is free software; you can redistribute it and/or
7 79aceca5 bellard
 * modify it under the terms of the GNU Lesser General Public
8 79aceca5 bellard
 * License as published by the Free Software Foundation; either
9 79aceca5 bellard
 * version 2 of the License, or (at your option) any later version.
10 79aceca5 bellard
 *
11 79aceca5 bellard
 * This library is distributed in the hope that it will be useful,
12 79aceca5 bellard
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 79aceca5 bellard
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 79aceca5 bellard
 * Lesser General Public License for more details.
15 79aceca5 bellard
 *
16 79aceca5 bellard
 * You should have received a copy of the GNU Lesser General Public
17 79aceca5 bellard
 * License along with this library; if not, write to the Free Software
18 79aceca5 bellard
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 79aceca5 bellard
 */
20 79aceca5 bellard
21 79aceca5 bellard
/* XXX: ABSOLUTELY BUGGY:
22 79aceca5 bellard
 * for now, this is quite just a cut-and-paste from i386 target...
23 79aceca5 bellard
 */
24 79aceca5 bellard
25 79aceca5 bellard
/* default linux values for the selectors */
26 79aceca5 bellard
#define __USER_DS        (1)
27 79aceca5 bellard
28 79aceca5 bellard
struct target_pt_regs {
29 79aceca5 bellard
        unsigned long gpr[32];
30 79aceca5 bellard
        unsigned long nip;
31 79aceca5 bellard
        unsigned long msr;
32 79aceca5 bellard
        unsigned long orig_gpr3;        /* Used for restarting system calls */
33 79aceca5 bellard
        unsigned long ctr;
34 79aceca5 bellard
        unsigned long link;
35 79aceca5 bellard
        unsigned long xer;
36 79aceca5 bellard
        unsigned long ccr;
37 79aceca5 bellard
        unsigned long mq;                /* 601 only (not used at present) */
38 79aceca5 bellard
                                        /* Used on APUS to hold IPL value. */
39 79aceca5 bellard
        unsigned long trap;                /* Reason for being here */
40 79aceca5 bellard
        unsigned long dar;                /* Fault registers */
41 79aceca5 bellard
        unsigned long dsisr;
42 79aceca5 bellard
        unsigned long result;                 /* Result of a system call */
43 79aceca5 bellard
};
44 79aceca5 bellard
45 79aceca5 bellard
/* ioctls */
46 79aceca5 bellard
struct target_revectored_struct {
47 79aceca5 bellard
        target_ulong __map[8];                        /* 256 bits */
48 79aceca5 bellard
};
49 79aceca5 bellard
50 79aceca5 bellard
/*
51 79aceca5 bellard
 * flags masks
52 79aceca5 bellard
 */
53 79aceca5 bellard
54 79aceca5 bellard
/* ipcs */
55 79aceca5 bellard
56 79aceca5 bellard
#define TARGET_SEMOP           1
57 79aceca5 bellard
#define TARGET_SEMGET          2
58 79aceca5 bellard
#define TARGET_SEMCTL          3 
59 79aceca5 bellard
#define TARGET_MSGSND          11 
60 79aceca5 bellard
#define TARGET_MSGRCV          12
61 79aceca5 bellard
#define TARGET_MSGGET          13
62 79aceca5 bellard
#define TARGET_MSGCTL          14
63 79aceca5 bellard
#define TARGET_SHMAT           21
64 79aceca5 bellard
#define TARGET_SHMDT           22
65 79aceca5 bellard
#define TARGET_SHMGET          23
66 79aceca5 bellard
#define TARGET_SHMCTL          24
67 79aceca5 bellard
68 79aceca5 bellard
struct target_msgbuf {
69 79aceca5 bellard
        int mtype;
70 79aceca5 bellard
        char mtext[1];
71 79aceca5 bellard
};
72 79aceca5 bellard
73 79aceca5 bellard
struct target_ipc_kludge {
74 79aceca5 bellard
        unsigned int        msgp;        /* Really (struct msgbuf *) */
75 79aceca5 bellard
        int msgtyp;
76 79aceca5 bellard
};        
77 79aceca5 bellard
78 79aceca5 bellard
struct target_ipc_perm {
79 79aceca5 bellard
        int        key;
80 79aceca5 bellard
        unsigned short        uid;
81 79aceca5 bellard
        unsigned short        gid;
82 79aceca5 bellard
        unsigned short        cuid;
83 79aceca5 bellard
        unsigned short        cgid;
84 79aceca5 bellard
        unsigned short        mode;
85 79aceca5 bellard
        unsigned short        seq;
86 79aceca5 bellard
};
87 79aceca5 bellard
88 79aceca5 bellard
struct target_msqid_ds {
89 79aceca5 bellard
        struct target_ipc_perm        msg_perm;
90 79aceca5 bellard
        unsigned int                msg_first;        /* really struct target_msg* */
91 79aceca5 bellard
        unsigned int                msg_last;        /* really struct target_msg* */
92 79aceca5 bellard
        unsigned int                msg_stime;        /* really target_time_t */
93 79aceca5 bellard
        unsigned int                msg_rtime;        /* really target_time_t */
94 79aceca5 bellard
        unsigned int                msg_ctime;        /* really target_time_t */
95 79aceca5 bellard
        unsigned int                wwait;                /* really struct wait_queue* */
96 79aceca5 bellard
        unsigned int                rwait;                /* really struct wait_queue* */
97 79aceca5 bellard
        unsigned short                msg_cbytes;
98 79aceca5 bellard
        unsigned short                msg_qnum;
99 79aceca5 bellard
        unsigned short                msg_qbytes;
100 79aceca5 bellard
        unsigned short                msg_lspid;
101 79aceca5 bellard
        unsigned short                msg_lrpid;
102 79aceca5 bellard
};
103 79aceca5 bellard
104 79aceca5 bellard
struct target_shmid_ds {
105 79aceca5 bellard
        struct target_ipc_perm        shm_perm;
106 79aceca5 bellard
        int                        shm_segsz;
107 79aceca5 bellard
        unsigned int                shm_atime;        /* really target_time_t */
108 79aceca5 bellard
        unsigned int                shm_dtime;        /* really target_time_t */
109 79aceca5 bellard
        unsigned int                shm_ctime;        /* really target_time_t */
110 79aceca5 bellard
        unsigned short                shm_cpid;
111 79aceca5 bellard
        unsigned short                shm_lpid;
112 79aceca5 bellard
        short                        shm_nattch;
113 79aceca5 bellard
        unsigned short                shm_npages;
114 79aceca5 bellard
        unsigned long                *shm_pages;
115 79aceca5 bellard
        void                         *attaches;        /* really struct shm_desc * */
116 79aceca5 bellard
};
117 79aceca5 bellard
118 79aceca5 bellard
#define TARGET_IPC_RMID        0
119 79aceca5 bellard
#define TARGET_IPC_SET        1
120 79aceca5 bellard
#define TARGET_IPC_STAT        2
121 79aceca5 bellard
122 79aceca5 bellard
union target_semun {
123 79aceca5 bellard
    int val;
124 79aceca5 bellard
    unsigned int buf;        /* really struct semid_ds * */
125 79aceca5 bellard
    unsigned int array; /* really unsigned short * */
126 79aceca5 bellard
    unsigned int __buf;        /* really struct seminfo * */
127 79aceca5 bellard
    unsigned int __pad;        /* really void* */
128 79aceca5 bellard
};
129 79aceca5 bellard
130 cf720db3 bellard
#define UNAME_MACHINE "ppc"