From a524eb3846aac4d1b38f08cba49ff3503107042f Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Thu, 3 Apr 2025 12:31:21 -0400 Subject: move old kernel code (for now) into kernel/old, trying to get long mode --- kernel/old/include/clock.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 kernel/old/include/clock.h (limited to 'kernel/old/include/clock.h') diff --git a/kernel/old/include/clock.h b/kernel/old/include/clock.h new file mode 100644 index 0000000..674d799 --- /dev/null +++ b/kernel/old/include/clock.h @@ -0,0 +1,55 @@ +/** +** @file clock.h +** +** @author CSCI-452 class of 20245 +** +** @brief Clock module declarations +*/ + +#ifndef CLOCK_H_ +#define CLOCK_H_ + +#include + +/* +** General (C and/or assembly) definitions +*/ + +// conversion functions for seconds, ms, and ticks +// (SEC_TO_MS is defined in defs.h) +#define MS_TO_TICKS(n) ((n)) +#define SEC_TO_TICKS(n) (MS_TO_TICKS(SEC_TO_MS(n))) +#define TICKS_TO_SEC(n) ((n) / CLOCK_FREQ) +#define TICKS_TO_SEC_ROUNDED(n) (((n) + (CLOCK_FREQ - 1)) / CLOCK_FREQ) + +#ifndef ASM_SRC + +/* +** Start of C-only definitions +*/ + +/* +** Types +*/ + +/* +** Globals +*/ + +// current system time +extern uint32_t system_time; + +/* +** Prototypes +*/ + +/** +** Name: clk_init +** +** Clock module initialization +*/ +void clk_init(void); + +#endif /* !ASM_SRC */ + +#endif -- cgit v1.2.3-freya