From 05851541eec171a21f3fb315f1c73a34fa6da8bb Mon Sep 17 00:00:00 2001 From: Will Sowerbutts Date: Sat, 14 Feb 2015 21:53:34 +0000 Subject: [PATCH] z180: Timer interrupt rate is now defined by the platform --- Kernel/cpu-z180/z180.s | 7 +------ Kernel/platform-n8vem-mark4/config.h | 4 ++-- Kernel/platform-n8vem-mark4/kernel.def | 1 + Kernel/platform-p112/config.h | 4 ++-- Kernel/platform-p112/kernel.def | 1 + 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Kernel/cpu-z180/z180.s b/Kernel/cpu-z180/z180.s index dc242baa..f23812c9 100644 --- a/Kernel/cpu-z180/z180.s +++ b/Kernel/cpu-z180/z180.s @@ -45,11 +45,6 @@ .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 diff --git a/Kernel/platform-n8vem-mark4/config.h b/Kernel/platform-n8vem-mark4/config.h index d61c1511..351b96c5 100644 --- a/Kernel/platform-n8vem-mark4/config.h +++ b/Kernel/platform-n8vem-mark4/config.h @@ -21,11 +21,11 @@ /* 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 */ diff --git a/Kernel/platform-n8vem-mark4/kernel.def b/Kernel/platform-n8vem-mark4/kernel.def index 720ce1ba..634dbfeb 100644 --- a/Kernel/platform-n8vem-mark4/kernel.def +++ b/Kernel/platform-n8vem-mark4/kernel.def @@ -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 diff --git a/Kernel/platform-p112/config.h b/Kernel/platform-p112/config.h index 6480c383..80ba5c69 100644 --- a/Kernel/platform-p112/config.h +++ b/Kernel/platform-p112/config.h @@ -21,11 +21,11 @@ /* 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 */ diff --git a/Kernel/platform-p112/kernel.def b/Kernel/platform-p112/kernel.def index 22927591..eaa84d0f 100644 --- a/Kernel/platform-p112/kernel.def +++ b/Kernel/platform-p112/kernel.def @@ -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 -- 2.34.1