Ignore:
File:
1 edited

Legend:

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

    r128359eb r26a9388  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2001-2004 Jakub Jermar
    34 * All rights reserved.
     
    4849 *
    4950 */
     51#if __has_builtin(__builtin_stack_address)
     52
     53#define CURRENT \
     54        ((current_t *) (((uintptr_t) __builtin_stack_address()) & \
     55            (~((uintptr_t) STACK_SIZE - 1))))
     56
     57#else
     58
    5059#define CURRENT \
    5160        ((current_t *) (((uintptr_t) __builtin_frame_address(0)) & \
    5261            (~((uintptr_t) STACK_SIZE - 1))))
     62
     63#endif
    5364
    5465#define MAGIC  UINT32_C(0xfacefeed)
     
    7586typedef struct {
    7687        size_t preemption;      /**< Preemption disabled counter and flag. */
     88        size_t mutex_locks;
    7789        struct thread *thread;  /**< Current thread. */
    7890        struct task *task;      /**< Current task. */
     
    105117extern void calibrate_delay_loop(void);
    106118
    107 extern void reboot(void);
    108119extern void arch_reboot(void);
    109120extern void *arch_construct_function(fncptr_t *, void *, void *);
Note: See TracChangeset for help on using the changeset viewer.