]> xenbits.xensource.com Git - seabios.git/commitdiff
rtc: Support disabling the RTC timer irq support
authorKevin O'Connor <kevin@koconnor.net>
Thu, 13 Aug 2015 15:43:27 +0000 (11:43 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 17 Aug 2015 16:22:05 +0000 (12:22 -0400)
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>
src/Kconfig
src/clock.c
src/hw/rtc.c
src/stacks.c

index 62562420202e1dfe5e79fc9ab32645adc891179d..56a1b2f432c1f49739c0942a54381cab7308fead 100644 (file)
@@ -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
index ee2b53ffe6f572e9393b7586ea543ff4f3738b0d..2bb5209a92396461269e5f661c98faaf7bac3326 100644 (file)
@@ -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.
index 628d5429f5e6f977df2a15475b3e104faef8857e..570a3ad0952a245e3bbaa66991e7f5eca32f7388 100644 (file)
@@ -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)
index 0c5f79af3610673aa9cc84e53042674777c67452..e67aeb6ae5385a7f2cd629ce59c25117b07dcec8 100644 (file)
@@ -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.