Changeset e5c1186 in mainline for kernel/arch/ia64/src/smp/smp.c


Ignore:
Timestamp:
2010-06-14T22:58:20Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fae1647
Parents:
84d8837
Message:

Remove the poor man's support for SMP.

Proper SMP support will be reintroduced later after the rest of the ia64 code is
cleaned up and the real hardware support is back.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia64/src/smp/smp.c

    r84d8837 re5c1186  
    3333 */
    3434
    35 #include <arch.h>
    36 #include <arch/drivers/ski.h>
    37 #include <arch/drivers/it.h>
    38 #include <arch/interrupt.h>
    39 #include <arch/barrier.h>
    40 #include <arch/asm.h>
    41 #include <arch/register.h>
    42 #include <typedefs.h>
    43 #include <arch/context.h>
    44 #include <arch/stack.h>
    45 #include <arch/mm/page.h>
    46 #include <mm/as.h>
    47 #include <config.h>
    48 #include <userspace.h>
    49 #include <console/console.h>
    50 #include <proc/uarg.h>
    51 #include <syscall/syscall.h>
    52 #include <ddi/irq.h>
    53 #include <ddi/device.h>
    54 #include <arch/bootinfo.h>
    5535#include <smp/smp.h>
    5636#include <smp/ipi.h>
    57 #include <arch/atomic.h>
    58 #include <panic.h>
    59 #include <print.h>
    6037
    6138#ifdef CONFIG_SMP
    6239
    63 extern char cpu_by_id_eid_list[256][256];
    64 
    65 static void sapic_init(void)
     40void ipi_broadcast_arch(int ipi)
    6641{
    67         bootinfo->sapic = (unative_t *)(PA2KA((unative_t)(bootinfo->sapic)) |
    68             FW_OFFSET);
    69 }
    70 
    71 static void ipi_broadcast_arch_all(int ipi)
    72 {
    73         int id, eid;
    74         int myid, myeid;
    75        
    76         myid = ia64_get_cpu_id();
    77         myeid = ia64_get_cpu_eid();
    78        
    79         for (id = 0; id < 256; id++)
    80                 for (eid = 0; eid < 256; eid++)
    81                         if ((id != myid) || (eid != myeid))
    82                                 ipi_send_ipi(id, eid, ipi);
    83 }
    84 
    85 void ipi_broadcast_arch(int ipi )
    86 {
    87         int id, eid;
    88         int myid, myeid;
    89        
    90         myid = ia64_get_cpu_id();
    91         myeid = ia64_get_cpu_eid();
    92 
    93         for (id = 0; id < 256; id++)
    94                 for (eid = 0; eid < 256; eid++)
    95                         if ((id != myid) || (eid != myeid))
    96                                 if (cpu_by_id_eid_list[id][eid])
    97                                         ipi_send_ipi(id, eid, ipi);
    9842}
    9943
    10044void smp_init(void)
    10145{
    102         if (!bootinfo->hello_configured)
    103                 return;
    104        
    105         /*
    106          * If we have not got system prepared by hello, we are not able to start
    107          * AP's. This means we are running on a simulator.
    108          */
    109        
    110         sapic_init();
    111         ipi_broadcast_arch_all(bootinfo->wakeup_intno);
    112         volatile long long brk;
    113         for (brk = 0; brk < 100LL * 1024LL * 1024LL; brk++)
    114                 ;       /* wait a while before CPUs starts */
    115 
    116         config.cpu_count = 0;
    117         int id, eid;
    118        
    119         for (id = 0; id < 256; id++)
    120                 for (eid = 0; eid < 256; eid++)
    121                         if (cpu_by_id_eid_list[id][eid] == 1) {
    122                                 config.cpu_count++;
    123                                 cpu_by_id_eid_list[id][eid] = 2;
    124                         }
    12546}
    12647
    12748void kmp(void *arg __attribute__((unused)))
    12849{
    129         int id, eid;
    130         int myid, myeid;
    131        
    132         myid = ia64_get_cpu_id();
    133         myeid = ia64_get_cpu_eid();
    134 
    135         for (id = 0; id < 256; id++)
    136                 for (eid = 0; eid < 256; eid++)
    137                         if ((id != myid) || (eid != myeid))
    138                                 if (cpu_by_id_eid_list[id][eid] != 0) {
    139                                         if (cpu_by_id_eid_list[id][eid] == 1) {
    140                                                 printf("Found Late CPU ID:%d "
    141                                                     "EDI:%d Not added to "
    142                                                     "system!!!\n", id, eid);
    143                                                 continue;
    144                                         }
    145                                         cpu_by_id_eid_list[id][eid] = 3;
    146                                         /*
    147                                          * There may be just one AP being
    148                                          * initialized at the time. After
    149                                          * it comes completely up, it is
    150                                          * supposed to wake us up.
    151                                          */
    152                                         if (waitq_sleep_timeout(
    153                                             &ap_completion_wq, 1000000,
    154                                             SYNCH_FLAGS_NONE) ==
    155                                             ESYNCH_TIMEOUT) {
    156                                                 printf("%s: waiting for cpu "
    157                                                     "ID:%d EID:%d timed out\n",
    158                                                     __FUNCTION__, id, eid);
    159                                             }
    160                                 }
    16150}
    16251
Note: See TracChangeset for help on using the changeset viewer.