Changeset 59e4864 in mainline


Ignore:
Timestamp:
2008-11-11T08:00:42Z (16 years ago)
Author:
Jakub Vana <jakub.vana@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f3c4a26
Parents:
a2a5529
Message:

Alfa of SMP support on IA64

Files:
1 added
21 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/ia64/loader/Makefile

    ra2a5529 r59e4864  
    8989
    9090COMPONENTS = \
     91        $(KERNELDIR)/kernel.bin
     92NOCOMPONENTS = \
    9193        $(KERNELDIR)/kernel.bin \
    9294        $(USPACEDIR)/srv/ns/ns \
  • boot/arch/ia64/loader/asm.S

    ra2a5529 r59e4864  
    3838    movl r8 = 0x4404000;;
    3939    mov b1 = r8 ;;
    40     mov r1 = in0;
     40    mov r1 = in0;               #Save bootinfo prt
    4141    br.call.sptk.many b0 = b1;;
    42 .global ofw
    43 ofw:
  • boot/arch/ia64/loader/boot.S

    ra2a5529 r59e4864  
    3535start:
    3636
     37
    3738        mov ar.rsc = r0
    3839#       movl r8 = (VRN_KERNEL << VRN_SHIFT) ;;
     
    5859        br.call.sptk.many b0 = b1
    5960
     61.align 512
     62ap_start:
     63
     64
     65ap_loop:
     66        movl r18=0x4405000;;
     67        mov b1 = r18 ;;
     68        br.call.sptk.many b0 = b1;;
     69
     70.align 1024
     71
     72.align 4096
     73.global binfo
     74binfo:
     75
     76
    6077.bss #on this line is ".bss", it cannot be seen in my mcedit :-(
    6178
  • boot/arch/ia64/loader/gefi/HelenOS/Makefile

    ra2a5529 r59e4864  
    2929LDSCRIPT        = ../gnuefi/elf_$(ARCH)_efi.lds
    3030LDFLAGS         += -T $(LDSCRIPT) -shared -Bsymbolic -L../lib -L../gnuefi $(CRTOBJS)
    31 LOADLIBES       = -lefi -lgnuefi
     31LOADLIBES       = -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
    3232FORMAT          = efi-app-$(ARCH)
    3333
     
    4646        $(OBJDUMP) -d hello.efi > hello.disass 
    4747
    48 hello.so: hello.o image.o
    49         $(LD) $(LDFLAGS) -Map hello.map hello.o -o hello.so $(LOADLIBES)
     48#When selected first lines or second lines, select if image is linked into hello or not - usefull for network boot
     49#hello.so: hello.o image.o
     50hello.so: hello.o
     51#       $(LD) $(LDFLAGS) -Map hello.map hello.o image.o -o hello.so $(LOADLIBES) #link image inside hello
     52        $(LD) $(LDFLAGS) -Map hello.map hello.o -o hello.so $(LOADLIBES) #dont link image inside hello
    5053
    5154hello.o: hello.c
    5255        $(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c hello.c -o hello.o
    5356
    54 image.o: ../../image.boot
     57image.o: ../../image.boot mkimage
    5558        $(OBJCOPY) -O binary ../../image.boot image.bin
    56         $(OBJCOPY) -I binary -O elf64-ia64-little -B ia64 image.bin image.o
     59        ./mkimage
     60        $(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c image.c -o image.o
     61#       $(OBJCOPY) -I binary -O elf64-ia64-little -B ia64  image.bin image.o
     62
     63mkimage: mkimage.c
     64        gcc -o mkimage mkimage.c
    5765
    5866
  • boot/arch/ia64/loader/gefi/HelenOS/hello.c

    ra2a5529 r59e4864  
    22#include <efilib.h>
    33
     4#include <../../../../../../kernel/arch/ia64/include/bootinfo.h>
     5
    46#define KERNEL_LOAD_ADDRESS 0x4400000
     7
     8//Link image as a data array into hello - usefull with network boot
     9//#define IMAGE_LINKED
     10
     11bootinfo_t *bootinfo=(bootinfo_t *)BOOTINFO_ADDRESS;
     12
     13
     14#ifdef IMAGE_LINKED
     15extern char HOSimage[];
     16extern int HOSimagesize;
     17#endif
     18
    519
    620
     
    1630        return mem;
    1731}
    18 char HEX[256];
    19 
    20 char hexs[]="0123456789ABCDEF";
    21 /*
    22 void to_hex(unsigned long long num)
    23 {
    24     int a;
    25     for(a=15;a>=0;a--)   
    26     {
    27         char c=num - (num & 0xfffffffffffffff0LL);
    28         num/=16;
    29         c=hexs[c];
    30         HEX[a]=c;
    31     }
    32 
    33 }
    34 */
    3532
    3633EFI_STATUS
     
    7370
    7471        BS->HandleProtocol(LoadedImage->DeviceHandle, &FileSystemProtocol, &Vol);
    75         Vol->OpenVolume (Vol, &CurDir);
    7672
    7773        char FileName[1024];
    7874        char *OsKernelBuffer;
    7975        int i;
     76        int defaultLoad;
     77        int imageLoad;
    8078        UINTN Size;
    8179
     
    9896        while(LoadOptions[i]==L' ') if(LoadOptions[i++]==0) break;
    9997       
    100         if(LoadOptions[i++]==0)
     98        if(LoadOptions[i++]==0){
    10199                StrCat(FileName,L"\\image.bin");
     100                defaultLoad=1;
     101        }       
    102102        else{
    103103                CHAR16 buf[1024];
     
    109109                buf[j+1]=0;
    110110                StrCat(FileName,buf);
    111         }
    112        
    113         //Print(L"%s\n",FileName);
    114 
    115         EFI_STATUS stat;
    116         stat=CurDir->Open(CurDir, &FileHandle, FileName, EFI_FILE_MODE_READ, 0);
    117         if(EFI_ERROR(stat)){
    118                 Print(L"Error Opening Image %s\n",FileName);
    119                 return 0;
     111                defaultLoad=0;
     112        }
     113
     114        imageLoad=1;
     115#ifdef IMAGE_LINKED
     116        if(defaultLoad) {
     117            Print(L"Using Linked Image\n");
     118            imageLoad=0;
    120119        }   
    121         Size = 0x00400000;
    122         BS->AllocatePool(EfiLoaderData, Size, &OsKernelBuffer);
    123         FileHandle->Read(FileHandle, &Size, OsKernelBuffer);
    124         FileHandle->Close(FileHandle);
    125 
    126         if(Size<1) return 0;
    127 
    128 
    129         char *  HOS = OsKernelBuffer; 
     120#endif 
     121       
     122
     123        char *  HOS;
     124        if(imageLoad)
     125        {
     126                Size = 0x00400000;
     127
     128                Vol->OpenVolume (Vol, &CurDir);
     129
     130                EFI_STATUS stat;
     131                stat=CurDir->Open(CurDir, &FileHandle, FileName, EFI_FILE_MODE_READ, 0);
     132                if(EFI_ERROR(stat)){
     133                        Print(L"Error Opening Image %s\n",FileName);
     134                        return 0;
     135                }
     136                BS->AllocatePool(EfiLoaderData, Size, &OsKernelBuffer);
     137                FileHandle->Read(FileHandle, &Size, OsKernelBuffer);
     138                FileHandle->Close(FileHandle);
     139                HOS = OsKernelBuffer; 
     140                if(Size<1) return 0;
     141
     142        }           
     143#ifdef IMAGE_LINKED
     144        else {
     145            HOS = HOSimage; 
     146            Size = HOSimagesize;
     147            Print(L"Image start %llX\n",(long long)HOS);
     148            Print(L"Image size %llX\n",(long long)Size);
     149            Print(L"Image &size %llX\n",(long long)&Size);
     150        }
     151#endif 
    130152        int HOSSize = Size; 
     153
     154
     155        rArg rSAL;
     156        //Setup AP's wake up address
     157
     158        LibSalProc(0x01000000,2,0x4400200,0,0,0,0,0,&rSAL);
     159
     160
     161        UINT64 sapic;
     162        LibGetSalIpiBlock(&sapic);
     163        Print (L"SAPIC:%X\n", sapic);
     164        bootinfo->sapic=sapic;
     165
     166
     167        int wakeup_intno;
     168        wakeup_intno=0xf0;
     169        Print (L"WAKEUP INTNO:%X\n", wakeup_intno);
     170        bootinfo->wakeup_intno=wakeup_intno;
     171
     172
     173
    131174
    132175
     
    168211            ((char *)(0x4400000))[a]=HOS[a];
    169212        }
     213        bootinfo->sapic=(unsigned long *)sapic;
     214        bootinfo->wakeup_intno=wakeup_intno;
    170215       
    171216        //Run Kernel
     
    178223           
    179224       
    180         while(1){
    181             ((volatile int *)(0x80000000000b8000))[0]++;
    182         }
     225        //Not reached     
    183226        return EFI_SUCCESS;
    184227}
  • boot/arch/ia64/loader/gefi/apps/Makefile

    ra2a5529 r59e4864  
    2929LDSCRIPT        = ../gnuefi/elf_$(ARCH)_efi.lds
    3030LDFLAGS         += -T $(LDSCRIPT) -shared -Bsymbolic -L../lib -L../gnuefi $(CRTOBJS)
    31 LOADLIBES       = -lefi -lgnuefi
     31LOADLIBES       = -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
    3232FORMAT          = efi-app-$(ARCH)
    3333
  • boot/arch/ia64/loader/main.c

    ra2a5529 r59e4864  
    3535#include <balloc.h>
    3636
    37 bootinfo_t bootinfo;
     37extern bootinfo_t binfo;
    3838component_t components[COMPONENTS];
    3939
     
    7070       
    7171       
     72        bootinfo_t *bootinfo=&binfo;
     73       
    7274        //for(ii=0;ii<KERNEL_SIZE;ii++) ((char *)(0x100000))[ii] = ((char *)KERNEL_START)[ii+1];
    7375       
     
    9395
    9496
    95         bootinfo.taskmap.count = 0;
     97        bootinfo->taskmap.count = 0;
    9698        for (i = 0; i < COMPONENTS; i++) {
    9799
    98100                if (i > 0) {
    99                         bootinfo.taskmap.tasks[bootinfo.taskmap.count].addr = components[i].start;
    100                         bootinfo.taskmap.tasks[bootinfo.taskmap.count].size = components[i].size;
    101                         bootinfo.taskmap.count++;
     101                        bootinfo->taskmap.tasks[bootinfo->taskmap.count].addr = components[i].start;
     102                        bootinfo->taskmap.tasks[bootinfo->taskmap.count].size = components[i].size;
     103                        bootinfo->taskmap.count++;
    102104                }
    103105        }
    104106
    105 
    106         jump_to_kernel(&bootinfo);
     107        jump_to_kernel(bootinfo);
    107108
    108109
  • boot/arch/ia64/loader/main.h

    ra2a5529 r59e4864  
    3030#define BOOT_ia64_MAIN_H_
    3131
    32 #include <ofw.h>
    33 #include <ofw_tree.h>
    3432#include <types.h>
     33#include <../../../../kernel/arch/ia64/include/bootinfo.h>
    3534
    3635
    3736#define CONFIG_INIT_TASKS       32
    3837
    39 typedef struct {
    40         void *addr;
    41         size_t size;
    42 } init_task_t;
    43        
    44 typedef struct {
    45         count_t count;
    46         init_task_t tasks[CONFIG_INIT_TASKS];
    47 } init_t;
    4838
    49 typedef struct {
    50         init_t taskmap;
    51 } bootinfo_t;
    52 
    53 extern bootinfo_t bootinfo;
    5439
    5540extern void start(void);
  • kernel/arch/ia64/Makefile.inc

    ra2a5529 r59e4864  
    8383        arch/$(ARCH)/src/proc/scheduler.c \
    8484        arch/$(ARCH)/src/ddi/ddi.c \
     85        arch/$(ARCH)/src/smp/smp.c \
    8586        arch/$(ARCH)/src/drivers/it.c
    8687
     
    99100endif
    100101
     102ifeq ($(CONFIG_SMP),y)
     103        DEFS += -DCONFIG_SMP
     104endif
     105
  • kernel/arch/ia64/include/atomic.h

    ra2a5529 r59e4864  
    5252}
    5353
     54
     55static inline uint64_t test_and_set(atomic_t *val) {
     56        uint64_t v;
     57               
     58        asm volatile (
     59                "movl %0=0x01;;\n"
     60                "xchg8 %0=%1,%0;;\n"
     61                : "=r" (v),"+m" (val->count)
     62        );
     63       
     64        return v;
     65}
     66
     67
    5468static inline void atomic_inc(atomic_t *val) { atomic_add(val, 1); }
    5569static inline void atomic_dec(atomic_t *val) { atomic_add(val, -1); }
  • kernel/arch/ia64/include/bootinfo.h

    ra2a5529 r59e4864  
    3030#define KERN_ia64_BOOTINFO_H_
    3131
    32 
     32#define BOOTINFO_ADDRESS 0x4401000
    3333
    3434#define CONFIG_INIT_TASKS       32
     
    4747typedef struct {
    4848        binit_t taskmap;
     49
     50        unsigned long * sapic;
     51        unsigned int wakeup_intno;
     52
    4953} bootinfo_t;
    5054
  • kernel/arch/ia64/include/cpu.h

    ra2a5529 r59e4864  
    3939#include <arch/register.h>
    4040#include <arch/asm.h>
     41#include <arch/bootinfo.h>
    4142
    4243#define FAMILY_ITANIUM  0x7
     
    6465}
    6566
     67
     68#define CR64_ID_SHIFT 24
     69#define CR64_ID_MASK 0xff000000
     70#define CR64_EID_SHIFT 16
     71#define CR64_EID_MASK 0xff0000
     72
     73static inline int ia64_get_cpu_id(void)
     74{
     75        uint64_t cr64=cr64_read();
     76        return ((CR64_ID_MASK)&cr64)>>CR64_ID_SHIFT;
     77}
     78
     79static inline int ia64_get_cpu_eid(void)
     80{
     81        uint64_t cr64=cr64_read();
     82        return ((CR64_EID_MASK)&cr64)>>CR64_EID_SHIFT;
     83}
     84
     85
     86
     87static inline void ipi_send_ipi(int id,int eid,int intno)
     88{
     89        (bootinfo->sapic)[2*(id*256+eid)]=intno;
     90}
     91
     92
     93
    6694#endif
    6795
  • kernel/arch/ia64/include/mm/page.h

    ra2a5529 r59e4864  
    4747#define KERNEL_PAGE_WIDTH               28      /* 256M */
    4848#define IO_PAGE_WIDTH                   26      /* 64M */
     49#define FW_PAGE_WIDTH                   28      /* 256M */
     50
     51/** Staticly mapped IO spaces */
     52
     53/* Firmware area (bellow 4GB in phys mem) */
     54#define FW_OFFSET             0x00000000F0000000
     55/* Legacy IO space */
     56#define IO_OFFSET             0x0001000000000000
     57/* Videoram - now mapped to 0 as VGA text mode vram on 0xb8000*/
     58#define VIO_OFFSET            0x0002000000000000
     59
     60
    4961
    5062
  • kernel/arch/ia64/src/drivers/it.c

    ra2a5529 r59e4864  
    5656{
    5757        cr_itv_t itv;
    58 
    59         irq_initialize(&it_irq);
    60         it_irq.inr = INTERRUPT_TIMER;
    61         it_irq.devno = device_assign_devno();
    62         it_irq.claim = it_claim;
    63         it_irq.handler = it_interrupt;
    64         irq_register(&it_irq);
    65 
     58       
     59        if(config.cpu_active==1)
     60        {
     61                irq_initialize(&it_irq);
     62                it_irq.inr = INTERRUPT_TIMER;
     63                it_irq.devno = device_assign_devno();
     64                it_irq.claim = it_claim;
     65                it_irq.handler = it_interrupt;
     66                irq_register(&it_irq);
     67        }
     68       
    6669        /* initialize Interval Timer external interrupt vector */
    6770        itv.value = itv_read();
  • kernel/arch/ia64/src/ia64.c

    ra2a5529 r59e4864  
    5555#include <arch/bootinfo.h>
    5656#include <genarch/kbd/i8042.h>
     57#include <genarch/kbd/ns16550.h>
     58#include <smp/smp.h>
     59#include <smp/ipi.h>
     60#include <arch/atomic.h>
     61#include <panic.h>
     62#include <print.h>
     63
     64/*NS16550 as a COM 1*/
     65#define NS16550_IRQ 4
     66#define NS16550_PORT 0x3f8
    5767
    5868bootinfo_t *bootinfo;
     
    103113void arch_post_mm_init(void)
    104114{
    105         irq_init(INR_COUNT, INR_COUNT);
    106 #ifdef SKI
    107         ski_init_console();
     115        if(config.cpu_active==1)
     116        {
     117                irq_init(INR_COUNT, INR_COUNT);
     118#ifdef SKI
     119                ski_init_console();
    108120#else   
    109         ega_init();
     121                ega_init();
    110122#endif 
     123        }
    111124        it_init();     
    112125}
     
    128141        while (1) {
    129142                i8042_poll();
     143#ifdef CONFIG_NS16550
     144                ns16550_poll();
     145#endif
    130146                thread_usleep(POLL_INTERVAL);
    131147        }
     
    136152{
    137153
    138         if (config.cpu_active == 1) {
     154        {
    139155                /*
    140156                 * Create thread that polls keyboard.
     
    154170                i8042_init(kbd, IRQ_KBD, mouse, IRQ_MOUSE);
    155171
     172#ifdef CONFIG_NS16550
     173                ns16550_init(kbd, NS16550_IRQ, NS16550_PORT); // as a COM 1
     174#else
     175#endif
    156176                thread_t *t;
    157177                t = thread_create(i8042_kkbdpoll, NULL, TASK, 0, "kkbdpoll", true);
     
    164184        }
    165185}
     186
    166187
    167188/** Enter userspace and never return. */
     
    225246void arch_reboot(void)
    226247{
    227         // TODO
     248        outb(0x64,0xfe);
    228249        while (1);
    229250}
  • kernel/arch/ia64/src/mm/frame.c

    ra2a5529 r59e4864  
    4343 */
    4444#define MEMORY_SIZE     (64 * 1024 * 1024)
    45 #define MEMORY_BASE     (64 * 1024 * 1024)
     45#define MEMORY_BASE     (0 * 64 * 1024 * 1024)
     46
     47#define ONE_TO_ONE_MAPPING_SIZE (256*1048576) // Mapped at start
    4648
    4749#define ROM_BASE        0xa0000               //For ski
    4850#define ROM_SIZE        (384 * 1024)          //For ski
    4951void poke_char(int x,int y,char ch, char c);
     52
     53uintptr_t last_frame;
     54
    5055void frame_arch_init(void)
    5156{
    52         zone_create(MEMORY_BASE >> FRAME_WIDTH, SIZE2FRAMES(MEMORY_SIZE), (MEMORY_SIZE) >> FRAME_WIDTH, 0);
     57
     58        if(config.cpu_active==1)
     59        {
     60                zone_create(MEMORY_BASE >> FRAME_WIDTH, SIZE2FRAMES(MEMORY_SIZE), (MEMORY_SIZE) >> FRAME_WIDTH, 0);
    5361       
    54         /*
    55          * Blacklist ROM regions.
    56          */
    57         frame_mark_unavailable(ADDR2PFN(ROM_BASE), SIZE2FRAMES(ROM_SIZE));
    58        
     62                /*
     63                * Blacklist ROM regions.
     64                */
     65                //frame_mark_unavailable(ADDR2PFN(ROM_BASE), SIZE2FRAMES(ROM_SIZE));
     66
     67                frame_mark_unavailable(ADDR2PFN(0), SIZE2FRAMES(1048576));
     68                last_frame=SIZE2FRAMES((VRN_KERNEL<<VRN_SHIFT)+ONE_TO_ONE_MAPPING_SIZE);       
     69        }       
    5970}
    6071
  • kernel/arch/ia64/src/mm/page.c

    ra2a5529 r59e4864  
    4848#include <arch/barrier.h>
    4949#include <memstr.h>
     50#include <align.h>
    5051
    5152static void set_environment(void);
     
    263264}
    264265
     266extern uintptr_t last_frame;
     267
     268
     269uintptr_t hw_map(uintptr_t physaddr, size_t size)
     270{
     271        if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH))
     272                panic("Unable to map physical memory %p (%d bytes)", physaddr, size)
     273       
     274        uintptr_t virtaddr = PA2KA(last_frame);
     275        pfn_t i;
     276        for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) {
     277                uintptr_t addr = PFN2ADDR(i);
     278                page_mapping_insert(AS_KERNEL, virtaddr + addr, physaddr + addr, PAGE_NOT_CACHEABLE | PAGE_WRITE);
     279        }
     280       
     281        last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE);
     282       
     283        return virtaddr;
     284}
     285
     286
     287
    265288/** @}
    266289 */
  • kernel/arch/ia64/src/start.S

    ra2a5529 r59e4864  
    4040#define KERNEL_TRANSLATION_VIO 0x0010000000000671
    4141#define KERNEL_TRANSLATION_IO 0x00100FFFFC000671
    42 #define VIO_OFFSET            0x0002000000000000
    43 
    44 #define IO_OFFSET             0x0001000000000000
     42#define KERNEL_TRANSLATION_FW 0x00100000F0000671
    4543
    4644
     
    5351kernel_image_start:
    5452        .auto
     53
     54#identifi self(CPU) in OS structures by ID / EID
     55        mov r9=cr64
     56        mov r10=1
     57        movl r12=0xffffffff
     58        movl r8=cpu_by_id_eid_list
     59        and r8=r8,r12
     60        shr r9=r9,16
     61        add r8=r8,r9
     62        st1 [r8]=r10
     63
     64
    5565
    5666        mov psr.l = r0
     
    113123        movl r10 = (KERNEL_TRANSLATION_IO)
    114124        itr.d dtr[r7] = r10
     125
     126
     127#setup mapping for fimware arrea (also SAPIC)
     128        mov r11 = cr.itir ;;
     129        movl r10 = ~0xfc;;
     130        and r10 =r10 , r11  ;;
     131        movl r11 = (FW_PAGE_WIDTH << PS_SHIFT);;
     132        or r10 =r10 , r11  ;;
     133        mov cr.itir = r10;;
     134
     135
     136        movl r7 = 3
     137        movl r8 = (VRN_KERNEL << VRN_SHIFT) | FW_OFFSET
     138        mov cr.ifa = r8
     139        movl r10 = (KERNEL_TRANSLATION_FW)
     140        itr.d dtr[r7] = r10
     141
    115142
    116143
     
    143170        # switch to register bank 1
    144171        bsw.1
     172
     173#Am'I BSP or AP
     174        movl r20=bsp_started;;
     175        ld8 r20=[r20];;
     176        cmp.eq p3,p2=r20,r0;;
     177
    145178       
    146179        # initialize register stack
     
    161194       
    162195        /*
    163          * Initialize hardcoded_* variables.
     196         * Initialize hardcoded_* variables. Do only BSP
    164197         */
    165         movl r14 = _hardcoded_ktext_size
    166         movl r15 = _hardcoded_kdata_size
    167         movl r16 = _hardcoded_load_address ;;
    168         addl r17 = @gprel(hardcoded_ktext_size), gp
    169         addl r18 = @gprel(hardcoded_kdata_size), gp
    170         addl r19 = @gprel(hardcoded_load_address), gp
    171         addl r21 = @gprel(bootinfo), gp
     198(p3)    movl r14 = _hardcoded_ktext_size
     199(p3)    movl r15 = _hardcoded_kdata_size
     200(p3)    movl r16 = _hardcoded_load_address ;;
     201(p3)    addl r17 = @gprel(hardcoded_ktext_size), gp
     202(p3)    addl r18 = @gprel(hardcoded_kdata_size), gp
     203(p3)    addl r19 = @gprel(hardcoded_load_address), gp
     204(p3)    addl r21 = @gprel(bootinfo), gp
    172205        ;;
    173         st8 [r17] = r14
    174         st8 [r18] = r15
    175         st8 [r19] = r16
    176         st8 [r21] = r20
     206(p3)    st8 [r17] = r14
     207(p3)    st8 [r18] = r15
     208(p3)    st8 [r19] = r16
     209(p3)    st8 [r21] = r20
    177210
    178211        ssm (1 << 19) ;; /* Disable f32 - f127 */
     
    180213        srlz.d ;;
    181214
     215(p2)    movl r18 = main_ap ;;
     216(p2)    mov b1 = r18 ;;
     217(p2)    br.call.sptk.many b0 = b1
     218
     219#Mark that BSP is on
     220        mov r20=1;;
     221        movl r21=bsp_started;;
     222        st8 [r21]=r20;;
     223
     224
    182225        br.call.sptk.many b0 = arch_pre_main
    183226
     
    1892320:
    190233        br 0b
     234.align 4096
     235
     236kernel_image_ap_start:
     237        .auto
     238#identifi self(CPU) in OS structures by ID / EID
     239        mov r9=cr64
     240        mov r10=1
     241        movl r12=0xffffffff
     242        movl r8=cpu_by_id_eid_list
     243        and r8=r8,r12
     244        shr r9=r9,16
     245        add r8=r8,r9
     246        st1 [r8]=r10
     247       
     248#wait for wakeup sychro signal (#3 in cpu_by_id_eid_list)
     249kernel_image_ap_start_loop:
     250        movl r11=kernel_image_ap_start_loop
     251        and r11=r11,r12
     252        mov b1 = r11
     253
     254        ld1 r20=[r8];;
     255        movl r21=3;;
     256        cmp.eq p2,p3=r20,r21;;
     257(p3)br.call.sptk.many b0 = b1
     258
     259        movl r11=kernel_image_start
     260        and r11=r11,r12
     261    mov b1 = r11
     262        br.call.sptk.many b0 = b1
     263
     264
     265.align 16
     266.global bsp_started
     267bsp_started:
     268.space 8
     269
     270
     271.align 4096
     272.global cpu_by_id_eid_list
     273cpu_by_id_eid_list:
     274.space 65536
     275
     276
  • kernel/generic/include/synch/spinlock.h

    ra2a5529 r59e4864  
    3737
    3838#include <arch/types.h>
     39#include <arch/barrier.h>
    3940#include <preemption.h>
    4041#include <atomic.h>
  • kernel/generic/src/mm/tlb.c

    ra2a5529 r59e4864  
    135135void tlb_shootdown_ipi_send(void)
    136136{
     137#ifndef ia64
    137138        ipi_broadcast(VECTOR_TLB_SHOOTDOWN_IPI);
     139#endif 
    138140}
    139141
  • kernel/generic/src/proc/thread.c

    ra2a5529 r59e4864  
    296296        if (!t)
    297297                return NULL;
    298        
    299298        /* Not needed, but good for debugging */
    300299        memsetb(t->kstack, THREAD_STACK_SIZE * 1 << STACK_FRAMES, 0);
Note: See TracChangeset for help on using the changeset viewer.