Changeset 32fffef0 in mainline for kernel/generic/include


Ignore:
Timestamp:
2006-08-29T11:06:57Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0fa6044
Parents:
c8ea4a8b
Message:

Define architecture-specific thread sub-constructors and sub-destructors on all architectures.
Define the THREAD_FLAG_USPACE which means that the thread runs in user space.
The forementioned changes allow for allocating of user window buffer on sparc64
threads that execute in userspace.

A lot of formatting and indentation fixes.

Location:
kernel/generic/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/mm/frame.h

    rc8ea4a8b r32fffef0  
    2828 */
    2929
    30  /** @addtogroup genericmm
     30/** @addtogroup genericmm
    3131 * @{
    3232 */
     
    3434 */
    3535
    36 #ifndef __FRAME_H__
    37 #define __FRAME_H__
     36#ifndef KERN_FRAME_H_
     37#define KERN_FRAME_H_
    3838
    3939#include <arch/types.h>
     
    6262#define FRAME_NO_RECLAIM        0x4     /* do not start reclaiming when no free memory */
    6363
    64 #define FRAME_OK                0       /* frame_alloc return status */
    65 #define FRAME_NO_MEMORY         1       /* frame_alloc return status */
    66 #define FRAME_ERROR             2       /* frame_alloc return status */
    67 
    6864static inline uintptr_t PFN2ADDR(pfn_t frame)
    6965{
     
    8985#define IS_BUDDY_RIGHT_BLOCK_ABS(zone, frame)   (((frame_index_abs((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 1)
    9086
    91 #define frame_alloc(order, flags)                               frame_alloc_generic(order, flags, NULL)
     87#define frame_alloc(order, flags)               frame_alloc_generic(order, flags, NULL)
    9288
    9389extern void frame_init(void);
     
    112108#endif
    113109
    114  /** @}
     110/** @}
    115111 */
    116 
  • kernel/generic/include/proc/thread.h

    rc8ea4a8b r32fffef0  
    5353#define THREAD_STACK_SIZE       STACK_SIZE
    5454
    55 /**< Thread states. */
     55/** Thread states. */
    5656enum state {
    5757        Invalid,        /**< It is an error, if thread is found in this state. */
     
    6666extern char *thread_states[];
    6767
    68 /**< Join types. */
     68/** Join types. */
    6969typedef enum {
    7070        None,
     
    7373} thread_join_type_t;
    7474
    75 #define X_WIRED         (1<<0)
    76 #define X_STOLEN        (1<<1)
     75/* Thread flags */
     76#define THREAD_FLAG_WIRED       (1<<0)  /**< Thread cannot be migrated to another CPU. */
     77#define THREAD_FLAG_STOLEN      (1<<1)  /**< Thread was migrated to another CPU and has not run yet. */
     78#define THREAD_FLAG_USPACE      (1<<2)  /**< Thread executes in userspace. */
    7779
    7880#define THREAD_NAME_BUFLEN      20
     
    128130         * Defined only if thread doesn't run.
    129131         * It means that fpu context is in CPU that last time executes this thread.
    130          * This disables migration
     132         * This disables migration.
    131133         */
    132134        int fpu_context_engaged;
     
    150152        thread_arch_t arch;                     /**< Architecture-specific data. */
    151153
    152         uint8_t *kstack;                                /**< Thread's kernel stack. */
     154        uint8_t *kstack;                        /**< Thread's kernel stack. */
    153155};
    154156
     
    171173extern void thread_create_arch(thread_t *t);
    172174#endif
     175#ifndef thr_constructor_arch
     176extern void thr_constructor_arch(thread_t *t);
     177#endif
     178#ifndef thr_destructor_arch
     179extern void thr_destructor_arch(thread_t *t);
     180#endif
    173181
    174182extern void thread_sleep(uint32_t sec);
Note: See TracChangeset for help on using the changeset viewer.