Changeset 82a80d3 in mainline


Ignore:
Timestamp:
2005-09-03T08:38:28Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fe56609d
Parents:
36b209a
Message:

Implement PPC's get_stack_base().

Comment AMD64's get_stack_base().

Location:
arch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/include/asm.h

    r36b209a r82a80d3  
    3737void asm_fake_loop(__u32 t);
    3838
     39/** Return base address of current stack.
     40 *
     41 * Return the base address of the current stack.
     42 * The stack is assumed to be STACK_SIZE bytes long.
     43 * The stack must start on page boundary.
     44 */
    3945static inline __address get_stack_base(void)
    4046{
  • arch/ppc/include/asm.h

    r36b209a r82a80d3  
    102102}
    103103
    104 /* TODO: implement the real stuff */
     104/** Return base address of current stack.
     105 *
     106 * Return the base address of the current stack.
     107 * The stack is assumed to be STACK_SIZE bytes long.
     108 * The stack must start on page boundary.
     109 */
    105110static inline __address get_stack_base(void)
    106111{
    107         return NULL;
     112        __address v;
     113       
     114        __asm__ volatile ("and %0, %%r1, %1\n" : "=r" (v) : "r" (~(STACK_SIZE-1)));
     115       
     116        return v;
    108117}
    109118
Note: See TracChangeset for help on using the changeset viewer.