/**************************************************************************** REMARKS: Write an I/O port location. ****************************************************************************/ static void wrinx( ushort port, ushort index, ushort value) { PM_outpb(port,(uchar)index); PM_outpb(port+1,(uchar)value); }
/**************************************************************************** REMARKS: Read an I/O port location. ****************************************************************************/ static uchar rdinx( int port, int index) { PM_outpb(port,(uchar)index); return PM_inpb(port+1); }
/**************************************************************************** PARAMETERS: port - I/O port to read value from index - Port index to read RETURNS: Byte read from 'port' register 'index'. ****************************************************************************/ static ushort vga_rdinx( ushort port, ushort index) { PM_outpb(port,(uchar)index); return PM_inpb(port+1); }
/**************************************************************************** REMARKS: Delay for a short period of time. ****************************************************************************/ static void vga_delay(void) { int i; /* For the loop here we program the POST register. The length of this * delay is dependant only on ISA bus speed, but it is enough for * what we need. */ for (i = 0; i <= 10; i++) PM_outpb(0x80, 0); }
void PMAPI PM_restoreRealTimeClockHandler(void) { if (_PM_rtcHandler) { /* Restore CMOS registers and mask RTC clock */ _PM_writeCMOS(0x0A,_PM_oldCMOSRegA); _PM_writeCMOS(0x0B,_PM_oldCMOSRegB); PM_outpb(0xA1,(PM_inpb(0xA1) & 0xFE) | (_PM_oldRTCPIC2 & ~0xFE)); /* Restore the interrupt vector */ restoreISR(0x70, _PM_prevRTC, _PM_prevRealRTC); _PM_rtcHandler = NULL; } }
ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler th,int frequency) { /* Save the old CMOS real time clock values */ _PM_oldCMOSRegA = _PM_readCMOS(0x0A); _PM_oldCMOSRegB = _PM_readCMOS(0x0B); /* Set the real time clock interrupt handler */ getISR(0x70, &_PM_prevRTC, &_PM_prevRealRTC); _PM_rtcHandler = th; setISR(0x70, _PM_rtcISR); /* Program the real time clock default frequency */ PM_setRealTimeClockFrequency(frequency); /* Unmask IRQ8 in the PIC2 */ _PM_oldRTCPIC2 = PM_inpb(0xA1); PM_outpb(0xA1,_PM_oldRTCPIC2 & 0xFE); return true; }