diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2014-03-21 21:02:52 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2014-03-21 21:02:52 +0000 |
commit | 23cf8028ec4b7bb2206fbfde1fe9b59ac977f324 (patch) | |
tree | 516e33d63d67dea70c373bd3dae453ca9bdd5d99 /libgloss/nds32 | |
parent | e59026e844dc2f11f032058e671da848beb67f91 (diff) | |
download | newlib-23cf8028ec4b7bb2206fbfde1fe9b59ac977f324.zip newlib-23cf8028ec4b7bb2206fbfde1fe9b59ac977f324.tar.gz newlib-23cf8028ec4b7bb2206fbfde1fe9b59ac977f324.tar.bz2 |
2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
* nds32/_argv.S: Replace syscall with break.
* nds32/_argvlen.S: Ditto.
* nds32/_chdir.S: Ditto.
* nds32/_chmod.S: Ditto.
* nds32/_close.S: Ditto.
* nds32/_exit.S: Ditto.
* nds32/_fstat.S: Ditto.
* nds32/_getpid.S: Ditto.
* nds32/_gettimeofday.S: Ditto.
* nds32/_isatty.S: Ditto.
* nds32/_kill.S: Ditto.
* nds32/_link.S: Ditto.
* nds32/_lseek.S: Ditto.
* nds32/_open.S: Ditto.
* nds32/_read.S: Ditto.
* nds32/_rename.S: Ditto.
* nds32/_stat.S: Ditto.
* nds32/_system.S: Ditto.
* nds32/_time.S: Ditto.
* nds32/_times.S: Ditto.
* nds32/_unlink.S: Ditto.
* nds32/_utime.S: Ditto.
* nds32/_write.S: Ditto.
* nds32/syscall_error_handler.S: Ditto.
* nds32/vh.h: New.
Diffstat (limited to 'libgloss/nds32')
-rw-r--r-- | libgloss/nds32/_argv.S | 6 | ||||
-rw-r--r-- | libgloss/nds32/_argvlen.S | 6 | ||||
-rw-r--r-- | libgloss/nds32/_chdir.S | 6 | ||||
-rw-r--r-- | libgloss/nds32/_chmod.S | 7 | ||||
-rw-r--r-- | libgloss/nds32/_close.S | 12 | ||||
-rw-r--r-- | libgloss/nds32/_exit.S | 12 | ||||
-rw-r--r-- | libgloss/nds32/_fstat.S | 13 | ||||
-rw-r--r-- | libgloss/nds32/_getpid.S | 7 | ||||
-rw-r--r-- | libgloss/nds32/_gettimeofday.S | 12 | ||||
-rw-r--r-- | libgloss/nds32/_isatty.S | 12 | ||||
-rw-r--r-- | libgloss/nds32/_kill.S | 7 | ||||
-rw-r--r-- | libgloss/nds32/_link.S | 6 | ||||
-rw-r--r-- | libgloss/nds32/_lseek.S | 12 | ||||
-rw-r--r-- | libgloss/nds32/_open.S | 12 | ||||
-rw-r--r-- | libgloss/nds32/_read.S | 12 | ||||
-rw-r--r-- | libgloss/nds32/_rename.S | 12 | ||||
-rw-r--r-- | libgloss/nds32/_stat.S | 12 | ||||
-rw-r--r-- | libgloss/nds32/_system.S | 12 | ||||
-rw-r--r-- | libgloss/nds32/_time.S | 6 | ||||
-rw-r--r-- | libgloss/nds32/_times.S | 6 | ||||
-rw-r--r-- | libgloss/nds32/_unlink.S | 13 | ||||
-rw-r--r-- | libgloss/nds32/_utime.S | 6 | ||||
-rw-r--r-- | libgloss/nds32/_write.S | 12 | ||||
-rw-r--r-- | libgloss/nds32/syscall_error_handler.S | 3 | ||||
-rw-r--r-- | libgloss/nds32/vh.h | 123 |
25 files changed, 301 insertions, 46 deletions
diff --git a/libgloss/nds32/_argv.S b/libgloss/nds32/_argv.S index 2fcf1f1..bd85979 100644 --- a/libgloss/nds32/_argv.S +++ b/libgloss/nds32/_argv.S @@ -27,8 +27,10 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef __NDS32_VH__ + #include "../syscall.h" #include "syscall_extra.h" - - SYS_WRAPPER _argv, SYS_argv + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_argvlen.S b/libgloss/nds32/_argvlen.S index 3f88a41..32401d3 100644 --- a/libgloss/nds32/_argvlen.S +++ b/libgloss/nds32/_argvlen.S @@ -27,8 +27,10 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef __NDS32_VH__ + #include "../syscall.h" #include "syscall_extra.h" - - SYS_WRAPPER _argvlen, SYS_argvlen + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_chdir.S b/libgloss/nds32/_chdir.S index 0fd291e..bb6b324 100644 --- a/libgloss/nds32/_chdir.S +++ b/libgloss/nds32/_chdir.S @@ -27,8 +27,10 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef __NDS32_VH__ + #include "../syscall.h" #include "syscall_extra.h" - - SYS_WRAPPER _chdir, SYS_chdir + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_chmod.S b/libgloss/nds32/_chmod.S index 70c903d..231a18f 100644 --- a/libgloss/nds32/_chmod.S +++ b/libgloss/nds32/_chmod.S @@ -27,8 +27,11 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../syscall.h" -#include "syscall_extra.h" +#ifndef __NDS32_VH__ +#include "../syscall.h" +#include "syscall_extra.h" SYS_WRAPPER _chmod, SYS_chmod + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_close.S b/libgloss/nds32/_close.S index c0abe59..0a1aec1 100644 --- a/libgloss/nds32/_close.S +++ b/libgloss/nds32/_close.S @@ -27,8 +27,16 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../syscall.h" -#include "syscall_extra.h" +#ifdef __NDS32_VH__ + +#include "vh.h" +.extern _impure_ptr +TYPE1 _close, VH_CLOSE +#else /* not __NDS32_VH__ */ +#include "../syscall.h" +#include "syscall_extra.h" SYS_WRAPPER _close, SYS_close + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_exit.S b/libgloss/nds32/_exit.S index 46a2040..8154fbe 100644 --- a/libgloss/nds32/_exit.S +++ b/libgloss/nds32/_exit.S @@ -27,10 +27,16 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../syscall.h" -#include "syscall_extra.h" +#ifdef __NDS32_VH__ + +#include "vh.h" +.extern _impure_ptr +TYPE3 _exit, VH_EXIT +#else /* not __NDS32_VH__ */ +#include "../syscall.h" +#include "syscall_extra.h" .section .text .global _exit .type _exit, @function @@ -38,3 +44,5 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. _exit: syscall SYS_exit /* Make syscall 'SYS_exit'. */ .size _exit, .-_exit + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_fstat.S b/libgloss/nds32/_fstat.S index 94e58ad..7d0cb6e 100644 --- a/libgloss/nds32/_fstat.S +++ b/libgloss/nds32/_fstat.S @@ -27,8 +27,17 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../syscall.h" -#include "syscall_extra.h" +#ifdef __NDS32_VH__ + +#include "vh.h" +.extern _impure_ptr +TYPE1 _fstat, VH_FSTAT + +#else /* not __NDS32_VH__ */ +#include "../syscall.h" +#include "syscall_extra.h" SYS_WRAPPER _fstat, SYS_fstat + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_getpid.S b/libgloss/nds32/_getpid.S index 8468d3f..086be84 100644 --- a/libgloss/nds32/_getpid.S +++ b/libgloss/nds32/_getpid.S @@ -27,8 +27,11 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../syscall.h" -#include "syscall_extra.h" +#ifndef __NDS32_VH__ +#include "../syscall.h" +#include "syscall_extra.h" SYS_WRAPPER _getpid, SYS_getpid + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_gettimeofday.S b/libgloss/nds32/_gettimeofday.S index 85e2eae..adc5f68 100644 --- a/libgloss/nds32/_gettimeofday.S +++ b/libgloss/nds32/_gettimeofday.S @@ -27,8 +27,16 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../syscall.h" -#include "syscall_extra.h" +#ifdef __NDS32_VH__ + +#include "vh.h" +.extern _impure_ptr +TYPE3 _gettimeofday, VH_GETTIMEOFDAY +#else /* not __NDS32_VH__ */ +#include "../syscall.h" +#include "syscall_extra.h" SYS_WRAPPER _gettimeofday, SYS_gettimeofday + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_isatty.S b/libgloss/nds32/_isatty.S index bd30248..c90028a 100644 --- a/libgloss/nds32/_isatty.S +++ b/libgloss/nds32/_isatty.S @@ -27,8 +27,16 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../syscall.h" -#include "syscall_extra.h" +#ifdef __NDS32_VH__ + +#include "vh.h" +.extern _impure_ptr +TYPE0 _isatty, VH_ISATTY +#else /* not __NDS32_VH__ */ +#include "../syscall.h" +#include "syscall_extra.h" SYS_WRAPPER _isatty, SYS_isatty + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_kill.S b/libgloss/nds32/_kill.S index 4a040f6..69d8b41 100644 --- a/libgloss/nds32/_kill.S +++ b/libgloss/nds32/_kill.S @@ -27,8 +27,11 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../syscall.h" -#include "syscall_extra.h" +#ifndef __NDS32_VH__ +#include "../syscall.h" +#include "syscall_extra.h" SYS_WRAPPER _kill, SYS_kill + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_link.S b/libgloss/nds32/_link.S index cbcb759..15016fc 100644 --- a/libgloss/nds32/_link.S +++ b/libgloss/nds32/_link.S @@ -27,8 +27,10 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef __NDS32_VH__ + #include "../syscall.h" #include "syscall_extra.h" - - SYS_WRAPPER _link, SYS_link + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_lseek.S b/libgloss/nds32/_lseek.S index 86e2d31..c17e22f 100644 --- a/libgloss/nds32/_lseek.S +++ b/libgloss/nds32/_lseek.S @@ -27,8 +27,16 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../syscall.h" -#include "syscall_extra.h" +#ifdef __NDS32_VH__ + +#include "vh.h" +.extern _impure_ptr +TYPE1 _lseek, VH_LSEEK +#else /* not __NDS32_VH__ */ +#include "../syscall.h" +#include "syscall_extra.h" SYS_WRAPPER _lseek, SYS_lseek + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_open.S b/libgloss/nds32/_open.S index 6ef79cb..6c80ab0 100644 --- a/libgloss/nds32/_open.S +++ b/libgloss/nds32/_open.S @@ -27,8 +27,16 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../syscall.h" -#include "syscall_extra.h" +#ifdef __NDS32_VH__ + +#include "vh.h" +.extern _impure_ptr +TYPE1 _open, VH_OPEN +#else /* not __NDS32_VH__ */ +#include "../syscall.h" +#include "syscall_extra.h" SYS_WRAPPER _open, SYS_open + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_read.S b/libgloss/nds32/_read.S index ad15dd4..ca0c8af 100644 --- a/libgloss/nds32/_read.S +++ b/libgloss/nds32/_read.S @@ -27,8 +27,16 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../syscall.h" -#include "syscall_extra.h" +#ifdef __NDS32_VH__ + +#include "vh.h" +.extern _impure_ptr +TYPE1 _read, VH_READ +#else /* not __NDS32_VH__ */ +#include "../syscall.h" +#include "syscall_extra.h" SYS_WRAPPER _read, SYS_read + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_rename.S b/libgloss/nds32/_rename.S index 0781e3a..f91c1f6 100644 --- a/libgloss/nds32/_rename.S +++ b/libgloss/nds32/_rename.S @@ -27,8 +27,16 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../syscall.h" -#include "syscall_extra.h" +#ifdef __NDS32_VH__ + +#include "vh.h" +.extern _impure_ptr +TYPE1 _rename, VH_RENAME +#else /* not __NDS32_VH__ */ +#include "../syscall.h" +#include "syscall_extra.h" SYS_WRAPPER _rename, SYS_rename + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_stat.S b/libgloss/nds32/_stat.S index 105fda4..9bb23ce 100644 --- a/libgloss/nds32/_stat.S +++ b/libgloss/nds32/_stat.S @@ -27,8 +27,16 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../syscall.h" -#include "syscall_extra.h" +#ifdef __NDS32_VH__ + +#include "vh.h" +.extern _impure_ptr +TYPE1 _stat, VH_STAT +#else /* not __NDS32_VH__ */ +#include "../syscall.h" +#include "syscall_extra.h" SYS_WRAPPER _stat, SYS_stat + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_system.S b/libgloss/nds32/_system.S index 3422d86..bbd6a78 100644 --- a/libgloss/nds32/_system.S +++ b/libgloss/nds32/_system.S @@ -27,8 +27,16 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../syscall.h" -#include "syscall_extra.h" +#ifdef __NDS32_VH__ + +#include "vh.h" +.extern _impure_ptr +TYPE1 _system, VH_SYSTEM +#else /* not __NDS32_VH__ */ +#include "../syscall.h" +#include "syscall_extra.h" SYS_WRAPPER _system, SYS_system + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_time.S b/libgloss/nds32/_time.S index 811dd12..43c7aba 100644 --- a/libgloss/nds32/_time.S +++ b/libgloss/nds32/_time.S @@ -27,8 +27,10 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef __NDS32_VH__ + #include "../syscall.h" #include "syscall_extra.h" - - SYS_WRAPPER _time, SYS_time + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_times.S b/libgloss/nds32/_times.S index 2d21814..048de62 100644 --- a/libgloss/nds32/_times.S +++ b/libgloss/nds32/_times.S @@ -27,8 +27,10 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef __NDS32_VH__ + #include "../syscall.h" #include "syscall_extra.h" - - SYS_WRAPPER _times, SYS_times + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_unlink.S b/libgloss/nds32/_unlink.S index 77a62d6..ec251b5 100644 --- a/libgloss/nds32/_unlink.S +++ b/libgloss/nds32/_unlink.S @@ -27,8 +27,17 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../syscall.h" -#include "syscall_extra.h" +#ifdef __NDS32_VH__ + +#include "vh.h" +.extern _impure_ptr +TYPE1 _lseek, VH_LSEEK + +#else /* not __NDS32_VH__ */ +#include "../syscall.h" +#include "syscall_extra.h" SYS_WRAPPER _unlink, SYS_unlink + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_utime.S b/libgloss/nds32/_utime.S index 45af323..014aa1a 100644 --- a/libgloss/nds32/_utime.S +++ b/libgloss/nds32/_utime.S @@ -27,8 +27,10 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef __NDS32_VH__ + #include "../syscall.h" #include "syscall_extra.h" - - SYS_WRAPPER _utime, SYS_utime + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/_write.S b/libgloss/nds32/_write.S index 1b1752c..f0d8651 100644 --- a/libgloss/nds32/_write.S +++ b/libgloss/nds32/_write.S @@ -27,8 +27,16 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../syscall.h" -#include "syscall_extra.h" +#ifdef __NDS32_VH__ + +#include "vh.h" +.extern _impure_ptr +TYPE1 _write, VH_WRITE +#else /* not __NDS32_VH__ */ +#include "../syscall.h" +#include "syscall_extra.h" SYS_WRAPPER _write, SYS_write + +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/syscall_error_handler.S b/libgloss/nds32/syscall_error_handler.S index 9398c51..2b65c68 100644 --- a/libgloss/nds32/syscall_error_handler.S +++ b/libgloss/nds32/syscall_error_handler.S @@ -27,6 +27,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef __NDS32_VH__ + #include "../syscall.h" #include "syscall_extra.h" @@ -47,3 +49,4 @@ __syscall_error_handler: 1: ret .size __syscall_error_handler, .-__syscall_error_handler +#endif /* not __NDS32_VH__ */ diff --git a/libgloss/nds32/vh.h b/libgloss/nds32/vh.h new file mode 100644 index 0000000..4ee3e89 --- /dev/null +++ b/libgloss/nds32/vh.h @@ -0,0 +1,123 @@ +#ifndef _VH_H +#define _VH_H + +/* +BREAK #SWID definition: +0x00 – 0x1F: Free to use +0x20 – 0x1FF: Reserved for EX9 +0x0200 – 0x7EFF: Free to use +0x7F00 – 0x7FFF: Reserved for virtual hosting +*/ +/* These are #SWID defined for Virtual Hosting. */ +#define VH_FOPEN 0x7F00 +#define VH_FREOPEN 0x7F01 +#define VH_FCLOSE 0x7F02 +#define VH_FFLUSH 0x7F03 +#define VH_FREAD 0x7F04 +#define VH_FWRITE 0x7F05 +#define VH_FGETC 0x7F06 +#define VH_FGETS 0x7F07 +#define VH_FPUTC 0x7F08 +#define VH_FPUTS 0x7F09 +#define VH_UNGETC 0x7F0A +#define VH_FTELL 0x7F0B +#define VH_FSEEK 0x7F0C +#define VH_REWIND 0x7F0D +#define VH_CLEARERR 0x7F0E +#define VH_FEOF 0x7F0F +#define VH_FERROR 0x7F10 +#define VH_REMOVE 0x7F11 +#define VH_TMPFILE 0x7F12 +/* From here, define Low-level routines. */ +#define VH_EXIT 0x7F20 +#define VH_OPEN 0x7F21 +#define VH_CLOSE 0x7F22 +#define VH_READ 0x7F23 +#define VH_WRITE 0x7F24 +#define VH_LSEEK 0x7F25 +#define VH_UNLINK 0x7F26 +#define VH_RENAME 0x7F27 +#define VH_FSTAT 0x7F28 +#define VH_STAT 0x7F29 +#define VH_GETTIMEOFDAY 0x7F2A +#define VH_ISATTY 0x7F2B +#define VH_SYSTEM 0x7F2C +#define VH_GETERR 0x7F2D /* The method we get errno. */ + + +/* Define macros that generate assembly output. + Generate a System Call exception to notify GDB + to handle this virtual I/O routine. */ + +.macro TYPE0 name num +/* If r0 is not NULL(0), set errno. */ + .text + .global \name + .type \name, @function + .align 2 +\name: + BREAK \num /* Generate_Exception(Breakpoint); */ + bnez $r0, 1f /* Branch if success. + r0 value is not NULL(0). */ + BREAK VH_GETERR + l.w $r15, _impure_ptr + swi $r0, [$r15] /* Set errno. */ + move $r0, 0 /* Set return value as 0. */ +1: + ret + .size \name, .-\name +.endm + +.macro TYPE1 name num +/* If r0 is EOF(-1), set errno. */ + .text + .global \name + .type \name, @function + .align 2 +\name: + BREAK \num /* Generate_Exception(Breakpoint); */ + addi $r15, $r0, 1 + bnezs8 1f /* Branch if success. + r0 value is EOF(-1). */ + BREAK VH_GETERR + l.w $r15, _impure_ptr + swi $r0, [$r15] /* Set errno. */ + move $r0, -1 /* Set return value as -1. */ +1: + ret + .size \name, .-\name +.endm + +.macro TYPE2 name num +/* If r0 is less than r2, set errno. */ + .text + .global \name + .type \name, @function + .align 2 +\name: + BREAK \num /* Generate_Exception(Breakpoint); */ + slt $r15, $r0, $r2 /* If r15 is set, set errno. */ + beqzs8 1f /* Branch if success. + r15 is zero. */ + move $r4, $r0 /* Keep return value r0. */ + BREAK VH_GETERR + l.w $r15, _impure_ptr + swi $r0, [$r15] /* Set errno. */ + move $r0, $r4 /* Restore r0. */ +1: + ret + .size \name, .-\name +.endm + +.macro TYPE3 name num +/* No errors are defined. */ + .text + .global \name + .type \name, @function + .align 2 +\name: + BREAK \num /* Generate_Exception(Breakpoint); */ + ret + .size \name, .-\name +.endm +#endif /* _VH_H */ |