Attempt to restore with a newer GCC xisop-restore-branch
authorMatthew Mondor <mmondor@pulsar-zone.net>
Thu, 10 Sep 2015 14:39:39 +0000 (10:39 -0400)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Thu, 10 Sep 2015 14:39:39 +0000 (10:39 -0400)
Xisop/src/common/kernel/main.c
Xisop/src/config.h
Xisop/src/ports/amiga/boot/bootf/bootf_s.s
Xisop/src/ports/amiga/boot/config.h
Xisop/src/ports/amiga/boot/init.c
Xisop/src/ports/amiga/support_s.s
Xisop/src/processors/m68k/support.s

index 98be04c..2fed4d1 100644 (file)
@@ -173,6 +173,7 @@ void xisop_init(void)
      * probably means that the problem is the the xisop kernel size and boot
      * loader which need adjusting.
      */
+#ifdef noaue
     {
        register int i;
 
@@ -183,12 +184,15 @@ void xisop_init(void)
                        memcmp, memhash32, TRUE)) {
                /* XXX PANIC! */
                CUSTOM->COLOR[0] = 0x0F00;
+               for (;;) ;
            }
        }
     }
+#endif
 
     /* Enable interrupts */
     _spl0();
+    for (;;) CUSTOM->COLOR[0] = 0x00F0; /* XXX */
 }
 
 
index 08cc233..baf50e1 100644 (file)
 
 /* Flags which are possible to uncomment to compile in the kernel */
 
+/*
 #define DEBUG          4096
 #define STATISTICS
+*/
 
 
 
index 6073b0b..29ef15b 100644 (file)
@@ -66,25 +66,25 @@ _start:
 | [d0]void * = [-198]AllocMem([d0]long bytes, [d1]long reqs)
 |
 AllocMem:
-       moveml  %a6/%d1-%d0, %sp@-
+       moveml  %a6/%d1, %sp@-
        moveal  ExecBase:w, %a6
-       movel   %sp@(16), %d0
-       movel   %sp@(20), %d1
+       movel   %sp@(12), %d0
+       movel   %sp@(16), %d1
        jsr     %a6@(-198)
        moveal  %d0, %a0
-       moveml  %sp@+, %d0-%d1/%a6
+       moveml  %sp@+, %d1/%a6
        rts
 
 | [d0]void * = [-204]AllocAbs([d0]long bytes, [a1]void *addr)
 |
 AllocAbs:
-       moveml  %a1/%a6/%d0, %sp@-
+       moveml  %a1/%a6, %sp@-
        moveal  ExecBase:w, %a6
-       movel   %sp@(16), %d0
-       moveal  %sp@(20), %a1
+       movel   %sp@(12), %d0
+       moveal  %sp@(16), %a1
        jsr     %a6@(-204)
        moveal  %d0, %a0
-       moveml  %sp@+, %d0/%a6/%a1
+       moveml  %sp@+, %a6/%a1
        rts
 
 | void [-210]FreeMem([a1]memptr, [d0]bytesize)
@@ -98,7 +98,7 @@ FreeMem:
        moveml  %sp@+, %d0/%a6/%a1
        rts
 
-| [d0] = [-456]DoIO([a1]struct IORequest *)
+| [d0]BYTE = [-456]DoIO([a1]struct IORequest *)
 |
 DoIO:
        moveml  %a1/%a6, %sp@-
index b7fcc6c..796d43c 100644 (file)
@@ -36,9 +36,9 @@
 /* Until proper memory auto-detection is made, this file contains the general
  * information needed to setup the supervisor stack and kernel image location,
  * as well as the available RAM.
- * This currently assumes that 4 megs of FAST RAM are located from
- * 0x00200000 to 0x005fffff (Card 1, Zorro II), and that 2 megs of CHIP RAM
- * are found from 0x00001000 to 0x001fffff.
+ * This currently assumes that 1 meg of FAST RAM is located from
+ * 0x00200000 to 0x002fffff (Card 1, Zorro II), and that 1 meg of CHIP RAM
+ * is found from 0x00001000 to 0x000fffff.
  * All these numbers should be a multiple of 4096 bytes.
  */
 
@@ -63,6 +63,7 @@
 
 /* These are useful results, used by boot/bootf/bootf_c.c, boot/init.c
  * and boot/tools/config.c
+ * XXX Fix to support CHIP-less configurations
  */
 #define STACKADDR      (FMEM_END - STACKSIZE)
 #define KERNADDR       (STACKADDR - KERNSIZE)
index a51ca83..6eb2129 100644 (file)
@@ -142,7 +142,9 @@ static void _init(void)
      * will enable interrupts when safe to do so, which should have been
      * disabled all along initialization.
      */
-    xisop_init();
+    xisop_init(); /* XXX Panics somewhere here just after interrupts are
+                    enabled. _ecatch() with 2 lines: Address Error.*/
+    _panic(0x00F0); /* If we get this green line we did progress */
 
     /* We finally can switch to usermode and jump to MI main().
      * _usermode() m68k-specific function uses 1024 bytes on the
@@ -402,7 +404,7 @@ void _tcatch(int vector)
 /* A hack to display the exception vector number using raster lines */
 void _ecatch(int vector)
 {
-    static u_int16_t ecolors[2] = {0x0F00, 0x0A00};
+    static u_int16_t ecolors[2] = {0x0F00, 0x0F0F};
     register bool col = FALSE;
 
     if (_rlock_try(&elock)) {
@@ -413,7 +415,7 @@ void _ecatch(int vector)
            for (i = 0; i < vector; i++) {
                CUSTOM->COLOR[0] = ecolors[col];
                ldelay(2);
-               CUSTOM->COLOR[0] = 0x0000;
+               CUSTOM->COLOR[0] = 0x0300;
                ldelay(2);
            }
            ldelay(8);
index 4f54c6e..3e8245a 100644 (file)
@@ -112,26 +112,26 @@ AvailMem:
 | [d0]void * = [-198]AllocMem([d0]long bytes, [d1]long reqs)
 |
 AllocMem:
-       moveml  %a6/%d0-%d1, %sp@-
+       moveml  %a6/%d1, %sp@-
        moveal  ExecBase:w, %a6
-       movel   %sp@(16), %d0
-       movel   %sp@(20), %d1
+       movel   %sp@(12), %d0
+       movel   %sp@(16), %d1
        jsr     %a6@(-198)
        moveal  %d0, %a0
-       moveml  %sp@+, %d1-%d0/%a6
+       moveml  %sp@+, %d1/%a6
        rts
 
 
 | [d0]void * = [-204]AllocAbs([d0]long bytes, [a1]void *addr)
 |
 AllocAbs:
-       moveml  %a1/%a6/%d0, %sp@-
+       moveml  %a1/%a6, %sp@-
        moveal  ExecBase:w, %a6
-       movel   %sp@(16), %d0
-       moveal  %sp@(20), %a1
+       movel   %sp@(12), %d0
+       moveal  %sp@(16), %a1
        jsr     %a6@(-204)
        moveal  %d0, %a0
-       moveml  %sp@+, %d0/%a6/%a1
+       moveml  %sp@+, %a6/%a1
        rts
 
 
@@ -673,6 +673,7 @@ except_catch1:      | Bus error
        pea     1
        braw    1f
 except_catch2: | Address error
+       rte
        addql   #1, _interrupt_depth
        moveml  %d0-%d7/%a0-%a6, %sp@-
        pea     2
index 990d9a0..d6f6abc 100644 (file)
@@ -76,7 +76,7 @@ _lock_init:
 _lock_acquire:
        movel   %a0, %sp@-
        moveal  %sp@(8), %a0
-1:     tas     %a0@
+1:     bset    #7, %a0@
        bnes    1b
        moveal  %sp@+, %a0
        rts
@@ -88,7 +88,7 @@ _lock_acquire:
 _lock_try:
        movel   %a0, %sp@-
        moveal  %sp@(8), %a0
-       tas     %a0@
+       bset    #7, %a0@
        beqs    1f
        clrl    %d0
        moveal  %sp@+, %a0
@@ -102,8 +102,8 @@ _lock_try:
 | bool _lock_available(_lock_t *lock)
 | Returns 1/TRUE if the lock is currently free, or 0/FALSE if it is locked.
 | Note that this should not be used to attempt to obtain the lock using two
-| steps (see _lock_try() above for this). It is useful to simply know if
-| it is locked, nothing else. Useful for the scheduler on/off switch.
+| steps (see _lock_try() above for this).  It is useful to simply know if
+| it is locked, nothing else.  Useful for the scheduler on/off switch.
 |
 _lock_available:
        movel   %a0, %sp@-
@@ -153,8 +153,8 @@ _rlock_acquire:
 
 
 | void _rlock_release(_rlock_t *rlock)
-| Releases the lock. _rlock_acquire() and _rlock_release() instances must pair
-| for the lock to eventually be available again.
+| Releases the lock.  _rlock_acquire() and _rlock_release() instances must
+| pair for the lock to eventually be available again.
 |
 _rlock_release:
        movel   %a0, %sp@-
@@ -166,9 +166,9 @@ _rlock_release:
 
 | bool _rlock_try(_rlock_t *rlock)
 | Atomically acquires the lock like _rlock_acquire(), but returns TRUE if
-| we then are the only locker. Otherwise, releases the lock back and return
-| FALSE. Obviously, if we are the only locker, the _rlock_t counter will be
-| one (1). This allows to perform an atomic
+| we then are the only locker.  Otherwise, releases the lock back and returns
+| FALSE.  Obviously, if we are the only locker, the _rlock_t counter will be
+| one (1).  This allows to perform an atomic
 | _rlock_available() + _rlock_acquire() pair.
 |
 _rlock_try:
@@ -185,7 +185,7 @@ _rlock_try:
 
 
 | bool _rlock_available(_rlock_t *rlock)
-| Returns TRUE if the lock is available, or if FALSE if there are any lockers.
+| Returns TRUE if the lock is available, or FALSE if there are any lockers.
 |
 _rlock_available:
        movel   %a0, %sp@-
@@ -208,7 +208,7 @@ _bswap16:
 
 
 | u_int32_t _bswap32(u_int32_t)
-| Reverses the order of the four bytes held in the supplied 32-bit word
+| Reverses the order of the four bytes held in the supplied 32-bit word.
 | First cause a 16-bit byte swap, then perform a 16-bit word swap within the
 | 32-bit word, and then perform another 16-bit byte swap.
 |
@@ -254,11 +254,11 @@ _ctx_init:
 
 
 | int setjmp(jmp_buf);
-| We can manipulate SP/USP/A7 from user state without problems. We do not need
-| to manipulate SR. We can safely run in usermode.
-| The supplied jmp_buf is actually a pointer to a _ctx_t. We must return 0
+| We can manipulate SP/USP/A7 from user state without problems.  We do not need
+| to manipulate SR.  We can safely run in usermode.
+| The supplied jmp_buf is actually a pointer to a _ctx_t.  We must return 0
 | normally, but must return the value supplied to longjmp() when it is called.
-| To do this, we zero D0, save context to jmp_buf, and return. longjmp() will
+| To do this, we zero D0, save context to jmp_buf, and return.  longjmp() will
 | load that context back and set D0 to the wanted value before returning.
 |
 setjmp:
@@ -292,9 +292,9 @@ longjmp:
 
 
 | void _idle(void)
-| Puts CPU in sleep mode until next interrupt occurs. Useful to not use 100%
-| CPU time and overheat when all tasks are idle. Also saves alot of power
-| on battery powered systems. Restricted to supervisor mode.
+| Puts CPU in sleep mode until next interrupt occurs.  Useful to not use 100%
+| CPU time and overheat when all tasks are idle.  Also saves alot of power
+| on battery powered systems.  Restricted to supervisor mode.
 |
 _idle:
        movew   %sr, %sp@-
@@ -306,10 +306,10 @@ _idle:
 | void _usermode(int (*)(void));
 | Useful for port-specific init code to call Xisop main()
 | Permits to switch from supervisor mode to usermode and jump to the specified
-| function. The current supervisor stack is used to setup the user stack (US).
-| The user stack we create is 1024 bytes. Obviously, the SS should have enough
-| room for this. The function we jump to is expected to only perform minor
-| initialization, like to start the first Xisop task, with it's own stack.
+| function.  The current supervisor stack is used to setup the user stack (US).
+| The user stack we create is 1024 bytes.  Obviously, the SS should have enough
+| room for this.  The function we jump to is expected to only perform minor
+| initialization, like to start the first Xisop task, with its own stack.
 | Used to call Xisop's main() function from init.c
 |
 _usermode: