Changeset b254b3b in mainline


Ignore:
Timestamp:
2006-09-14T08:55:51Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
775df25
Parents:
da02e69
Message:

On sparc64, get_stack_base() must use the unbiased %sp (i.e. %sp + 2047).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/include/asm.h

    rda02e69 rb254b3b  
    4242#include <config.h>
    4343#include <time/clock.h>
     44#include <arch/stack.h>
    4445
    4546/** Read Processor State register.
     
    245246static inline uintptr_t get_stack_base(void)
    246247{
    247         uintptr_t v;
    248        
    249         __asm__ volatile ("andn %%sp, %1, %0\n" : "=r" (v) : "r" (STACK_SIZE-1));
    250        
    251         return v;
     248        uintptr_t unbiased_sp;
     249       
     250        __asm__ volatile ("add %%sp, %1, %0\n" : "=r" (unbiased_sp) : "i" (STACK_BIAS));
     251       
     252        return ALIGN_DOWN(unbiased_sp, STACK_SIZE);
    252253}
    253254
Note: See TracChangeset for help on using the changeset viewer.