Changeset 91a8f83 in mainline for kernel/generic/include


Ignore:
Timestamp:
2018-10-31T18:15:56Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
071cb36
Parents:
482f968
Message:

Rename THE/the_t to CURRENT/current_t

Because the word "THE" occurs several times in every licence
header, searching for occurences of "THE" macro is more difficult
than necessary.

While I appreciate the wit of it, using a nonconflicting word
for it is more practical.

Location:
kernel/generic/include
Files:
8 edited

Legend:

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

    r482f968 r91a8f83  
    4040
    4141/*
    42  * THE is not an abbreviation, but the English definite article written in
    43  * capital letters. It means the current pointer to something, e.g. thread,
    44  * processor or address space. Kind reader of this comment shall appreciate
    45  * the wit of constructs like THE->thread and similar.
     42 * The context pointer. The current_t structure holds pointers to various parts
     43 * of the current execution context, like running task, thread, address space,
     44 * etc.
    4645 */
    47 #define THE  ((the_t * )(get_stack_base()))
     46#define CURRENT  ((current_t * )(get_stack_base()))
    4847
    4948#define MAGIC                UINT32_C(0xfacefeed)
     
    5352#define DEFAULT_CONTAINER  0
    5453#define CONTAINER \
    55         ((THE->task) ? (THE->task->container) : (DEFAULT_CONTAINER))
     54        ((CURRENT->task) ? (CURRENT->task->container) : (DEFAULT_CONTAINER))
    5655
    5756/* Fwd decl. to avoid include hell. */
     
    7675        struct as *as;         /**< Current address space. */
    7776        uint32_t magic;        /**< Magic value */
    78 } the_t;
     77} current_t;
    7978
    8079typedef struct {
     
    9695#define ARCH_OP(op)     ARCH_STRUCT_OP(arch_ops, op)
    9796
    98 extern void the_initialize(the_t *);
    99 extern void the_copy(the_t *, the_t *);
     97extern void current_initialize(current_t *);
     98extern void current_copy(current_t *, current_t *);
    10099
    101100extern void calibrate_delay_loop(void);
  • kernel/generic/include/cpu.h

    r482f968 r91a8f83  
    4545#include <arch.h>
    4646
    47 #define CPU                  THE->cpu
     47#define CPU                  CURRENT->cpu
    4848
    4949/** CPU structure.
  • kernel/generic/include/mm/as.h

    r482f968 r91a8f83  
    5050#include <lib/refcount.h>
    5151
    52 #define AS                   THE->as
     52#define AS                   CURRENT->as
    5353
    5454/**
  • kernel/generic/include/preemption.h

    r482f968 r91a8f83  
    4141
    4242#define PREEMPTION_INC         (1 << 0)
    43 #define PREEMPTION_DISABLED    (PREEMPTION_INC <= THE->preemption)
     43#define PREEMPTION_DISABLED    (PREEMPTION_INC <= CURRENT->preemption)
    4444#define PREEMPTION_ENABLED     (!PREEMPTION_DISABLED)
    4545
     
    4747#define preemption_disable() \
    4848        do { \
    49                 THE->preemption += PREEMPTION_INC; \
     49                CURRENT->preemption += PREEMPTION_INC; \
    5050                compiler_barrier(); \
    5151        } while (0)
     
    5656                assert(PREEMPTION_DISABLED); \
    5757                compiler_barrier(); \
    58                 THE->preemption -= PREEMPTION_INC; \
     58                CURRENT->preemption -= PREEMPTION_INC; \
    5959        } while (0)
    6060
  • kernel/generic/include/proc/task.h

    r482f968 r91a8f83  
    6363#include <cap/cap.h>
    6464
    65 #define TASK                 THE->task
     65#define TASK                 CURRENT->task
    6666
    6767struct thread;
  • kernel/generic/include/proc/thread.h

    r482f968 r91a8f83  
    5252#include <arch.h>
    5353
    54 #define THREAD              THE->thread
     54#define THREAD              CURRENT->thread
    5555
    5656#define THREAD_NAME_BUFLEN  20
  • kernel/generic/include/synch/rcu.h

    r482f968 r91a8f83  
    132132static inline void rcu_read_lock(void)
    133133{
    134         THE->rcu_nesting += RCU_CNT_INC;
     134        CURRENT->rcu_nesting += RCU_CNT_INC;
    135135        compiler_barrier();
    136136}
     
    140140{
    141141        compiler_barrier();
    142         THE->rcu_nesting -= RCU_CNT_INC;
    143 
    144         if (RCU_WAS_PREEMPTED == THE->rcu_nesting) {
     142        CURRENT->rcu_nesting -= RCU_CNT_INC;
     143
     144        if (RCU_WAS_PREEMPTED == CURRENT->rcu_nesting) {
    145145                _rcu_preempted_unlock();
    146146        }
  • kernel/generic/include/time/timeout.h

    r482f968 r91a8f83  
    4545        IRQ_SPINLOCK_DECLARE(lock);
    4646
    47         /** Link to the list of active timeouts on THE->cpu */
     47        /** Link to the list of active timeouts on CURRENT->cpu */
    4848        link_t link;
    4949        /** Timeout will be activated in this amount of clock() ticks. */
Note: See TracChangeset for help on using the changeset viewer.