Changeset 619e2a6b in mainline


Ignore:
Timestamp:
2010-10-25T21:29:11Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
84b7384
Parents:
12c38f5
Message:

Introduce context_get_fp().

Location:
uspace/lib/c/arch
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/abs32le/include/fibril.h

    r12c38f5 r619e2a6b  
    4444                (ctx)->pc = (uintptr_t) (_pc); \
    4545                (ctx)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; \
     46                (ctx)->fp = 0; \
    4647                (ctx)->tls = ((uintptr_t) (ptls)) + sizeof(tcb_t); \
    4748        } while (0)
     
    5354typedef struct {
    5455        uintptr_t sp;
     56        uintptr_t fp;
    5557        uintptr_t pc;
    5658        uintptr_t tls;
    5759} context_t;
     60
     61static inline uintptr_t context_get_fp(context_t *ctx)
     62{
     63        /* On real hardware, this function returns the frame pointer. */
     64        return ctx->fp;
     65}
    5866
    5967#endif
  • uspace/lib/c/arch/amd64/include/fibril.h

    r12c38f5 r619e2a6b  
    5656 */
    5757typedef struct {
    58     uint64_t sp;
    59     uint64_t pc;
    60    
    61     uint64_t rbx;
    62     uint64_t rbp;
     58        uint64_t sp;
     59        uint64_t pc;
    6360
    64     uint64_t r12;
    65     uint64_t r13;
    66     uint64_t r14;
    67     uint64_t r15;
     61        uint64_t rbx;
     62        uint64_t rbp;
    6863
    69     uint64_t tls;
     64        uint64_t r12;
     65        uint64_t r13;
     66        uint64_t r14;
     67        uint64_t r15;
     68
     69        uint64_t tls;
    7070} context_t;
     71
     72static inline uintptr_t context_get_fp(context_t *ctx)
     73{
     74        return ctx->rbp;
     75}
    7176
    7277#endif
  • uspace/lib/c/arch/arm32/include/fibril.h

    r12c38f5 r619e2a6b  
    8686} context_t;
    8787
     88static inline uintptr_t context_get_fp(context_t *ctx)
     89{
     90        return ctx->fp;
     91}
     92
    8893
    8994#endif
  • uspace/lib/c/arch/ia32/include/fibril.h

    r12c38f5 r619e2a6b  
    6767} context_t;
    6868
     69static inline uintptr_t context_get_fp(context_t *ctx)
     70{
     71        return ctx->ebp;
     72}
     73
    6974#endif
    7075
  • uspace/lib/c/arch/ia64/include/fibril.h

    r12c38f5 r619e2a6b  
    130130} context_t;
    131131
     132static inline uintptr_t context_get_fp(context_t *ctx)
     133{
     134        return 0;       /* FIXME */
     135}
     136
    132137#endif
    133138
  • uspace/lib/c/arch/mips32/include/fibril.h

    r12c38f5 r619e2a6b  
    8585} context_t;
    8686
     87static inline uintptr_t context_get_fp(context_t *ctx)
     88{
     89        return ctx->sp;
     90}
     91
    8792#endif
    8893
  • uspace/lib/c/arch/ppc32/include/fibril.h

    r12c38f5 r619e2a6b  
    7878} __attribute__ ((packed)) context_t;
    7979
     80static inline uintptr_t context_get_fp(context_t *ctx)
     81{
     82        return ctx->sp;
     83}
     84
    8085#endif
    8186
  • uspace/lib/c/arch/sparc64/include/fibril.h

    r12c38f5 r619e2a6b  
    7777} context_t;
    7878
     79static inline uintptr_t context_get_fp(context_t *ctx)
     80{
     81        return ctx->sp + STACK_BIAS;
     82}
     83
    7984#endif
    8085
Note: See TracChangeset for help on using the changeset viewer.