Changeset 26aafe8 in mainline for kernel/arch/ppc32


Ignore:
Timestamp:
2011-05-19T16:47:49Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a6d8726
Parents:
bcaca55
Message:

cleanup the huge mess related to stacks, their sizes and locations
use two frames for kernel stacks by default on all platforms (to play it safe)

Location:
kernel/arch/ppc32
Files:
7 edited

Legend:

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

    rbcaca55 r26aafe8  
    3737
    3838#define BOOT_OFFSET  0x8000
    39 
    40 /* Temporary stack size for boot process */
    41 #define TEMP_STACK_SIZE  0x1000
    4239
    4340#define TASKMAP_MAX_RECORDS        32
  • kernel/arch/ppc32/include/istate.h

    rbcaca55 r26aafe8  
    7373        uint32_t cr;
    7474        uint32_t pc;
    75         uint32_t srr1;
     75        uint32_t msr;
    7676        uint32_t lr;
    7777        uint32_t ctr;
     
    9090/** Return true if exception happened while in userspace
    9191 *
    92  * The contexts of MSR register was stored in SRR1.
    93  *
    9492 */
    9593NO_TRACE static inline int istate_from_uspace(istate_t *istate)
    9694{
    97         return (istate->srr1 & MSR_PR) != 0;
     95        return (istate->msr & MSR_PR) != 0;
    9896}
    9997
  • kernel/arch/ppc32/include/mm/as.h

    rbcaca55 r26aafe8  
    3838#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH  0
    3939
    40 #define KERNEL_ADDRESS_SPACE_START_ARCH  ((unsigned long) 0x80000000)
    41 #define KERNEL_ADDRESS_SPACE_END_ARCH    ((unsigned long) 0xffffffff)
    42 #define USER_ADDRESS_SPACE_START_ARCH    ((unsigned long) 0x00000000)
    43 #define USER_ADDRESS_SPACE_END_ARCH      ((unsigned long) 0x7fffffff)
    44 
    45 #define USTACK_ADDRESS_ARCH  (0x7fffffff - (PAGE_SIZE - 1))
     40#define KERNEL_ADDRESS_SPACE_START_ARCH  UINT32_C(0x80000000)
     41#define KERNEL_ADDRESS_SPACE_END_ARCH    UINT32_C(0xffffffff)
     42#define USER_ADDRESS_SPACE_START_ARCH    UINT32_C(0x00000000)
     43#define USER_ADDRESS_SPACE_END_ARCH      UINT32_C(0x7fffffff)
    4644
    4745typedef struct {
  • kernel/arch/ppc32/src/boot/boot.S

    rbcaca55 r26aafe8  
    2828
    2929#include <arch/asm/regname.h>
    30 #include <arch/boot/boot.h>
     30#include <config.h>
    3131
    3232.section K_TEXT_START, "ax"
     
    5656.align 12
    5757kernel_stack_bottom:
    58         .space TEMP_STACK_SIZE
     58        .space STACK_SIZE
    5959kernel_stack:
  • kernel/arch/ppc32/src/mm/tlb.c

    rbcaca55 r26aafe8  
    223223                switch (pfrc) {
    224224                case AS_PF_FAULT:
    225                         goto fail;
    226                         break;
     225                        page_table_unlock(as, true);
     226                        pht_refill_fail(badvaddr, istate);
     227                        return;
    227228                case AS_PF_DEFER:
    228229                        /*
     
    242243       
    243244        page_table_unlock(as, true);
    244         return;
    245        
    246 fail:
    247         page_table_unlock(as, true);
    248         pht_refill_fail(badvaddr, istate);
    249245}
    250246
  • kernel/arch/ppc32/src/ppc32.c

    rbcaca55 r26aafe8  
    265265{
    266266        userspace_asm((uintptr_t) kernel_uarg->uspace_uarg,
    267             (uintptr_t) kernel_uarg->uspace_stack +
    268             THREAD_STACK_SIZE - SP_DELTA,
     267            (uintptr_t) kernel_uarg->uspace_stack + STACK_SIZE - SP_DELTA,
    269268            (uintptr_t) kernel_uarg->uspace_entry);
    270269       
  • kernel/arch/ppc32/src/proc/scheduler.c

    rbcaca55 r26aafe8  
    5555        asm volatile (
    5656                "mtsprg0 %[ksp]\n"
    57                 :: [ksp] "r" (KA2PA(&THREAD->kstack[THREAD_STACK_SIZE - SP_DELTA]))
     57                :: [ksp] "r" (KA2PA(&THREAD->kstack[STACK_SIZE - SP_DELTA]))
    5858        );
    5959}
Note: See TracChangeset for help on using the changeset viewer.