Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/arch.h

    r128359eb raae365bc  
    3636#define KERN_ARCH_H_
    3737
     38#include <arch/asm.h>   /* get_stack_base() */
    3839#include <config.h>
    3940
    40 /** Return the current_t structure
    41  *
     41/*
    4242 * The current_t structure holds pointers to various parts of the current
    4343 * execution state, like running task, thread, address space, etc.
    44  *
    45  * The current_t structure is located at the base address of the current
    46  * stack. The stack is assumed to be STACK_SIZE bytes long. The stack base
    47  * address must be aligned to STACK_SIZE.
    48  *
    4944 */
    50 #define CURRENT \
    51         ((current_t *) (((uintptr_t) __builtin_frame_address(0)) & \
    52             (~((uintptr_t) STACK_SIZE - 1))))
     45#define CURRENT  ((current_t * )(get_stack_base()))
    5346
    54 #define MAGIC  UINT32_C(0xfacefeed)
     47#define MAGIC                UINT32_C(0xfacefeed)
    5548
    5649#define container_check(ctn1, ctn2)  ((ctn1) == (ctn2))
     
    6659struct as;
    6760
    68 /** Current structure
    69  *
     61/**
    7062 * For each possible kernel stack, structure
    7163 * of the following type will be placed at
    7264 * the base address of the stack.
    73  *
    7465 */
    7566typedef struct {
    76         size_t preemption;      /**< Preemption disabled counter and flag. */
    77         struct thread *thread;  /**< Current thread. */
    78         struct task *task;      /**< Current task. */
    79         struct cpu *cpu;        /**< Executing CPU. */
    80         struct as *as;          /**< Current address space. */
    81         uint32_t magic;         /**< Magic value. */
     67        size_t preemption;     /**< Preemption disabled counter and flag. */
     68        struct thread *thread; /**< Current thread. */
     69        struct task *task;     /**< Current task. */
     70        struct cpu *cpu;       /**< Executing cpu. */
     71        struct as *as;         /**< Current address space. */
     72        uint32_t magic;        /**< Magic value */
    8273} current_t;
    8374
     
    9889        } while (0)
    9990
    100 #define ARCH_OP(op)  ARCH_STRUCT_OP(arch_ops, op)
     91#define ARCH_OP(op)     ARCH_STRUCT_OP(arch_ops, op)
    10192
    10293extern void current_initialize(current_t *);
Note: See TracChangeset for help on using the changeset viewer.