11. Create and use an interrupt stack. 2 Well actually, use the master SP for kernel stacks instead of 3 the interrupt SP. Right now we use the interrupt stack for 4 everything. 5 62. Copy/clear primitives could be tuned. 7 83. Sendsig/sigreturn are pretty bogus. 9 Currently we can call a signal handler even if an excpetion 10 occurs in the middle of an instruction. This causes the handler 11 to return right back to the middle of the offending instruction 12 which will most likely lead to another exception/signal. 13 Technically, I feel this is the correct behavior but it requires 14 saving a lot of state on the user's stack, state that we don't 15 really want the user messing with. Other 68k implementations 16 (e.g. Sun) will delay signals or abort execution of the current 17 instruction to reduce saved state. Even if we stick with the 18 current philosophy, the code could be cleaned up. 19 204. Ditto for AST and software interrupt emulation. 21 Both are possibly over-elaborate and inefficiently implemented. 22 We could possibly handle them by using an appropriately planted 23 PS trace bit. 24 255. Make use of transparent translation registers on 030 MMU. 26 With a little rearranging of the KVA space we could use one to 27 map the entire external IO space [ 600000 - 20000000 ). Since 28 the translation must be 1-1, this would limit the kernel to 6mb 29 (some would say that is hardly a limit) or divide it into two 30 pieces. 31 326. Better time keeping. 33 We could use the second timer on the chip to monitor the interval 34 timer ("clock") and detect lost "ticks". 35 367. Conditional MMU code sould be restructured. 37 Right now it reflects the evolutionary path of the code: 320/350 MMU 38 was supported and PMMU support was glued on. The latter can be ifdef'ed 39 out when not needed, but not all of the former (e.g. ``mmutype'' tests). 40 Also, PMMU is made to look like the HP MMU somewhat ham-stringing it. 41 Since HP MMU models are dead, the excess baggage should be there (though 42 it could be argued that they benefit more from the minor performance 43 impact). MMU code should probably not be ifdef'ed on model type, but 44 rather on more relevant tags (e.g. MMU_HP, MMU_MOTO). 45 468. DELAY() is not even close to right. 47 Should use a timer on the clock chip instead of approximating with a 48 "while (--count);" loop. Because of caches, the latter is potentially 49 way off. 50 519. Redo cache handling. 52 There are way too many routines which are specific to particular 53 cache types. We should be able to come up with a more coherent 54 scheme (though HP 68k boxes have just about every caching scheme 55 imaginable: internal/external, physical/virtual, writeback/writethrough) 56