Squash commits for public release
This commit is contained in:
10
kernel/include/drivers/timer/arm/arm64/timer.h
Normal file
10
kernel/include/drivers/timer/arm/arm64/timer.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef _KERNEL_DRIVERS_TIMER_ARM_ARM64_TIMER_H
|
||||
#define _KERNEL_DRIVERS_TIMER_ARM_ARM64_TIMER_H
|
||||
|
||||
#include <libkern/types.h>
|
||||
#include <time/time_manager.h>
|
||||
|
||||
void arm64_timer_rearm();
|
||||
void arm64_timer_install();
|
||||
|
||||
#endif // _KERNEL_DRIVERS_TIMER_ARM_ARM64_TIMER_H
|
||||
34
kernel/include/drivers/timer/arm/sp804.h
Normal file
34
kernel/include/drivers/timer/arm/sp804.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef _KERNEL_DRIVERS_TIMER_ARM_SP804_H
|
||||
#define _KERNEL_DRIVERS_TIMER_ARM_SP804_H
|
||||
|
||||
#include <drivers/driver_manager.h>
|
||||
#include <libkern/mask.h>
|
||||
#include <libkern/types.h>
|
||||
#include <time/time_manager.h>
|
||||
|
||||
#define SP804_CLK_HZ 1000000
|
||||
|
||||
// https://developer.arm.com/documentation/ddi0271/d/programmer-s-model/register-descriptions/control-register--timerxcontrol?lang=en
|
||||
enum SP804ControlMasks {
|
||||
MASKDEFINE(SP804_ONE_SHOT, 0, 1),
|
||||
MASKDEFINE(SP804_32_BIT, 1, 1),
|
||||
MASKDEFINE(SP804_PRESCALE, 2, 2),
|
||||
MASKDEFINE(SP804_INTS_ENABLED, 5, 1),
|
||||
MASKDEFINE(SP804_PERIODIC, 6, 1),
|
||||
MASKDEFINE(SP804_ENABLE, 7, 1),
|
||||
};
|
||||
|
||||
struct sp804_registers {
|
||||
uint32_t load;
|
||||
uint32_t value;
|
||||
uint32_t control;
|
||||
uint32_t intclr;
|
||||
uint32_t ris;
|
||||
uint32_t mis;
|
||||
uint32_t bg_load;
|
||||
};
|
||||
typedef struct sp804_registers sp804_registers_t;
|
||||
|
||||
void sp804_install();
|
||||
|
||||
#endif //_KERNEL_DRIVERS_TIMER_ARM_SP804_H
|
||||
11
kernel/include/drivers/timer/x86/pit.h
Normal file
11
kernel/include/drivers/timer/x86/pit.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef _KERNEL_DRIVERS_TIMER_X86_PIT_H
|
||||
#define _KERNEL_DRIVERS_TIMER_X86_PIT_H
|
||||
|
||||
#include <libkern/types.h>
|
||||
#include <time/time_manager.h>
|
||||
|
||||
#define PIT_BASE_FREQ 1193180
|
||||
|
||||
void pit_setup();
|
||||
|
||||
#endif /* _KERNEL_DRIVERS_TIMER_X86_PIT_H */
|
||||
Reference in New Issue
Block a user