Added code to support #define APIC_PIN0_TIMER.

This code ALWAYS runs the 8254 timer thru the 8259 ICU.
It depricates the usage of "options SMP_TIMER_NC" in the config file.
This commit is contained in:
Steve Passe 1997-07-19 04:00:35 +00:00
parent 797cb61b54
commit 1dec61e7c0
8 changed files with 62 additions and 22 deletions

View file

@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mp_machdep.c,v 1.16 1997/07/18 19:45:41 smp Exp smp $
* $Id: mp_machdep.c,v 1.30 1997/07/18 21:27:52 fsmp Exp $
*/
#include "opt_smp.h"
@ -45,7 +45,7 @@
#include <machine/mpapic.h>
#include <machine/cpufunc.h>
#include <machine/segments.h>
#include <machine/smptests.h> /** TEST_DEFAULT_CONFIG, TEST_TEST1 */
#include <machine/smptests.h> /** TEST_DEFAULT_CONFIG, APIC_PIN0_TIMER, TEST_TEST1 */
#include <machine/tss.h>
#include <machine/specialreg.h>
@ -1070,8 +1070,12 @@ isa_apic_pin(int isa_irq)
int intr;
#if defined(SMP_TIMER_NC)
#if defined(APIC_PIN0_TIMER)
#error 'options SMP_TIMER_NC' no longer used, remove & reconfig.
#else
if (isa_irq == 0)
return -1;
#endif /* APIC_PIN0_TIMER */
#endif /* SMP_TIMER_NC */
for (intr = 0; intr < nintrs; ++intr) { /* check each record */

View file

@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mp_machdep.c,v 1.16 1997/07/18 19:45:41 smp Exp smp $
* $Id: mp_machdep.c,v 1.30 1997/07/18 21:27:52 fsmp Exp $
*/
#include "opt_smp.h"
@ -45,7 +45,7 @@
#include <machine/mpapic.h>
#include <machine/cpufunc.h>
#include <machine/segments.h>
#include <machine/smptests.h> /** TEST_DEFAULT_CONFIG, TEST_TEST1 */
#include <machine/smptests.h> /** TEST_DEFAULT_CONFIG, APIC_PIN0_TIMER, TEST_TEST1 */
#include <machine/tss.h>
#include <machine/specialreg.h>
@ -1070,8 +1070,12 @@ isa_apic_pin(int isa_irq)
int intr;
#if defined(SMP_TIMER_NC)
#if defined(APIC_PIN0_TIMER)
#error 'options SMP_TIMER_NC' no longer used, remove & reconfig.
#else
if (isa_irq == 0)
return -1;
#endif /* APIC_PIN0_TIMER */
#endif /* SMP_TIMER_NC */
for (intr = 0; intr < nintrs; ++intr) { /* check each record */

View file

@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mp_machdep.c,v 1.16 1997/07/18 19:45:41 smp Exp smp $
* $Id: mp_machdep.c,v 1.30 1997/07/18 21:27:52 fsmp Exp $
*/
#include "opt_smp.h"
@ -45,7 +45,7 @@
#include <machine/mpapic.h>
#include <machine/cpufunc.h>
#include <machine/segments.h>
#include <machine/smptests.h> /** TEST_DEFAULT_CONFIG, TEST_TEST1 */
#include <machine/smptests.h> /** TEST_DEFAULT_CONFIG, APIC_PIN0_TIMER, TEST_TEST1 */
#include <machine/tss.h>
#include <machine/specialreg.h>
@ -1070,8 +1070,12 @@ isa_apic_pin(int isa_irq)
int intr;
#if defined(SMP_TIMER_NC)
#if defined(APIC_PIN0_TIMER)
#error 'options SMP_TIMER_NC' no longer used, remove & reconfig.
#else
if (isa_irq == 0)
return -1;
#endif /* APIC_PIN0_TIMER */
#endif /* SMP_TIMER_NC */
for (intr = 0; intr < nintrs; ++intr) { /* check each record */

View file

@ -32,13 +32,17 @@
* SUCH DAMAGE.
*
* from: Steve McCanne's microtime code
* $Id: microtime.s,v 1.23 1997/05/29 05:11:10 peter Exp $
* $Id: microtime.s,v 1.1 1997/07/19 03:13:15 smp Exp smp $
*/
#include "opt_cpu.h"
#include <machine/asmacros.h>
#ifdef APIC_IO
#include <machine/smptests.h> /** APIC_PIN0_TIMER */
#endif /* APIC_IO */
#include <i386/isa/icu.h>
#include <i386/isa/isa.h>
#include <i386/isa/timerreg.h>
@ -109,11 +113,15 @@ ENTRY(microtime)
movl _timer0_max_count, %edx /* prepare for 2 uses */
#if defined(APIC_IO)
#ifdef APIC_IO
#ifdef APIC_PIN0_TIMER
testl $IRQ0, _ipending /* is soft timer interrupt pending? */
#else
movl _ipending, %eax
testl %eax, _mask8254 /* is soft timer interrupt pending? */
#endif /* APIC_PIN0_TIMER */
#else
testb $IRQ0, _ipending /* is a soft timer interrupt pending? */
testb $IRQ0, _ipending /* is soft timer interrupt pending? */
#endif /* APIC_IO */
jne overflow
@ -121,12 +129,16 @@ ENTRY(microtime)
cmpl _timer0_overflow_threshold, %ecx
jbe 1f
#if defined(APIC_IO)
movl lapic_irr1, %eax /** XXX assumption: IRQ0-24 */
testl %eax, _mask8254 /* is a hard timer interrupt pending? */
#ifdef APIC_IO
#ifdef APIC_PIN0_TIMER
testl $IRQ0, lapic_irr1
#else
inb $IO_ICU1, %al /* read IRR in ICU */
testb $IRQ0, %al /* is a hard timer interrupt pending? */
movl lapic_irr1, %eax /** XXX assumption: IRQ0-24 */
testl %eax, _mask8254 /* is hard timer interrupt pending? */
#endif /* APIC_PIN0_TIMER */
#else
inb $IO_ICU1, %al /* read IRR in ICU */
testb $IRQ0, %al /* is hard timer interrupt pending? */
#endif /* APIC_IO */
je 1f
overflow:

View file

@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mp_machdep.c,v 1.16 1997/07/18 19:45:41 smp Exp smp $
* $Id: mp_machdep.c,v 1.30 1997/07/18 21:27:52 fsmp Exp $
*/
#include "opt_smp.h"
@ -45,7 +45,7 @@
#include <machine/mpapic.h>
#include <machine/cpufunc.h>
#include <machine/segments.h>
#include <machine/smptests.h> /** TEST_DEFAULT_CONFIG, TEST_TEST1 */
#include <machine/smptests.h> /** TEST_DEFAULT_CONFIG, APIC_PIN0_TIMER, TEST_TEST1 */
#include <machine/tss.h>
#include <machine/specialreg.h>
@ -1070,8 +1070,12 @@ isa_apic_pin(int isa_irq)
int intr;
#if defined(SMP_TIMER_NC)
#if defined(APIC_PIN0_TIMER)
#error 'options SMP_TIMER_NC' no longer used, remove & reconfig.
#else
if (isa_irq == 0)
return -1;
#endif /* APIC_PIN0_TIMER */
#endif /* SMP_TIMER_NC */
for (intr = 0; intr < nintrs; ++intr) { /* check each record */

View file

@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mp_machdep.c,v 1.16 1997/07/18 19:45:41 smp Exp smp $
* $Id: mp_machdep.c,v 1.30 1997/07/18 21:27:52 fsmp Exp $
*/
#include "opt_smp.h"
@ -45,7 +45,7 @@
#include <machine/mpapic.h>
#include <machine/cpufunc.h>
#include <machine/segments.h>
#include <machine/smptests.h> /** TEST_DEFAULT_CONFIG, TEST_TEST1 */
#include <machine/smptests.h> /** TEST_DEFAULT_CONFIG, APIC_PIN0_TIMER, TEST_TEST1 */
#include <machine/tss.h>
#include <machine/specialreg.h>
@ -1070,8 +1070,12 @@ isa_apic_pin(int isa_irq)
int intr;
#if defined(SMP_TIMER_NC)
#if defined(APIC_PIN0_TIMER)
#error 'options SMP_TIMER_NC' no longer used, remove & reconfig.
#else
if (isa_irq == 0)
return -1;
#endif /* APIC_PIN0_TIMER */
#endif /* SMP_TIMER_NC */
for (intr = 0; intr < nintrs; ++intr) { /* check each record */

View file

@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mp_machdep.c,v 1.16 1997/07/18 19:45:41 smp Exp smp $
* $Id: mp_machdep.c,v 1.30 1997/07/18 21:27:52 fsmp Exp $
*/
#include "opt_smp.h"
@ -45,7 +45,7 @@
#include <machine/mpapic.h>
#include <machine/cpufunc.h>
#include <machine/segments.h>
#include <machine/smptests.h> /** TEST_DEFAULT_CONFIG, TEST_TEST1 */
#include <machine/smptests.h> /** TEST_DEFAULT_CONFIG, APIC_PIN0_TIMER, TEST_TEST1 */
#include <machine/tss.h>
#include <machine/specialreg.h>
@ -1070,8 +1070,12 @@ isa_apic_pin(int isa_irq)
int intr;
#if defined(SMP_TIMER_NC)
#if defined(APIC_PIN0_TIMER)
#error 'options SMP_TIMER_NC' no longer used, remove & reconfig.
#else
if (isa_irq == 0)
return -1;
#endif /* APIC_PIN0_TIMER */
#endif /* SMP_TIMER_NC */
for (intr = 0; intr < nintrs; ++intr) { /* check each record */

View file

@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mp_machdep.c,v 1.16 1997/07/18 19:45:41 smp Exp smp $
* $Id: mp_machdep.c,v 1.30 1997/07/18 21:27:52 fsmp Exp $
*/
#include "opt_smp.h"
@ -45,7 +45,7 @@
#include <machine/mpapic.h>
#include <machine/cpufunc.h>
#include <machine/segments.h>
#include <machine/smptests.h> /** TEST_DEFAULT_CONFIG, TEST_TEST1 */
#include <machine/smptests.h> /** TEST_DEFAULT_CONFIG, APIC_PIN0_TIMER, TEST_TEST1 */
#include <machine/tss.h>
#include <machine/specialreg.h>
@ -1070,8 +1070,12 @@ isa_apic_pin(int isa_irq)
int intr;
#if defined(SMP_TIMER_NC)
#if defined(APIC_PIN0_TIMER)
#error 'options SMP_TIMER_NC' no longer used, remove & reconfig.
#else
if (isa_irq == 0)
return -1;
#endif /* APIC_PIN0_TIMER */
#endif /* SMP_TIMER_NC */
for (intr = 0; intr < nintrs; ++intr) { /* check each record */