Created
March 2, 2016 07:28
-
-
Save chelmuth/abfd91142fcd1e6ae208 to your computer and use it in GitHub Desktop.
sel4 pit boot_code patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src/plat/pc99/machine/pit.c | 22 +++++++++++----------- | |
1 file changed, 11 insertions(+), 11 deletions(-) | |
diff --git a/src/plat/pc99/machine/pit.c b/src/plat/pc99/machine/pit.c | |
index ebf2b75..1b40fae 100644 | |
--- a/src/plat/pc99/machine/pit.c | |
+++ b/src/plat/pc99/machine/pit.c | |
@@ -19,31 +19,31 @@ | |
/* Count frequency in Hz */ | |
#define PIT_HZ 1193180 | |
-PHYS_CODE void | |
+BOOT_CODE void | |
pit_init(void) | |
{ | |
uint16_t divisor = (PIT_HZ * PIT_WRAPAROUND_MS) / 1000; | |
- out8_phys(PIT_MODE, 0x34); /* Set mode 2 and wait for divisor bytes */ | |
- out8_phys(PIT_CH0, divisor & 0xff); /* Set low byte of divisor */ | |
- out8_phys(PIT_CH0, divisor >> 8); /* Set high byte of divisor */ | |
+ out8(PIT_MODE, 0x34); /* Set mode 2 and wait for divisor bytes */ | |
+ out8(PIT_CH0, divisor & 0xff); /* Set low byte of divisor */ | |
+ out8(PIT_CH0, divisor >> 8); /* Set high byte of divisor */ | |
} | |
-PHYS_CODE void | |
+BOOT_CODE void | |
pit_wait_wraparound(void) | |
{ | |
uint16_t count; | |
uint16_t count_old; | |
- out8_phys(PIT_MODE, 0x00); | |
- count = in8_phys(PIT_CH0); | |
- count |= (in8_phys(PIT_CH0) << 8); | |
+ out8(PIT_MODE, 0x00); | |
+ count = in8(PIT_CH0); | |
+ count |= (in8(PIT_CH0) << 8); | |
count_old = count; | |
while (count <= count_old) { | |
count_old = count; | |
- out8_phys(PIT_MODE, 0x00); | |
- count = in8_phys(PIT_CH0); | |
- count |= (in8_phys(PIT_CH0) << 8); | |
+ out8(PIT_MODE, 0x00); | |
+ count = in8(PIT_CH0); | |
+ count |= (in8(PIT_CH0) << 8); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment