z180: Timer interrupt rate is now defined by the platform
authorWill Sowerbutts <will@sowerbutts.com>
Sat, 14 Feb 2015 21:53:34 +0000 (21:53 +0000)
committerWill Sowerbutts <will@sowerbutts.com>
Sat, 14 Feb 2015 21:59:38 +0000 (21:59 +0000)
Kernel/cpu-z180/z180.s
Kernel/platform-n8vem-mark4/config.h
Kernel/platform-n8vem-mark4/kernel.def
Kernel/platform-p112/config.h
Kernel/platform-p112/kernel.def

index dc242ba..f23812c 100644 (file)
         .include "../cpu-z180/z180.def"
         .include "../kernel.def"
 
-; -----------------------------------------------------------------------------
-; Constant used for timer configuration
-; -----------------------------------------------------------------------------
-TIMER_TICK_RATE = 100 ; Hz
-
 ; -----------------------------------------------------------------------------
 ; Initialisation code
 ; -----------------------------------------------------------------------------
@@ -181,7 +176,7 @@ z180_init_hardware:
         ; set up system tick timer
         xor a
         out0 (TIME_TCR), a
-        ld hl, #(CPU_CLOCK_KHZ * (1000/20) / TIMER_TICK_RATE) ; timer ticks at PHI/20
+        ld hl, #(CPU_CLOCK_KHZ * (1000/20) / TICKSPERSEC) ; timer ticks at PHI/20
         out0 (TIME_RLDR0L), l
         out0 (TIME_RLDR0H), h
         ld a, #0x11         ; enable downcounting and interrupts for timer 0 only
index d61c151..351b96c 100644 (file)
 /* Banks as reported to user space */
 #define CONFIG_BANKS   1
 
-#define TICKSPERSEC 100U   /* Ticks per second */
+#define TICKSPERSEC 40U     /* Ticks per second */
 #define PROGBASE    0x0000  /* also data base */
 #define PROGLOAD    0x0100  /* also data base */
 #define PROGTOP     0xF000  /* Top of program, base of U_DATA copy */
-#define PROC_SIZE   64   /* Memory needed per process */
+#define PROC_SIZE   64      /* Memory needed per process */
 
 /* WRS: this is probably wrong -- we want to swap the full 64K minus the common code */
 /* For now let's just use something and fix this up later when we have a swap device */
index 720ce1b..634dbfe 100644 (file)
@@ -15,6 +15,7 @@ MARK4_IO_BASE               .equ 0x80
 ; No standard clock speed for the Mark IV board, but this is a common choice.
 USE_FANCY_MONITOR           .equ 1            ; disabling this saves around approx 0.5KB
 CPU_CLOCK_KHZ               .equ 36864        ; 18.432MHz * 2
+TICKSPERSEC                 .equ 40           ; timer interrupt rate (Hz)
 
 PROGBASE                   .equ 0x0000
 PROGLOAD                   .equ 0x0100
index 6480c38..80ba5c6 100644 (file)
 /* Banks as reported to user space */
 #define CONFIG_BANKS   1
 
-#define TICKSPERSEC 100U   /* Ticks per second */
+#define TICKSPERSEC 40U     /* Ticks per second */
 #define PROGBASE    0x0000  /* also data base */
 #define PROGLOAD    0x0100  /* also data base */
 #define PROGTOP     0xF000  /* Top of program, base of U_DATA copy */
-#define PROC_SIZE   64   /* Memory needed per process */
+#define PROC_SIZE   64      /* Memory needed per process */
 
 /* WRS: this is probably wrong -- we want to swap the full 64K minus the common code */
 /* For now let's just use something and fix this up later when we have a swap device */
index 2292759..eaa84d0 100644 (file)
@@ -15,6 +15,7 @@ Z80_TYPE                  .equ 2
 ; (18.432MHz) but this made the machine unstable.
 USE_FANCY_MONITOR           .equ 1            ; disabling this saves around 0.5KB
 CPU_CLOCK_KHZ               .equ 16000        ; 16MHz is the stock crystal
+TICKSPERSEC                 .equ 40           ; timer interrupt rate (Hz)
 
 PROGBASE                   .equ 0x0000
 PROGLOAD                   .equ 0x0100