aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2015-08-13 11:43:27 -0400
committerKevin O'Connor <kevin@koconnor.net>2015-08-17 12:22:05 -0400
commitbc46ebe2edeb624c1d1ae6f5c914dd0ae12fb0fa (patch)
treebe0073416279f423aadec7d44e70e215d17eefba
parent4c904957cdadd8232fdf87fc370ffa97b22f1e17 (diff)
downloadseabios-bc46ebe2edeb624c1d1ae6f5c914dd0ae12fb0fa.tar.gz
rtc: Support disabling the RTC timer irq support
Add a build time config option to remove support for RTC timer interrupts along with the associated bios calls requiring that support. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--src/Kconfig9
-rw-r--r--src/clock.c13
-rw-r--r--src/hw/rtc.c6
-rw-r--r--src/stacks.c2
4 files changed, 28 insertions, 2 deletions
diff --git a/src/Kconfig b/src/Kconfig
index 62562420..56a1b2f4 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -299,6 +299,15 @@ menu "Hardware support"
default y
help
Support parallel ports. This also enables int 17 parallel port calls.
+ config RTC_TIMER
+ bool "Real Time Clock (RTC) scheduling"
+ default y
+ help
+ Support MC146818 Real Time Clock chip timer
+ interrupts. This also enables int 1583 and int 1586 calls.
+
+ Disabling this support does not disable access to the RTC
+ cmos registers.
config USE_SMM
depends on QEMU
diff --git a/src/clock.c b/src/clock.c
index ee2b53ff..2bb5209a 100644
--- a/src/clock.c
+++ b/src/clock.c
@@ -56,7 +56,8 @@ clock_setup(void)
}
enable_hwirq(0, FUNC16(entry_08));
- enable_hwirq(8, FUNC16(entry_70));
+ if (CONFIG_RTC_TIMER)
+ enable_hwirq(8, FUNC16(entry_70));
}
@@ -374,6 +375,10 @@ clear_usertimer(void)
void
handle_1586(struct bregs *regs)
{
+ if (!CONFIG_RTC_TIMER) {
+ set_code_unimplemented(regs, RET_EUNSUPPORTED);
+ return;
+ }
// Use the rtc to wait for the specified time.
u8 statusflag = 0;
u32 count = (regs->cx << 16) | regs->dx;
@@ -417,6 +422,10 @@ handle_1583XX(struct bregs *regs)
void
handle_1583(struct bregs *regs)
{
+ if (!CONFIG_RTC_TIMER) {
+ handle_1583XX(regs);
+ return;
+ }
switch (regs->al) {
case 0x00: handle_158300(regs); break;
case 0x01: handle_158301(regs); break;
@@ -430,6 +439,8 @@ handle_1583(struct bregs *regs)
void VISIBLE16
handle_70(void)
{
+ if (!CONFIG_RTC_TIMER)
+ return;
debug_isr(DEBUG_ISR_70);
// Check which modes are enabled and have occurred.
diff --git a/src/hw/rtc.c b/src/hw/rtc.c
index 628d5429..570a3ad0 100644
--- a/src/hw/rtc.c
+++ b/src/hw/rtc.c
@@ -62,6 +62,8 @@ rtc_updating(void)
void
rtc_setup(void)
{
+ if (!CONFIG_RTC_TIMER)
+ return;
rtc_write(CMOS_STATUS_A, 0x26); // 32,768Khz src, 976.5625us updates
rtc_mask(CMOS_STATUS_B, ~RTC_B_DSE, RTC_B_24HR);
rtc_read(CMOS_STATUS_C);
@@ -73,6 +75,8 @@ int RTCusers VARLOW;
void
rtc_use(void)
{
+ if (!CONFIG_RTC_TIMER)
+ return;
int count = GET_LOW(RTCusers);
SET_LOW(RTCusers, count+1);
if (count)
@@ -84,6 +88,8 @@ rtc_use(void)
void
rtc_release(void)
{
+ if (!CONFIG_RTC_TIMER)
+ return;
int count = GET_LOW(RTCusers);
SET_LOW(RTCusers, count-1);
if (count != 1)
diff --git a/src/stacks.c b/src/stacks.c
index 0c5f79af..e67aeb6a 100644
--- a/src/stacks.c
+++ b/src/stacks.c
@@ -574,7 +574,7 @@ thread_setup(void)
int
threads_during_optionroms(void)
{
- return CONFIG_THREADS && ThreadControl == 2 && in_post();
+ return CONFIG_THREADS && CONFIG_RTC_TIMER && ThreadControl == 2 && in_post();
}
// Switch to next thread stack.