smp.h (26252) | smp.h (26269) |
---|---|
1/* 2 * ---------------------------------------------------------------------------- 3 * "THE BEER-WARE LICENSE" (Revision 42): 4 * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you 5 * can do whatever you want with this stuff. If we meet some day, and you think 6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7 * ---------------------------------------------------------------------------- 8 * | 1/* 2 * ---------------------------------------------------------------------------- 3 * "THE BEER-WARE LICENSE" (Revision 42): 4 * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you 5 * can do whatever you want with this stuff. If we meet some day, and you think 6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7 * ---------------------------------------------------------------------------- 8 * |
9 * $Id: smp.h,v 1.8 1997/05/07 19:53:20 peter Exp $ | 9 * $Id: smp.h,v 1.9 1997/05/28 18:44:11 fsmp Exp $ |
10 * 11 */ 12 13#ifndef _MACHINE_SMP_H_ 14#define _MACHINE_SMP_H_ 15 16#ifdef KERNEL 17 18#if defined(SMP) && !defined(APIC_IO) 19# error APIC_IO required for SMP, add "options APIC_IO" to your config file. 20#endif /* SMP && NCPU */ 21 22#if defined(SMP) && !defined(NCPU) 23# define NCPU 2 24#endif /* SMP && NCPU */ 25 26#if defined(SMP) || defined(APIC_IO) 27 | 10 * 11 */ 12 13#ifndef _MACHINE_SMP_H_ 14#define _MACHINE_SMP_H_ 15 16#ifdef KERNEL 17 18#if defined(SMP) && !defined(APIC_IO) 19# error APIC_IO required for SMP, add "options APIC_IO" to your config file. 20#endif /* SMP && NCPU */ 21 22#if defined(SMP) && !defined(NCPU) 23# define NCPU 2 24#endif /* SMP && NCPU */ 25 26#if defined(SMP) || defined(APIC_IO) 27 |
28#include <machine/apic.h> 29 |
|
28/* global data in mpboot.s */ 29extern int bootMP_size; 30 31/* functions in mpboot.s */ 32void bootMP __P((void)); 33 34/* global data in mplock.s */ 35extern u_int mp_lock; --- 37 unchanged lines hidden (view full) --- 73int apic_trigger __P((int, int)); 74int apic_polarity __P((int, int)); 75void configure_local_apic __P((void)); 76void init_secondary __P((void)); 77void smp_invltlb __P((void)); 78 79/* global data in mpapic.c */ 80extern volatile u_int* apic_base; | 30/* global data in mpboot.s */ 31extern int bootMP_size; 32 33/* functions in mpboot.s */ 34void bootMP __P((void)); 35 36/* global data in mplock.s */ 37extern u_int mp_lock; --- 37 unchanged lines hidden (view full) --- 75int apic_trigger __P((int, int)); 76int apic_polarity __P((int, int)); 77void configure_local_apic __P((void)); 78void init_secondary __P((void)); 79void smp_invltlb __P((void)); 80 81/* global data in mpapic.c */ 82extern volatile u_int* apic_base; |
83#if 1 /** XXX APIC_STRUCT */ 84extern volatile lapic_t* lapic; 85#endif /** XXX APIC_STRUCT */ |
|
81 82#if defined(MULTIPLE_IOAPICS) 83#error MULTIPLE_IOAPICSXXX 84#else 85extern volatile u_int* io_apic_base; | 86 87#if defined(MULTIPLE_IOAPICS) 88#error MULTIPLE_IOAPICSXXX 89#else 90extern volatile u_int* io_apic_base; |
91#if 1 /** XXX APIC_STRUCT */ 92extern volatile ioapic_t* ioapic; 93#endif /** XXX APIC_STRUCT */ |
|
86#endif /* MULTIPLE_IOAPICS */ 87 88/* functions in mpapic.c */ 89void apic_initialize __P((int)); 90int apic_ipi __P((int, int, int)); 91int selected_apic_ipi __P((u_int, int, int)); 92int io_apic_setup __P((int)); 93int ext_int_setup __P((int, int)); --- 26 unchanged lines hidden (view full) --- 120#else 121/* 122 * we 'borrow' this info from apic.h 123 * this will go away soon... 124 */ 125static __inline unsigned 126cpunumber(void) 127{ | 94#endif /* MULTIPLE_IOAPICS */ 95 96/* functions in mpapic.c */ 97void apic_initialize __P((int)); 98int apic_ipi __P((int, int, int)); 99int selected_apic_ipi __P((u_int, int, int)); 100int io_apic_setup __P((int)); 101int ext_int_setup __P((int, int)); --- 26 unchanged lines hidden (view full) --- 128#else 129/* 130 * we 'borrow' this info from apic.h 131 * this will go away soon... 132 */ 133static __inline unsigned 134cpunumber(void) 135{ |
136#if 0 |
|
128 return (unsigned)(apic_id_to_logical[(apic_base[8] & 0x0f000000) >> 24]); | 137 return (unsigned)(apic_id_to_logical[(apic_base[8] & 0x0f000000) >> 24]); |
138#else 139 return (unsigned)(apic_id_to_logical[(lapic__id & 0x0f000000) >> 24]); 140#endif |
|
129} 130#endif /* 0 */ 131 132#endif /* SMP || APIC_IO */ 133#endif /* KERNEL */ 134#endif /* _MACHINE_SMP_H_ */ | 141} 142#endif /* 0 */ 143 144#endif /* SMP || APIC_IO */ 145#endif /* KERNEL */ 146#endif /* _MACHINE_SMP_H_ */ |