Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 4db05ea in mainline


Ignore:
Timestamp:
2018-10-20T16:09:17Z (3 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master
Children:
566457ad
Parents:
2cea4c58
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-10-18 18:45:48)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-10-20 16:09:17)
Message:

Pass ppc32 kernel entry point from C code

Location:
boot/arch/ppc32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/ppc32/include/arch/asm.h

    r2cea4c58 r4db05ea  
    3333#include <arch/main.h>
    3434
    35 extern void jump_to_kernel(void *, void *, size_t, void *)
     35extern void jump_to_kernel(void *, void *, size_t, void *, uintptr_t)
    3636    __attribute__((noreturn));
    3737extern void real_mode(void);
  • boot/arch/ppc32/src/asm.S

    r2cea4c58 r4db05ea  
    127127        # r5 = pages to translate
    128128        # r6 = real mode meeting point (physical address)
     129        # r7 = kernel entry point (virtual address in kernel's address space)
    129130
    130131        # disable interrupts
     
    160161        # r4 = translate table (physical address)
    161162        # r5 = pages to translate
     163        # r7 = kernel entry point (virtual address in kernel's address space)
    162164
    163165        # move the images of components to the proper
     
    399401        # start the kernel
    400402        #
    401         # pc = PA2KA(BOOT_OFFSET)
     403        # pc = kernel's entry point (r7)
    402404        # r3 = bootinfo (physical address)
    403405        # sprg0 = BOOT_OFFSET
     
    405407        # sp = 0 (enforces the usage of sprg0 as exception stack)
    406408
    407         lis r31, PA2KA(BOOT_OFFSET)@ha
    408         addi r31, r31, PA2KA(BOOT_OFFSET)@l
    409         mtspr srr0, r31
     409        mtspr srr0, r7
    410410
    411411        lis r31, BOOT_OFFSET@ha
  • boot/arch/ppc32/src/main.c

    r2cea4c58 r4db05ea  
    135135
    136136        printf("Booting the kernel...\n");
    137         jump_to_kernel(bootinfo_pa, transtable_pa, pages, real_mode_pa);
     137        jump_to_kernel(bootinfo_pa, transtable_pa, pages, real_mode_pa,
     138            PA2KA(BOOT_OFFSET));
    138139}
Note: See TracChangeset for help on using the changeset viewer.