/* 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.
*/
/* 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)
* 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
/* 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)) {
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);
_lock_acquire:
movel %a0, %sp@-
moveal %sp@(8), %a0
-1: tas %a0@
+1: bset #7, %a0@
bnes 1b
moveal %sp@+, %a0
rts
_lock_try:
movel %a0, %sp@-
moveal %sp@(8), %a0
- tas %a0@
+ bset #7, %a0@
beqs 1f
clrl %d0
moveal %sp@+, %a0
| 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@-
| 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@-
| 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:
| 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@-
| 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.
|
| 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:
| 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@-
| 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: