Commit 7ed601b782cbcaf0cddff6c5725712e47972f26d
1 parent
d1f2367b
more syscalls
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@59 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
210 additions
and
0 deletions
syscall-i386.h
| @@ -237,6 +237,36 @@ | @@ -237,6 +237,36 @@ | ||
| 237 | #define TARGET_NR_removexattr 235 | 237 | #define TARGET_NR_removexattr 235 |
| 238 | #define TARGET_NR_lremovexattr 236 | 238 | #define TARGET_NR_lremovexattr 236 |
| 239 | #define TARGET_NR_fremovexattr 237 | 239 | #define TARGET_NR_fremovexattr 237 |
| 240 | +#define TARGET_NR_tkill 238 | ||
| 241 | +#define TARGET_NR_sendfile64 239 | ||
| 242 | +#define TARGET_NR_futex 240 | ||
| 243 | +#define TARGET_NR_sched_setaffinity 241 | ||
| 244 | +#define TARGET_NR_sched_getaffinity 242 | ||
| 245 | +#define TARGET_NR_set_thread_area 243 | ||
| 246 | +#define TARGET_NR_get_thread_area 244 | ||
| 247 | +#define TARGET_NR_io_setup 245 | ||
| 248 | +#define TARGET_NR_io_destroy 246 | ||
| 249 | +#define TARGET_NR_io_getevents 247 | ||
| 250 | +#define TARGET_NR_io_submit 248 | ||
| 251 | +#define TARGET_NR_io_cancel 249 | ||
| 252 | +#define TARGET_NR_fadvise64 250 | ||
| 253 | + | ||
| 254 | +#define TARGET_NR_exit_group 252 | ||
| 255 | +#define TARGET_NR_lookup_dcookie 253 | ||
| 256 | +#define TARGET_NR_epoll_create 254 | ||
| 257 | +#define TARGET_NR_epoll_ctl 255 | ||
| 258 | +#define TARGET_NR_epoll_wait 256 | ||
| 259 | +#define TARGET_NR_remap_file_pages 257 | ||
| 260 | +#define TARGET_NR_set_tid_address 258 | ||
| 261 | +#define TARGET_NR_timer_create 259 | ||
| 262 | +#define TARGET_NR_timer_settime (TARGET_NR_timer_create+1) | ||
| 263 | +#define TARGET_NR_timer_gettime (TARGET_NR_timer_create+2) | ||
| 264 | +#define TARGET_NR_timer_getoverrun (TARGET_NR_timer_create+3) | ||
| 265 | +#define TARGET_NR_timer_delete (TARGET_NR_timer_create+4) | ||
| 266 | +#define TARGET_NR_clock_settime (TARGET_NR_timer_create+5) | ||
| 267 | +#define TARGET_NR_clock_gettime (TARGET_NR_timer_create+6) | ||
| 268 | +#define TARGET_NR_clock_getres (TARGET_NR_timer_create+7) | ||
| 269 | +#define TARGET_NR_clock_nanosleep (TARGET_NR_timer_create+8) | ||
| 240 | 270 | ||
| 241 | #define TARGET_SIG_BLOCK 0 /* for blocking signals */ | 271 | #define TARGET_SIG_BLOCK 0 /* for blocking signals */ |
| 242 | #define TARGET_SIG_UNBLOCK 1 /* for unblocking signals */ | 272 | #define TARGET_SIG_UNBLOCK 1 /* for unblocking signals */ |
| @@ -714,6 +744,10 @@ struct target_termios { | @@ -714,6 +744,10 @@ struct target_termios { | ||
| 714 | #define TARGET_LDT_ENTRIES 8192 | 744 | #define TARGET_LDT_ENTRIES 8192 |
| 715 | #define TARGET_LDT_ENTRY_SIZE 8 | 745 | #define TARGET_LDT_ENTRY_SIZE 8 |
| 716 | 746 | ||
| 747 | +#define TARGET_GDT_ENTRY_TLS_ENTRIES 3 | ||
| 748 | +#define TARGET_GDT_ENTRY_TLS_MIN 6 | ||
| 749 | +#define TARGET_GDT_ENTRY_TLS_MAX (TARGET_GDT_ENTRY_TLS_MIN + TARGET_GDT_ENTRY_TLS_ENTRIES - 1) | ||
| 750 | + | ||
| 717 | struct target_modify_ldt_ldt_s { | 751 | struct target_modify_ldt_ldt_s { |
| 718 | unsigned int entry_number; | 752 | unsigned int entry_number; |
| 719 | target_ulong base_addr; | 753 | target_ulong base_addr; |
| @@ -721,6 +755,182 @@ struct target_modify_ldt_ldt_s { | @@ -721,6 +755,182 @@ struct target_modify_ldt_ldt_s { | ||
| 721 | unsigned int flags; | 755 | unsigned int flags; |
| 722 | }; | 756 | }; |
| 723 | 757 | ||
| 758 | +#define TARGET_VM86_SIGNAL 0 /* return due to signal */ | ||
| 759 | +#define TARGET_VM86_UNKNOWN 1 /* unhandled GP fault - IO-instruction or similar */ | ||
| 760 | +#define TARGET_VM86_INTx 2 /* int3/int x instruction (ARG = x) */ | ||
| 761 | +#define TARGET_VM86_STI 3 /* sti/popf/iret instruction enabled virtual interrupts */ | ||
| 762 | + | ||
| 763 | +/* | ||
| 764 | + * Additional return values when invoking new vm86() | ||
| 765 | + */ | ||
| 766 | +#define TARGET_VM86_PICRETURN 4 /* return due to pending PIC request */ | ||
| 767 | +#define TARGET_VM86_TRAP 6 /* return due to DOS-debugger request */ | ||
| 768 | + | ||
| 769 | +/* | ||
| 770 | + * function codes when invoking new vm86() | ||
| 771 | + */ | ||
| 772 | +#define TARGET_VM86_PLUS_INSTALL_CHECK 0 | ||
| 773 | +#define TARGET_VM86_ENTER 1 | ||
| 774 | +#define TARGET_VM86_ENTER_NO_BYPASS 2 | ||
| 775 | +#define TARGET_VM86_REQUEST_IRQ 3 | ||
| 776 | +#define TARGET_VM86_FREE_IRQ 4 | ||
| 777 | +#define TARGET_VM86_GET_IRQ_BITS 5 | ||
| 778 | +#define TARGET_VM86_GET_AND_RESET_IRQ 6 | ||
| 779 | + | ||
| 780 | +/* | ||
| 781 | + * This is the stack-layout seen by the user space program when we have | ||
| 782 | + * done a translation of "SAVE_ALL" from vm86 mode. The real kernel layout | ||
| 783 | + * is 'kernel_vm86_regs' (see below). | ||
| 784 | + */ | ||
| 785 | + | ||
| 786 | +struct target_vm86_regs { | ||
| 787 | +/* | ||
| 788 | + * normal regs, with special meaning for the segment descriptors.. | ||
| 789 | + */ | ||
| 790 | + target_long ebx; | ||
| 791 | + target_long ecx; | ||
| 792 | + target_long edx; | ||
| 793 | + target_long esi; | ||
| 794 | + target_long edi; | ||
| 795 | + target_long ebp; | ||
| 796 | + target_long eax; | ||
| 797 | + target_long __null_ds; | ||
| 798 | + target_long __null_es; | ||
| 799 | + target_long __null_fs; | ||
| 800 | + target_long __null_gs; | ||
| 801 | + target_long orig_eax; | ||
| 802 | + target_long eip; | ||
| 803 | + unsigned short cs, __csh; | ||
| 804 | + target_long eflags; | ||
| 805 | + target_long esp; | ||
| 806 | + unsigned short ss, __ssh; | ||
| 807 | +/* | ||
| 808 | + * these are specific to v86 mode: | ||
| 809 | + */ | ||
| 810 | + unsigned short es, __esh; | ||
| 811 | + unsigned short ds, __dsh; | ||
| 812 | + unsigned short fs, __fsh; | ||
| 813 | + unsigned short gs, __gsh; | ||
| 814 | +}; | ||
| 815 | + | ||
| 816 | +struct target_revectored_struct { | ||
| 817 | + target_ulong __map[8]; /* 256 bits */ | ||
| 818 | +}; | ||
| 819 | + | ||
| 820 | +struct target_vm86_struct { | ||
| 821 | + struct target_vm86_regs regs; | ||
| 822 | + target_ulong flags; | ||
| 823 | + target_ulong screen_bitmap; | ||
| 824 | + target_ulong cpu_type; | ||
| 825 | + struct target_revectored_struct int_revectored; | ||
| 826 | + struct target_revectored_struct int21_revectored; | ||
| 827 | +}; | ||
| 828 | + | ||
| 829 | +/* | ||
| 830 | + * flags masks | ||
| 831 | + */ | ||
| 832 | +#define TARGET_VM86_SCREEN_BITMAP 0x0001 | ||
| 833 | + | ||
| 834 | +struct target_vm86plus_info_struct { | ||
| 835 | + target_ulong flags; | ||
| 836 | +#define TARGET_force_return_for_pic (1 << 0) | ||
| 837 | +#define TARGET_vm86dbg_active (1 << 1) /* for debugger */ | ||
| 838 | +#define TARGET_vm86dbg_TFpendig (1 << 2) /* for debugger */ | ||
| 839 | +#define TARGET_is_vm86pus (1 << 31) /* for vm86 internal use */ | ||
| 840 | + unsigned char vm86dbg_intxxtab[32]; /* for debugger */ | ||
| 841 | +}; | ||
| 842 | + | ||
| 843 | +struct target_vm86plus_struct { | ||
| 844 | + struct target_vm86_regs regs; | ||
| 845 | + target_ulong flags; | ||
| 846 | + target_ulong screen_bitmap; | ||
| 847 | + target_ulong cpu_type; | ||
| 848 | + struct target_revectored_struct int_revectored; | ||
| 849 | + struct target_revectored_struct int21_revectored; | ||
| 850 | + struct target_vm86plus_info_struct vm86plus; | ||
| 851 | +}; | ||
| 852 | + | ||
| 853 | +/* ipcs */ | ||
| 854 | + | ||
| 855 | +#define TARGET_SEMOP 1 | ||
| 856 | +#define TARGET_SEMGET 2 | ||
| 857 | +#define TARGET_SEMCTL 3 | ||
| 858 | +#define TARGET_MSGSND 11 | ||
| 859 | +#define TARGET_MSGRCV 12 | ||
| 860 | +#define TARGET_MSGGET 13 | ||
| 861 | +#define TARGET_MSGCTL 14 | ||
| 862 | +#define TARGET_SHMAT 21 | ||
| 863 | +#define TARGET_SHMDT 22 | ||
| 864 | +#define TARGET_SHMGET 23 | ||
| 865 | +#define TARGET_SHMCTL 24 | ||
| 866 | + | ||
| 867 | +struct target_msgbuf { | ||
| 868 | + int mtype; | ||
| 869 | + char mtext[1]; | ||
| 870 | +}; | ||
| 871 | + | ||
| 872 | +struct target_ipc_kludge { | ||
| 873 | + unsigned int msgp; /* Really (struct msgbuf *) */ | ||
| 874 | + int msgtyp; | ||
| 875 | +}; | ||
| 876 | + | ||
| 877 | +struct alpha_msgbuf { | ||
| 878 | + long mtype; | ||
| 879 | + char mtext[4096]; | ||
| 880 | +}; | ||
| 881 | + | ||
| 882 | +struct target_ipc_perm { | ||
| 883 | + int key; | ||
| 884 | + unsigned short uid; | ||
| 885 | + unsigned short gid; | ||
| 886 | + unsigned short cuid; | ||
| 887 | + unsigned short cgid; | ||
| 888 | + unsigned short mode; | ||
| 889 | + unsigned short seq; | ||
| 890 | +}; | ||
| 891 | + | ||
| 892 | +struct target_msqid_ds { | ||
| 893 | + struct target_ipc_perm msg_perm; | ||
| 894 | + unsigned int msg_first; /* really struct target_msg* */ | ||
| 895 | + unsigned int msg_last; /* really struct target_msg* */ | ||
| 896 | + unsigned int msg_stime; /* really target_time_t */ | ||
| 897 | + unsigned int msg_rtime; /* really target_time_t */ | ||
| 898 | + unsigned int msg_ctime; /* really target_time_t */ | ||
| 899 | + unsigned int wwait; /* really struct wait_queue* */ | ||
| 900 | + unsigned int rwait; /* really struct wait_queue* */ | ||
| 901 | + unsigned short msg_cbytes; | ||
| 902 | + unsigned short msg_qnum; | ||
| 903 | + unsigned short msg_qbytes; | ||
| 904 | + unsigned short msg_lspid; | ||
| 905 | + unsigned short msg_lrpid; | ||
| 906 | +}; | ||
| 907 | + | ||
| 908 | +struct target_shmid_ds { | ||
| 909 | + struct target_ipc_perm shm_perm; | ||
| 910 | + int shm_segsz; | ||
| 911 | + unsigned int shm_atime; /* really target_time_t */ | ||
| 912 | + unsigned int shm_dtime; /* really target_time_t */ | ||
| 913 | + unsigned int shm_ctime; /* really target_time_t */ | ||
| 914 | + unsigned short shm_cpid; | ||
| 915 | + unsigned short shm_lpid; | ||
| 916 | + short shm_nattch; | ||
| 917 | + unsigned short shm_npages; | ||
| 918 | + unsigned long *shm_pages; | ||
| 919 | + void *attaches; /* really struct shm_desc * */ | ||
| 920 | +}; | ||
| 921 | + | ||
| 922 | +#define TARGET_IPC_RMID 0 | ||
| 923 | +#define TARGET_IPC_SET 1 | ||
| 924 | +#define TARGET_IPC_STAT 2 | ||
| 925 | + | ||
| 926 | +union target_semun { | ||
| 927 | + int val; | ||
| 928 | + unsigned int buf; /* really struct semid_ds * */ | ||
| 929 | + unsigned int array; /* really unsigned short * */ | ||
| 930 | + unsigned int __buf; /* really struct seminfo * */ | ||
| 931 | + unsigned int __pad; /* really void* */ | ||
| 932 | +}; | ||
| 933 | + | ||
| 724 | /* soundcard defines (XXX: move them to generic file syscall_defs.h) */ | 934 | /* soundcard defines (XXX: move them to generic file syscall_defs.h) */ |
| 725 | 935 | ||
| 726 | #define TARGET_SNDCTL_COPR_HALT 0xc0144307 | 936 | #define TARGET_SNDCTL_COPR_HALT 0xc0144307 |