diff options
| author | Steve Passe <fsmp@FreeBSD.org> | 1997-07-23 20:47:19 +0000 |
|---|---|---|
| committer | Steve Passe <fsmp@FreeBSD.org> | 1997-07-23 20:47:19 +0000 |
| commit | 812e4da7a8a104313920eee7dcf892bfa6e3ed3b (patch) | |
| tree | 50755663e10a5582cc80fb3933e8896a8709d229 /sys/amd64/include/mptable.h | |
| parent | d9593fb97931fb73dcd390fa45e8015ae6ffeb2e (diff) | |
Notes
Diffstat (limited to 'sys/amd64/include/mptable.h')
| -rw-r--r-- | sys/amd64/include/mptable.h | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h index c9724a10b0d9..8a3f0c232e83 100644 --- a/sys/amd64/include/mptable.h +++ b/sys/amd64/include/mptable.h @@ -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.18 1997/07/20 18:13:01 smp Exp smp $ + * $Id: mp_machdep.c,v 1.20 1997/07/23 20:20:21 smp Exp smp $ */ #include "opt_smp.h" @@ -248,6 +248,7 @@ static void mp_enable(u_int boot_addr); static int mptable_pass1(void); static int mptable_pass2(void); static void default_mp_table(int type); +static void init_locks(void); static int start_all_aps(u_int boot_addr); static void install_ap_tramp(u_int boot_addr); static int start_ap(int logicalCpu, u_int boot_addr); @@ -498,6 +499,9 @@ mp_enable(u_int boot_addr) #endif /* APIC_IO */ + /* initialize all SMP locks */ + init_locks(); + /* start each Application Processor */ start_all_aps(boot_addr); @@ -1415,6 +1419,23 @@ default_mp_table(int type) /* + * initialize all the SMP locks + */ +static void +init_locks(void) +{ + /* + * Get the initial mp_lock with a count of 1 for the BSP. + * This uses a LOGICAL cpu ID, ie BSP == 0. + */ + mp_lock = 0x00000001; + + /* locks the IO APIC and apic_imen accesses */ + s_lock_init(&imen_lock); +} + + +/* * start each AP in our list */ static int @@ -1429,15 +1450,6 @@ start_all_aps(u_int boot_addr) POSTCODE(START_ALL_APS_POST); - /** - * NOTE: this needs further thought: - * where does it get released? - * should it be set to empy? - * - * get the initial mp_lock with a count of 1 for the BSP - */ - mp_lock = 1; /* this uses a LOGICAL cpu ID, ie BSP == 0 */ - /* initialize BSP's local APIC */ apic_initialize(); |
