Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "D.Venkatasubramanian, Noida" <dvenkat@noida.hcltech.com>
To: "'Kazu Hirata'" <kazu@cs.umass.edu>,
	"'gdb-patches@sources.redhat.com'"
	<gdb-patches@sources.redhat.com>,
	"'newlib@sources.redhat.com'" <newlib@sources.redhat.com>
Cc: "D.Venkatasubramanian, Noida" <dvenkat@noida.hcltech.com>
Subject: RE: PATCH : H8300 Simulator File I/O Implementation
Date: Fri, 03 Jan 2003 08:30:00 -0000	[thread overview]
Message-ID: <E04CF3F88ACBD5119EFE00508BBB212106CF8106@exch-01.noida.hcltech.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1706 bytes --]

Hi All,

Based on my earlier mail:

http://sources.redhat.com/ml/gdb-patches/2002-12/msg00760.html

and subsequent ideas and suggestions from Kazu Hirata, I am 
submitting the modified patches.

Changes:
1) Comments included in each .S file.
2) An include directive which had unintentionally crept in last 
time has been removed.
3) A commented C statement in my earlier patch removed in 
simulator patch.

Regards,

Venky


2003-01-03  D.Venkatasubramanian <dvenkat@noida.hcltech.com>

	* compile.c (decode): Added code for some more magic traps.
	* compile.c (sim_resume): Added support for File I/O system
	calls through callback to host_system.
	System calls provided support for :
	open, read, write, lseek, close, stat, fstat
	Only basic support for stat and fstat.


2003-01-03   D.Venkatasubramanian <dvenkat@noida.hcltech.com>

	* /libc/sys/h8300hms/syscalls.c: Removed functions _open, 
	_lseek, _close, _stat, _fstat.
	* /libc/sys/h8300hms/read.c: Removed.
	* /libc/sys/h8300hms/write.c: Removed.
	* /libc/sys/h8300hms/open.S: Hand coded assembly for 
	implementing _open removed from syscalls.c.
	* /libc/sys/h8300hms/read.S: Hand coded assembly for 
	implementing _open removed from read.c.
	* /libc/sys/h8300hms/write.S: Hand coded assembly for 
	implementing _open removed from write.c.
	* /libc/sys/h8300hms/lseek.S: Hand coded assembly for 
	implementing _open removed from syscalls.c.
	* /libc/sys/h8300hms/close.S: Hand coded assembly for 
	implementing _open removed from syscalls.c.
	* /libc/sys/h8300hms/fstat.S: Hand coded assembly for 
	implementing _open removed from syscalls.c.
	* /libc/sys/h8300hms/stat.S: Hand coded assembly for 
	implementing _open removed from syscalls.c.


[-- Attachment #2: ChangeLog.txt --]
[-- Type: text/plain, Size: 1310 bytes --]

2003-01-03  D.Venkatasubramanian <dvenkat@noida.hcltech.com>

	* compile.c (decode): Added code for some more magic traps.
	* compile.c (sim_resume): Added support for File I/O system
	calls through callback to host_system.
	System calls provided support for :
	open, read, write, lseek, close, stat, fstat
	Only basic support for stat and fstat.


2003-01-03   D.Venkatasubramanian <dvenkat@noida.hcltech.com>

	* /libc/sys/h8300hms/syscalls.c: Removed functions _open, 
	_lseek, _close, _stat, _fstat.
	* /libc/sys/h8300hms/read.c: Removed.
	* /libc/sys/h8300hms/write.c: Removed.
	* /libc/sys/h8300hms/open.S: Hand coded assembly for 
	implementing _open removed from syscalls.c.
	* /libc/sys/h8300hms/read.S: Hand coded assembly for 
	implementing _open removed from read.c.
	* /libc/sys/h8300hms/write.S: Hand coded assembly for 
	implementing _open removed from write.c.
	* /libc/sys/h8300hms/lseek.S: Hand coded assembly for 
	implementing _open removed from syscalls.c.
	* /libc/sys/h8300hms/close.S: Hand coded assembly for 
	implementing _open removed from syscalls.c.
	* /libc/sys/h8300hms/fstat.S: Hand coded assembly for 
	implementing _open removed from syscalls.c.
	* /libc/sys/h8300hms/stat.S: Hand coded assembly for 
	implementing _open removed from syscalls.c.

[-- Attachment #3: close.S --]
[-- Type: application/octet-stream, Size: 342 bytes --]

;int close(int fd);
;Integer arguments have to be zero extended.

#if defined(__H8300H__)
	.h8300h
#endif
#if defined(__H8300S__)
	.h8300s
#endif

	.section .text
	.align 2
	.global __close
__close:
#if defined(__H8300H__) || defined(__H8300S__)
#if __INT_MAX__ == 32767
	extu.l er0
#endif
#endif
	jsr @@0xc9
	rts
	.end

[-- Attachment #4: fstat.S --]
[-- Type: application/octet-stream, Size: 376 bytes --]

;int fstat(int filedes, struct stat *buf);
;Integer arguments have to be zero extended.

#if defined(__H8300H__)
	.h8300h
#endif
#if defined(__H8300S__)
	.h8300s
#endif

	.section .text
	.align 2
	.global __fstat
__fstat:
#if defined(__H8300H__) || defined(__H8300S__)
#if __INT_MAX__ == 32767
	extu.l	er0
#endif
#endif
	jsr @@0xcb
	rts
	.end
									

[-- Attachment #5: lseek.S --]
[-- Type: application/octet-stream, Size: 387 bytes --]

;off_t lseek(int fildes, off_t offset, int whence);
;Integer arguments have to be zero extended.

#if defined(__H8300H__)
	.h8300h
#endif
#if defined(__H8300S__)
	.h8300s
#endif

	.section .text
	.align 2
	.global __lseek
__lseek:
#if defined(__H8300H__) || defined(__H8300S__)
#if __INT_MAX__ == 32767
	extu.l er0
	extu.l er2
#endif
#endif
	jsr @@0xc8
	rts
	.end

[-- Attachment #6: newlib_patch.txt --]
[-- Type: text/plain, Size: 2277 bytes --]

*** newlib/libc/sys/h8300hms/syscalls.c.original	Sat Dec 28 16:37:10 2002
--- newlib/libc/sys/h8300hms/syscalls.c.modified	Fri Jan  3 11:10:01 2003
***************
*** 1,47 ****
  /* Operating system stubs, set up for the MRI simulator */
  
  #include <_ansi.h>
- #include <sys/types.h>
- #include <sys/stat.h>
  #include <errno.h>
  
- 
- int _DEFUN(_lseek,(file, ptr, dir),
- 	  int file _AND
- 	  int ptr _AND
- 	  int dir)
- {
-   return 0;
- }
- 
- int _DEFUN(_close,(file),
- 	  int file)
- {
-   return -1;
- }
- 
  int isatty(file)
       int file;
  {
    return 1;
  }
  
- int _DEFUN(_fstat,(file, st),
- 	  int file _AND
- 	  struct stat *st)
- {
-   st->st_mode = S_IFCHR;
-   return 0;
- }
- 
- int
- _open (path, flags)
-      const char *path;
-      int flags;
- {
-   return 0;
- }
- 
  int
  _unlink (path)
       const char *path;
--- 1,14 ----
*** newlib/libc/sys/h8300hms/Makefile.in.original	Mon Dec 30 16:07:12 2002
--- newlib/libc/sys/h8300hms/Makefile.in.modified	Tue Dec 31 14:29:23 2002
*************** INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLA
*** 89,95 ****
  
  noinst_LIBRARIES = lib.a
  
! lib_a_SOURCES = syscalls.c write.c _exit.c read.s sbrk.c misc.c crt1.c
  
  ACLOCAL_AMFLAGS = -I ../../..
  CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
--- 89,96 ----
  
  noinst_LIBRARIES = lib.a
  
! lib_a_SOURCES = syscalls.c open.s read.s write.s lseek.s close.s stat.s \
! fstat.s _exit.c sbrk.c misc.c crt1.c
  
  ACLOCAL_AMFLAGS = -I ../../..
  CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
*************** DEFS = @DEFS@ -I. -I$(srcdir) 
*** 103,109 ****
  CPPFLAGS = @CPPFLAGS@
  LIBS = @LIBS@
  lib_a_LIBADD = 
! lib_a_OBJECTS =  syscalls.o write.o _exit.o read.o sbrk.o misc.o crt1.o
  CFLAGS = @CFLAGS@
  COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
  CCLD = $(CC)
--- 104,111 ----
  CPPFLAGS = @CPPFLAGS@
  LIBS = @LIBS@
  lib_a_LIBADD = 
! lib_a_OBJECTS = syscalls.o open.o read.o write.o lseek.o close.o stat.o \
! fstat.o _exit.o sbrk.o misc.o crt1.o
  CFLAGS = @CFLAGS@
  COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
  CCLD = $(CC)

[-- Attachment #7: open.S --]
[-- Type: application/octet-stream, Size: 346 bytes --]

;int open(const char *pathname, int flags);
;Integer arguments have to be zero extended.
;The second argument is taken from the stack,
;hence it is not zero extended here.

#if defined(__H8300H__)
	.h8300h
#endif
#if defined(__H8300S__)
	.h8300s
#endif

	.section .text
	.align 2
	.global __open
__open:
	jsr @@0xc5
	rts
	.end

[-- Attachment #8: read.S --]
[-- Type: application/octet-stream, Size: 380 bytes --]

;ssize_t read(int fd, void *buf, size_t count);
;Integer arguments have to be zero extended.

#if defined(__H8300H__)
	.h8300h
#endif
#if defined(__H8300S__)
	.h8300s
#endif

	.section .text
	.align 2
	.global __read
__read:
#if defined(__H8300H__) || defined(__H8300S__)
#if __INT_MAX__ == 32767
	extu.l  er0
#endif
#endif
	jsr @@0xc6
	rts
	.end
									

[-- Attachment #9: simulator_patch.txt --]
[-- Type: text/plain, Size: 11411 bytes --]

*** sim/h8300/compile.c.original	Thu Dec 26 17:15:41 2002
--- sim/h8300/compile.c.modified	Fri Jan  3 11:07:21 2003
***************
*** 35,40 ****
--- 35,42 ----
  #include "gdb/callback.h"
  #include "gdb/remote-sim.h"
  #include "gdb/sim-h8300.h"
+ #include "sys/stat.h"
+ #include "sys/types.h"
  
  #ifndef SIGTRAP
  # define SIGTRAP 5
*************** decode (addr, data, dst)
*** 452,461 ****
  
  		  if (dst->opcode == O (O_JSR, SB))
  		    {
! 		      if (dst->src.literal == 0xc4)
  			{
! 			  dst->opcode = O (O_SYSCALL, SB);
  			}
  		    }
  
  		  dst->next_pc = addr + len / 2;
--- 454,484 ----
  
  		  if (dst->opcode == O (O_JSR, SB))
  		    {
! 		      switch (dst->src.literal)
  			{
! 			case 0xc5:
! 			  dst->opcode = O (O_SYS_OPEN, SB);
! 			  break;
! 			case 0xc6:
! 			  dst->opcode = O (O_SYS_READ, SB);
! 			  break;
! 			case 0xc7:
! 			  dst->opcode = O (O_SYS_WRITE, SB);
! 			  break;
! 			case 0xc8:
! 			  dst->opcode = O (O_SYS_LSEEK, SB);
! 			  break;
! 			case 0xc9:
! 			  dst->opcode = O (O_SYS_CLOSE, SB);
! 			  break;
! 			case 0xca:
! 			  dst->opcode = O (O_SYS_STAT, SB);
! 			  break;
! 			case 0xcb:
! 			  dst->opcode = O (O_SYS_FSTAT, SB);
! 			  break;
  			}
+ 		      /* End of Processing for system calls.  */
  		    }
  
  		  dst->next_pc = addr + len / 2;
*************** sim_resume (sd, step, siggnal)
*** 1392,1403 ****
  	    goto condtrue;
  	  goto next;
  
! 	case O (O_SYSCALL, SB):
  	  {
! 	    char c = cpu.regs[2];
! 	    sim_callback->write_stdout (sim_callback, &c, 1);
  	  }
  	  goto next;
  
  	  ONOT (O_NOT, rd = ~rd; v = 0;);
  	  OSHIFTS (O_SHLL,
--- 1415,1703 ----
  	    goto condtrue;
  	  goto next;
  
! 	  /* System call processing starts.  */
! 	case O (O_SYS_OPEN, SB):
  	  {
! 	    int len = 0;	/* Length of filename.  */
! 	    char *filename;	/* Filename would go here.  */
! 	    char temp_char;	/* Temporary character */
! 	    int mode = 0;	/* Mode bits for the file.  */
! 	    int open_return;	/* Return value of open, file descriptor.  */
! 	    int i;		/* Loop counter */
! 	    int filename_ptr;	/* Pointer to filename in cpu memory.  */
! 
! 	    /* Setting filename_ptr to first argument of open.  */
! 	    filename_ptr = h8300hmode ? GET_L_REG (0) : GET_W_REG (0);
! 
! 	    /* Trying to get mode.  */
! 	    if (h8300hmode || h8300smode)
! 	      {
! 		mode = GET_MEMORY_L (cpu.regs[7] + 4);
! 	      }
! 	    else
! 	      {
! 		mode = GET_MEMORY_W (cpu.regs[7] + 2);
! 	      }
! 
! 	    /* Trying to find the length of the filename.  */
! 	    temp_char = GET_MEMORY_B (cpu.regs[0]);
! 
! 	    len = 1;
! 	    while (temp_char != '\0')
! 	      {
! 		temp_char = GET_MEMORY_B (filename_ptr + len);
! 		len++;
! 	      }
! 
! 	    /* Allocating space for the filename.  */
! 	    filename = (char *) malloc (sizeof (char) * len);
! 
! 	    /* String copying the filename from memory.  */
! 	    for (i = 0; i < len; i++)
! 	      {
! 		temp_char = GET_MEMORY_B (filename_ptr + i);
! 		filename[i] = temp_char;
! 	      }
! 
! 	    /* Callback to open and return the file descriptor.  */
! 	    open_return = sim_callback->open (sim_callback, filename, mode);
! 
! 	    /* Return value in register 0.  */
! 	    cpu.regs[0] = open_return;
! 
! 	    /* Freeing memory used for filename. */
! 	    free (filename);
! 	  }
! 	  goto next;
! 
! 	case O (O_SYS_READ, SB):
! 	  {
! 	    char *char_ptr;	/* Where characters read would be stored.  */
! 	    int fd;		/* File descriptor */
! 	    int buf_size;	/* BUF_SIZE parameter in read.  */
! 	    int i = 0;		/* Temporary Loop counter */
! 	    int read_return = 0;	/* Return value from callback to
! 					   read.  */
! 
! 	    fd = h8300hmode ? GET_L_REG (0) : GET_W_REG (0);
! 	    buf_size = h8300hmode ? GET_L_REG (2) : GET_W_REG (2);
! 
! 	    char_ptr = (char *) malloc (sizeof (char) * buf_size);
! 
! 	    /* Callback to read and return the no. of characters read.  */
! 	    read_return =
! 	      sim_callback->read (sim_callback, fd, char_ptr, buf_size);
! 
! 	    /* The characters read are stored in cpu memory.  */
! 	    for (i = 0; i < buf_size; i++)
! 	      {
! 		SET_MEMORY_B ((cpu.regs[1] + (sizeof (char) * i)),
! 			      *(char_ptr + (sizeof (char) * i)));
! 	      }
! 
! 	    /* Return value in Register 0.  */
! 	    cpu.regs[0] = read_return;
! 
! 	    /* Freeing memory used as buffer.  */
! 	    free (char_ptr);
! 	  }
! 	  goto next;
! 
! 	case O (O_SYS_WRITE, SB):
! 	  {
! 	    int fd;		/* File descriptor */
! 	    char temp_char;	/* Temporary character */
! 	    int len;		/* Length of write, Parameter II to write.  */
! 	    int char_ptr;	/* Character Pointer, Parameter I of write.  */
! 	    char *ptr;		/* Where characters to be written are stored. 
! 				 */
! 	    int write_return;	/* Return value from callback to write.  */
! 	    int i = 0;		/* Loop counter */
! 
! 	    fd = h8300hmode ? GET_L_REG (0) : GET_W_REG (0);
! 	    char_ptr = h8300hmode ? GET_L_REG (1) : GET_W_REG (1);
! 	    len = h8300hmode ? GET_L_REG (2) : GET_W_REG (2);
! 
! 	    /* Allocating space for the characters to be written.  */
! 	    ptr = (char *) malloc (sizeof (char) * len);
! 
! 	    /* Fetching the characters from cpu memory.  */
! 	    for (i = 0; i < len; i++)
! 	      {
! 		temp_char = GET_MEMORY_B (char_ptr + i);
! 		ptr[i] = temp_char;
! 	      }
! 
! 	    /* Callback write and return the no. of characters written.  */
! 	    write_return = sim_callback->write (sim_callback, fd, ptr, len);
! 
! 	    /* Return value in Register 0.  */
! 	    cpu.regs[0] = write_return;
! 
! 	    /* Freeing memory used as buffer.  */
! 	    free (ptr);
! 	  }
! 	  goto next;
! 
! 	case O (O_SYS_LSEEK, SB):
! 	  {
! 	    int fd;		/* File descriptor */
! 	    int offset;		/* Offset */
! 	    int origin;		/* Origin */
! 	    int lseek_return;	/* Return value from callback to lseek.  */
! 
! 	    fd = h8300hmode ? GET_L_REG (0) : GET_W_REG (0);
! 	    offset = h8300hmode ? GET_L_REG (1) : GET_W_REG (1);
! 	    origin = h8300hmode ? GET_L_REG (2) : GET_W_REG (2);
! 
! 	    /* Callback lseek and return offset.  */
! 	    lseek_return =
! 	      sim_callback->lseek (sim_callback, fd, offset, origin);
! 
! 	    /* Return value in register 0.  */
! 	    cpu.regs[0] = lseek_return;
! 	  }
! 	  goto next;
! 
! 	case O (O_SYS_CLOSE, SB):
! 	  {
! 	    int fd;		/* File descriptor */
! 	    int close_return;	/* Return value from callback to close.  */
! 
! 	    fd = h8300hmode ? GET_L_REG (0) : GET_W_REG (0);
! 
! 	    /* Callback close and return.  */
! 	    close_return = sim_callback->close (sim_callback, fd);
! 
! 	    /* Return value in register 0.  */
! 	    cpu.regs[0] = close_return;
! 	  }
! 	  goto next;
! 
! 	case O (O_SYS_FSTAT, SB):
! 	  {
! 	    int fd;		/* File descriptor */
! 	    struct stat stat_rec;	/* Stat record */
! 	    int fstat_return;	/* Return value from callback to stat.  */
! 	    int stat_ptr;	/* Pointer to stat record.  */
! 	    char *temp_stat_ptr;	/* Temporary stat_rec pointer.  */
! 
! 	    fd = h8300hmode ? GET_L_REG (0) : GET_W_REG (0);
! 
! 	    /* Setting stat_ptr to second argument of stat.  */
! 	    stat_ptr = h8300hmode ? GET_L_REG (1) : GET_W_REG (1);
! 
! 	    /* Callback stat and return.  */
! 	    fstat_return = sim_callback->fstat (sim_callback, fd, &stat_rec);
! 
! 	    /* Have stat_ptr point to starting of stat_rec.  */
! 	    temp_stat_ptr = (char *) (&stat_rec);
! 
! 	    /* Setting up the stat structure returned.  */
! 	    SET_MEMORY_W (stat_ptr, stat_rec.st_dev);
! 	    stat_ptr += 2;
! 	    SET_MEMORY_W (stat_ptr, stat_rec.st_ino);
! 	    stat_ptr += 2;
! 	    SET_MEMORY_L (stat_ptr, stat_rec.st_mode);
! 	    stat_ptr += 4;
! 	    SET_MEMORY_W (stat_ptr, stat_rec.st_nlink);
! 	    stat_ptr += 2;
! 	    SET_MEMORY_W (stat_ptr, stat_rec.st_uid);
! 	    stat_ptr += 2;
! 	    SET_MEMORY_W (stat_ptr, stat_rec.st_gid);
! 	    stat_ptr += 2;
! 	    SET_MEMORY_W (stat_ptr, stat_rec.st_rdev);
! 	    stat_ptr += 2;
! 	    SET_MEMORY_L (stat_ptr, stat_rec.st_size);
! 	    stat_ptr += 4;
! 	    SET_MEMORY_L (stat_ptr, stat_rec.st_atime);
! 	    stat_ptr += 8;
! 	    SET_MEMORY_L (stat_ptr, stat_rec.st_mtime);
! 	    stat_ptr += 8;
! 	    SET_MEMORY_L (stat_ptr, stat_rec.st_ctime);
! 
! 	    /* Return value in register 0.  */
! 	    cpu.regs[0] = fstat_return;
! 	  }
! 	  goto next;
! 
! 	case O (O_SYS_STAT, SB):
! 	  {
! 	    int len = 0;	/* Length of filename.  */
! 	    char *filename;	/* Filename would go here.  */
! 	    char temp_char;	/* Temporary character */
! 	    int filename_ptr;	/* Pointer to filename in cpu memory.  */
! 	    struct stat stat_rec;	/* Stat record */
! 	    int stat_return;	/* Return value from callback to stat */
! 	    int stat_ptr;	/* Pointer to stat record.  */
! 	    char *temp_stat_ptr;	/* Temporary stat_rec pointer.  */
! 	    int i = 0;		/* Loop Counter */
! 
! 	    /* Setting filename_ptr to first argument of open.  */
! 	    filename_ptr = h8300hmode ? GET_L_REG (0) : GET_W_REG (0);
! 
! 	    /* Trying to find the length of the filename.  */
! 	    temp_char = GET_MEMORY_B (cpu.regs[0]);
! 
! 	    len = 1;
! 	    while (temp_char != '\0')
! 	      {
! 		temp_char = GET_MEMORY_B (filename_ptr + len);
! 		len++;
! 	      }
! 
! 	    /* Allocating space for the filename.  */
! 	    filename = (char *) malloc (sizeof (char) * len);
! 
! 	    /* String copying the filename from memory.  */
! 	    for (i = 0; i < len; i++)
! 	      {
! 		temp_char = GET_MEMORY_B (filename_ptr + i);
! 		filename[i] = temp_char;
! 	      }
! 
! 	    /* Setting stat_ptr to second argument of stat.  */
! 	    /* stat_ptr = cpu.regs[1]; */
! 	    stat_ptr = h8300hmode ? GET_L_REG (1) : GET_W_REG (1);
! 
! 	    /* Callback stat and return.  */
! 	    stat_return =
! 	      sim_callback->stat (sim_callback, filename, &stat_rec);
! 
! 	    /* Have stat_ptr point to starting of stat_rec.  */
! 	    temp_stat_ptr = (char *) (&stat_rec);
! 
! 	    /* Freeing memory used for filename.  */
! 	    free (filename);
! 
! 	    /* Setting up the stat structure returned.  */
! 	    SET_MEMORY_W (stat_ptr, stat_rec.st_dev);
! 	    stat_ptr += 2;
! 	    SET_MEMORY_W (stat_ptr, stat_rec.st_ino);
! 	    stat_ptr += 2;
! 	    SET_MEMORY_L (stat_ptr, stat_rec.st_mode);
! 	    stat_ptr += 4;
! 	    SET_MEMORY_W (stat_ptr, stat_rec.st_nlink);
! 	    stat_ptr += 2;
! 	    SET_MEMORY_W (stat_ptr, stat_rec.st_uid);
! 	    stat_ptr += 2;
! 	    SET_MEMORY_W (stat_ptr, stat_rec.st_gid);
! 	    stat_ptr += 2;
! 	    SET_MEMORY_W (stat_ptr, stat_rec.st_rdev);
! 	    stat_ptr += 2;
! 	    SET_MEMORY_L (stat_ptr, stat_rec.st_size);
! 	    stat_ptr += 4;
! 	    SET_MEMORY_L (stat_ptr, stat_rec.st_atime);
! 	    stat_ptr += 8;
! 	    SET_MEMORY_L (stat_ptr, stat_rec.st_mtime);
! 	    stat_ptr += 8;
! 	    SET_MEMORY_L (stat_ptr, stat_rec.st_ctime);
! 
! 	    /* Return value in register 0.  */
! 	    cpu.regs[0] = stat_return;
  	  }
  	  goto next;
+ 	  /* End of system call processing.  */
  
  	  ONOT (O_NOT, rd = ~rd; v = 0;);
  	  OSHIFTS (O_SHLL,

[-- Attachment #10: stat.S --]
[-- Type: application/octet-stream, Size: 234 bytes --]

;int stat(const char *file_name, struct stat *buf);

#if defined(__H8300H__)
	.h8300h
#endif
#if defined(__H8300S__)
	.h8300s
#endif

	.section .text
	.align 2
	.global __stat
__stat:
	jsr @@0xca
	rts
	.end
									

[-- Attachment #11: write.S --]
[-- Type: application/octet-stream, Size: 379 bytes --]

;ssize_t write(int fd, const void *buf, size_t count);
;Integer arguments have to be zero extended.

#if defined(__H8300H__)
	.h8300h
#endif

#if defined(__H8300S__)
	.h8300s
#endif

	.section .text
	.align 2
	.global __write
__write:
#if defined(__H8300H__) || defined(__H8300S__)
#if __INT_MAX__ == 32767
	extu.l	er0
#endif
#endif
	jsr @@0xc7
	rts
	.end

             reply	other threads:[~2003-01-03  8:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-03  8:30 D.Venkatasubramanian, Noida [this message]
2003-01-07 22:00 ` Kazu Hirata
2003-01-07 23:08 ` Andrew Cagney
  -- strict thread matches above, loose matches on Subject: below --
2003-01-14  4:56 D.Venkatasubramanian, Noida
2003-01-08  5:08 D.Venkatasubramanian, Noida
2002-12-31  2:00 D.Venkatasubramanian, Noida
2002-12-31  4:42 ` Kazu Hirata
2002-12-26 10:12 D.Venkatasubramanian, Noida
2002-12-26  4:38 D.Venkatasubramanian, Noida
2002-12-23 22:59 D.Venkatasubramanian, Noida
2002-12-24  6:51 ` Kazu Hirata
2002-12-02  3:45 D.Venkatasubramanian, Noida
2002-11-29 21:31 D.Venkatasubramanian, Noida
2002-11-30 10:01 ` Kazu Hirata
2003-03-04 16:08   ` Andrew Cagney
2003-03-04 16:33     ` Kazu Hirata

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E04CF3F88ACBD5119EFE00508BBB212106CF8106@exch-01.noida.hcltech.com \
    --to=dvenkat@noida.hcltech.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kazu@cs.umass.edu \
    --cc=newlib@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox