]> sourceware.org Git - newlib-cygwin.git/commitdiff
* rl78/crt0.S: Initialize .saddr. Avoid using SEL.
authorDJ Delorie <dj@redhat.com>
Fri, 16 Jan 2015 22:21:34 +0000 (22:21 +0000)
committerDJ Delorie <dj@redhat.com>
Fri, 16 Jan 2015 22:21:34 +0000 (22:21 +0000)
* rl78/rl78-sim.ld: Add .saddr/.frodata section.
* rl78/rl78.ld: Likewise.
* rl78/rl78-sim.ld: Make room for virtual register banks.
* rl78/rl78.ld: Likewise.

* rl78/vregs.h: New.
* rl78-sys.h: Use it.
* rl78/swrite.S: New.
* rl78/Makefile.in: Build it.
* rl78/write.c: Use it.

libgloss/ChangeLog
libgloss/rl78/Makefile.in
libgloss/rl78/crt0.S
libgloss/rl78/rl78-sim.ld
libgloss/rl78/rl78-sys.h
libgloss/rl78/rl78.ld
libgloss/rl78/write.c

index 964294c21b7392736c889e795665f8b644915b6f..d9aa2b1c5640093f5b2bfec036c1393a6466497f 100644 (file)
@@ -1,3 +1,17 @@
+2015-01-15  DJ Delorie  <dj@redhat.com>
+
+       * rl78/crt0.S: Initialize .saddr.  Avoid using SEL.
+       * rl78/rl78-sim.ld: Add .saddr/.frodata section.
+       * rl78/rl78.ld: Likewise.
+       * rl78/rl78-sim.ld: Make room for virtual register banks.
+       * rl78/rl78.ld: Likewise.
+
+       * rl78/vregs.h: New.
+       * rl78-sys.h: Use it.
+       * rl78/swrite.S: New.
+       * rl78/Makefile.in: Build it.
+       * rl78/write.c: Use it.
+
 2015-01-14  Stefan Wallentowitz  <stefan.wallentowitz@tum.de>
 
        * or1k/include/or1k-sprs.h: New auto-generated header file.
index 87a0e251ecf5e4c5befa8b82e3a0bbc09f815773..4662d45cba797752560385ce00f086c4997a2909 100644 (file)
@@ -67,6 +67,7 @@ SIM_OBJS = \
        close.o \
        read.o \
        write.o \
+       swrite.o \
        lseek.o \
        unlink.o \
        getpid.o \
index d5a07df90a55d210ce66d824f3c8a9de4b6b9035..fbba093a3d6bfcc9a7fb174553e34970cb083657 100644 (file)
@@ -147,55 +147,45 @@ _start:
 
 ;; block move to initialize .data
 
-       ;; we're copying from 00:[_romdatastart] to 0F:[_datastart]
-       ;; and our data is not in the mirrored area.
        mov     es, #0
-
-       sel     rb0             ; bank 0
-       movw    hl, #__datastart
-       movw    de, #__romdatastart
-       sel     rb1             ; bank 1
-       movw    ax, #__romdatacopysize
-       shrw    ax,1
-1:
+       movw    bc, #__romdatacopysize
+1:     
+       movw    ax, bc
        cmpw    ax, #0
        bz      $1f
-       decw    ax
-       sel     rb0             ; bank 0
-       movw    ax, es:[de]
-       movw    [hl], ax
-       incw    de
-       incw    de
-       incw    hl
-       incw    hl
-       sel     rb1
+       decw    bc
+       decw    bc
+       movw    ax, es:__romdatastart[bc]
+       movw    __datastart[bc], ax
        br      $1b
-1:
-       sel     rb0             ; bank 0
+1:     
+       
+       mov     es, #0
+       movw    bc, #__romsaddrcopysize
+1:     
+       movw    ax, bc
+       cmpw    ax, #0
+       bz      $1f
+       decw    bc
+       decw    bc
+       movw    ax, es:__romsaddrstart[bc]
+       movw    __saddrstart[bc], ax
+       br      $1b
+1:     
 
 
 ;; block fill to .bss
 
-       sel     rb0             ; bank 0
-       movw    hl, #__bssstart
+       movw    bc, #__bsssize
        movw    ax, #0
-       sel     rb1             ; bank 1
-       movw    ax, #__bsssize
-       shrw    ax,1
-1:
-       cmpw    ax, #0
+1:     
+       cmpw    ax, bc
        bz      $1f
-       decw    ax
-       sel     rb0             ; bank 0
-       movw    [hl], ax
-       incw    hl
-       incw    hl
-       sel     rb1
+       movw    __bssstart[bc], ax
+       decw    bc
+       decw    bc
        br      $1b
-1:
-       sel     rb0             ; bank 0
-
-
+1:     
 
        call    !!__rl78_init
 
index f69fb95d54d9d8de68f0c167ab49c2461a59b7ef..f54105dbf933cbf2a550937a880a3cdd023f28d1 100644 (file)
@@ -43,8 +43,10 @@ MEMORY {
        IVEC (r)  : ORIGIN = 0x00004, LENGTH = 0x0007c
        OPT (r)   : ORIGIN = 0x000c0, LENGTH = 0x00004
        ROM (r)   : ORIGIN = 0x000d8, LENGTH = 0x7ff28
-       RAM (w)   : ORIGIN = 0xf8000, LENGTH = 0x07ee0
-       STACK (w) : ORIGIN = 0xffee0, LENGTH = 0x00002
+/* The G10 variant needs to use RAM for virtual registers.  */
+       RAM (w)   : ORIGIN = 0xf8000, LENGTH = 0x07e20
+       STACK (w) : ORIGIN = 0xffe20, LENGTH = 0x00002
+       SADDR (w) : ORIGIN = 0xffe20, LENGTH = 0x000a0
 }
 
 SECTIONS
@@ -125,6 +127,15 @@ SECTIONS
     PROVIDE (__stack = .);
     *(.stack)
   }
+  
+  .saddr : {
+    . = ALIGN(2);
+    PROVIDE (__saddrstart = .);
+    *(.saddr)
+    . = ALIGN(2);
+  } >SADDR AT>ROM
+  PROVIDE(__romsaddrstart = LOADADDR(.saddr));
+  PROVIDE (__romsaddrcopysize = SIZEOF(.saddr));
 
   .rodata (MAX(__romdatastart + __romdatacopysize, 0x1000)) : {
     . = ALIGN(2);
@@ -169,6 +180,10 @@ SECTIONS
     KEEP (*(.dtors))
   } > ROM
 
+  .frodata : {
+    *(.frodata)
+  } > ROM
+
   .text           :
   {
     PROVIDE (_start = .);
@@ -210,7 +225,7 @@ SECTIONS
   /* DWARF 2 */
   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
-  .debug_line     0 : { *(.debug_line) }
+  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end ) }
   .debug_frame    0 : { *(.debug_frame) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
index 281dad07f1361815ba8308e1333f91c4f098dd4f..a51e6fcdc1c929ce49f75b80d36cc4bbe82f6e01 100644 (file)
@@ -31,23 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
 #include "syscall.h"
-
-r8     =       0xffef0
-r9     =       0xffef1
-r10    =       0xffef2
-r11    =       0xffef3
-r12    =       0xffef4
-r13    =       0xffef5
-r14    =       0xffef6
-r15    =       0xffef7
-r16    =       0xffee8
-r17    =       0xffee9
-r18    =       0xffeea
-r19    =       0xffeeb
-r20    =       0xffeec
-r21    =       0xffeed
-r22    =       0xffeee
-r23    =       0xffeef
+#include "vregs.h"
 
 #define SYS__exit  SYS_exit
 
index f062e2c904779760ef003cf2903059535f71361b..ab137f50f089039b91f68cbea97dd6354415fadf 100644 (file)
@@ -43,8 +43,10 @@ MEMORY {
        IVEC (r)  : ORIGIN = 0x00004, LENGTH = 0x0007c
        OPT (r)   : ORIGIN = 0x000c0, LENGTH = 0x00004
        ROM (r)   : ORIGIN = 0x000d8, LENGTH = 0x0ff28
-       RAM (w)   : ORIGIN = 0xfef00, LENGTH = 0x00fe0
-       STACK (w) : ORIGIN = 0xffee0, LENGTH = 0x00002
+/* The G10 variant needs to use RAM for virtual registers.  */
+       RAM (w)   : ORIGIN = 0xfef00, LENGTH = 0x00f20
+       STACK (w) : ORIGIN = 0xffe20, LENGTH = 0x00002
+       SADDR (w) : ORIGIN = 0xffe20, LENGTH = 0x000a0
 }
 
 SECTIONS
@@ -126,6 +128,15 @@ SECTIONS
     *(.stack)
   }
 
+  .saddr : {
+    . = ALIGN(2);
+    PROVIDE (__saddrstart = .);
+    *(.saddr)
+    . = ALIGN(2);
+  } >SADDR AT>ROM
+  PROVIDE(__romsaddrstart = LOADADDR(.saddr));
+  PROVIDE (__romsaddrcopysize = SIZEOF(.saddr));
+
   .rodata (MAX(__romdatastart + __romdatacopysize, 0x2000)) : {
     . = ALIGN(2);
     *(.plt)
@@ -169,6 +180,10 @@ SECTIONS
     KEEP (*(.dtors))
   } > ROM
 
+  .frodata : {
+    *(.frodata)
+  } > ROM
+
   .text           :
   {
     PROVIDE (_start = .);
@@ -210,7 +225,7 @@ SECTIONS
   /* DWARF 2 */
   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
-  .debug_line     0 : { *(.debug_line) }
+  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end ) }
   .debug_frame    0 : { *(.debug_frame) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
index 2adeb94f1b783945bca7b46c58df4537785d3961..0b42220783b9bda51f83b3ec468b3ad22b71886f 100644 (file)
@@ -85,11 +85,17 @@ tputc (char c)
   SDR00 = c;
 }
 
+/* defaults to 0 unless open() is linked in */
+int _open_present;
+
 int
 _write(int fd, char *ptr, int len)
 {
   int rv = len;
 
+  if (_open_present && fd > 2)
+    return _SYS_write (fd, ptr, len);
+
   if (!initted)
     init_uart0 ();
 
This page took 0.049478 seconds and 5 git commands to generate.