Chris Zankel | e344b63 | 2005-06-23 22:01:30 -0700 | [diff] [blame] | 1 | #ifndef SIMCALL_INCLUDED |
| 2 | #define SIMCALL_INCLUDED |
| 3 | |
| 4 | /* |
| 5 | * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND |
| 6 | * |
| 7 | * include/asm-xtensa/xtensa/simcall.h - Simulator call numbers |
| 8 | * |
| 9 | * This file is subject to the terms and conditions of the GNU General |
| 10 | * Public License. See the file "COPYING" in the main directory of |
| 11 | * this archive for more details. |
| 12 | * |
| 13 | * Copyright (C) 2002 Tensilica Inc. |
| 14 | */ |
| 15 | |
| 16 | |
| 17 | /* |
| 18 | * System call like services offered by the simulator host. |
| 19 | * These are modeled after the Linux 2.4 kernel system calls |
| 20 | * for Xtensa processors. However not all system calls and |
| 21 | * not all functionality of a given system call are implemented, |
| 22 | * or necessarily have well defined or equivalent semantics in |
| 23 | * the context of a simulation (as opposed to a Unix kernel). |
| 24 | * |
| 25 | * These services behave largely as if they had been invoked |
| 26 | * as a task in the simulator host's operating system |
| 27 | * (eg. files accessed are those of the simulator host). |
| 28 | * However, these SIMCALLs model a virtual operating system |
| 29 | * so that various definitions, bit assignments etc |
| 30 | * (eg. open mode bits, errno values, etc) are independent |
| 31 | * of the host operating system used to run the simulation. |
| 32 | * Rather these definitions are specific to the Xtensa ISS. |
| 33 | * This way Xtensa ISA code written to use these SIMCALLs |
| 34 | * can (in principle) be simulated on any host. |
| 35 | * |
| 36 | * Up to 6 parameters are passed in registers a3 to a8 |
| 37 | * (note the 6th parameter isn't passed on the stack, |
| 38 | * unlike windowed function calling conventions). |
| 39 | * The return value is in a2. A negative value in the |
| 40 | * range -4096 to -1 indicates a negated error code to be |
| 41 | * reported in errno with a return value of -1, otherwise |
| 42 | * the value in a2 is returned as is. |
| 43 | */ |
| 44 | |
| 45 | /* These #defines need to match what's in Xtensa/OS/vxworks/xtiss/simcalls.c */ |
| 46 | |
| 47 | #define SYS_nop 0 /* n/a - setup; used to flush register windows */ |
| 48 | #define SYS_exit 1 /*x*/ |
| 49 | #define SYS_fork 2 |
| 50 | #define SYS_read 3 /*x*/ |
| 51 | #define SYS_write 4 /*x*/ |
| 52 | #define SYS_open 5 /*x*/ |
| 53 | #define SYS_close 6 /*x*/ |
| 54 | #define SYS_rename 7 /*x 38 - waitpid */ |
| 55 | #define SYS_creat 8 /*x*/ |
| 56 | #define SYS_link 9 /*x (not implemented on WIN32) */ |
| 57 | #define SYS_unlink 10 /*x*/ |
| 58 | #define SYS_execv 11 /* n/a - execve */ |
| 59 | #define SYS_execve 12 /* 11 - chdir */ |
| 60 | #define SYS_pipe 13 /* 42 - time */ |
| 61 | #define SYS_stat 14 /* 106 - mknod */ |
| 62 | #define SYS_chmod 15 |
| 63 | #define SYS_chown 16 /* 202 - lchown */ |
| 64 | #define SYS_utime 17 /* 30 - break */ |
| 65 | #define SYS_wait 18 /* n/a - oldstat */ |
| 66 | #define SYS_lseek 19 /*x*/ |
| 67 | #define SYS_getpid 20 |
| 68 | #define SYS_isatty 21 /* n/a - mount */ |
| 69 | #define SYS_fstat 22 /* 108 - oldumount */ |
| 70 | #define SYS_time 23 /* 13 - setuid */ |
| 71 | #define SYS_gettimeofday 24 /*x 78 - getuid (not implemented on WIN32) */ |
| 72 | #define SYS_times 25 /*X 43 - stime (Xtensa-specific implementation) */ |
| 73 | #define SYS_socket 26 |
| 74 | #define SYS_sendto 27 |
| 75 | #define SYS_recvfrom 28 |
| 76 | #define SYS_select_one 29 /* not compitible select, one file descriptor at the time */ |
| 77 | #define SYS_bind 30 |
| 78 | #define SYS_ioctl 31 |
| 79 | |
| 80 | /* |
| 81 | * Other... |
| 82 | */ |
| 83 | #define SYS_iss_argc 1000 /* returns value of argc */ |
| 84 | #define SYS_iss_argv_size 1001 /* bytes needed for argv & arg strings */ |
| 85 | #define SYS_iss_set_argv 1002 /* saves argv & arg strings at given addr */ |
| 86 | |
| 87 | /* |
| 88 | * SIMCALLs for the ferret memory debugger. All are invoked by |
| 89 | * libferret.a ... ( Xtensa/Target-Libs/ferret ) |
| 90 | */ |
| 91 | #define SYS_ferret 1010 |
| 92 | #define SYS_malloc 1011 |
| 93 | #define SYS_free 1012 |
| 94 | #define SYS_more_heap 1013 |
| 95 | #define SYS_no_heap 1014 |
| 96 | |
| 97 | |
| 98 | /* |
| 99 | * Extra SIMCALLs for GDB: |
| 100 | */ |
| 101 | #define SYS_gdb_break -1 /* invoked by XTOS on user exceptions if EPC points |
| 102 | to a break.n/break, regardless of cause! */ |
| 103 | #define SYS_xmon_out -2 /* invoked by XMON: ... */ |
| 104 | #define SYS_xmon_in -3 /* invoked by XMON: ... */ |
| 105 | #define SYS_xmon_flush -4 /* invoked by XMON: ... */ |
| 106 | #define SYS_gdb_abort -5 /* invoked by XTOS in _xtos_panic() */ |
| 107 | #define SYS_gdb_illegal_inst -6 /* invoked by XTOS for illegal instructions (too deeply) */ |
| 108 | #define SYS_xmon_init -7 /* invoked by XMON: ... */ |
| 109 | #define SYS_gdb_enter_sktloop -8 /* invoked by XTOS on debug exceptions */ |
| 110 | |
| 111 | /* |
| 112 | * SIMCALLs for vxWorks xtiss BSP: |
| 113 | */ |
| 114 | #define SYS_setup_ppp_pipes -83 |
| 115 | #define SYS_log_msg -84 |
| 116 | |
| 117 | /* |
| 118 | * Test SIMCALLs: |
| 119 | */ |
| 120 | #define SYS_test_write_state -100 |
| 121 | #define SYS_test_read_state -101 |
| 122 | |
| 123 | /* |
| 124 | * SYS_select_one specifiers |
| 125 | */ |
| 126 | #define XTISS_SELECT_ONE_READ 1 |
| 127 | #define XTISS_SELECT_ONE_WRITE 2 |
| 128 | #define XTISS_SELECT_ONE_EXCEPT 3 |
| 129 | |
| 130 | #endif /* !SIMCALL_INCLUDED */ |