stos/amd64: isa: Add legacy i8254 driver
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) 2026, Chloe M.
|
||||
* Provided under the BSD-3 clause.
|
||||
*
|
||||
* Description: i8254 timer driver
|
||||
* Author: Chloe M.
|
||||
*/
|
||||
|
||||
#ifndef _MACHINE_I8254_H_
|
||||
#define _MACHINE_I8254_H_ 1
|
||||
|
||||
#include <stdef.h>
|
||||
|
||||
#define I8254_COMMAND 0x43
|
||||
#define I8254_CHANNEL_0 0x40
|
||||
#define I8254_CHANNEL_2 0x42
|
||||
#define I8254_DIVIDEND 1193182ULL
|
||||
|
||||
/*
|
||||
* Obtain the current counter value
|
||||
*/
|
||||
USHORT MdPitGetCount(VOID);
|
||||
|
||||
/*
|
||||
* Set a new counter value
|
||||
*/
|
||||
VOID MdPitSetCount(USHORT Value);
|
||||
|
||||
/*
|
||||
* Set the PIT counter to match a frequency in Hz
|
||||
*
|
||||
* @Frequency: Frequency in HZ to set
|
||||
*/
|
||||
VOID MdPitSetFrequency(UQUAD Frequency);
|
||||
|
||||
#endif /* !_MACHINE_I8254_H_ */
|
||||
Reference in New Issue
Block a user