Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 1853 → Rev 1854

/trunk/kernel/generic/include/proc/thread.h
52,7 → 52,7
 
#define THREAD_STACK_SIZE STACK_SIZE
 
/**< Thread states. */
/** Thread states. */
enum state {
Invalid, /**< It is an error, if thread is found in this state. */
Running, /**< State of a thread that is currently executing on some CPU. */
65,7 → 65,7
 
extern char *thread_states[];
 
/**< Join types. */
/** Join types. */
typedef enum {
None,
TaskClnp, /**< The thread will be joined by ktaskclnp thread. */
72,8 → 72,10
TaskGC /**< The thread will be joined by ktaskgc thread. */
} thread_join_type_t;
 
#define X_WIRED (1<<0)
#define X_STOLEN (1<<1)
/* Thread flags */
#define THREAD_FLAG_WIRED (1<<0) /**< Thread cannot be migrated to another CPU. */
#define THREAD_FLAG_STOLEN (1<<1) /**< Thread was migrated to another CPU and has not run yet. */
#define THREAD_FLAG_USPACE (1<<2) /**< Thread executes in userspace. */
 
#define THREAD_NAME_BUFLEN 20
 
127,7 → 129,7
/*
* Defined only if thread doesn't run.
* It means that fpu context is in CPU that last time executes this thread.
* This disables migration
* This disables migration.
*/
int fpu_context_engaged;
 
149,7 → 151,7
thread_arch_t arch; /**< Architecture-specific data. */
 
uint8_t *kstack; /**< Thread's kernel stack. */
uint8_t *kstack; /**< Thread's kernel stack. */
};
 
/** Thread list lock.
170,6 → 172,12
#ifndef thread_create_arch
extern void thread_create_arch(thread_t *t);
#endif
#ifndef thr_constructor_arch
extern void thr_constructor_arch(thread_t *t);
#endif
#ifndef thr_destructor_arch
extern void thr_destructor_arch(thread_t *t);
#endif
 
extern void thread_sleep(uint32_t sec);
extern void thread_usleep(uint32_t usec);
/trunk/kernel/generic/include/mm/frame.h
27,14 → 27,14
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/** @addtogroup genericmm
/** @addtogroup genericmm
* @{
*/
/** @file
*/
 
#ifndef __FRAME_H__
#define __FRAME_H__
#ifndef KERN_FRAME_H_
#define KERN_FRAME_H_
 
#include <arch/types.h>
#include <typedefs.h>
61,10 → 61,6
#define FRAME_ATOMIC 0x2 /* do not panic and do not sleep on failure */
#define FRAME_NO_RECLAIM 0x4 /* do not start reclaiming when no free memory */
 
#define FRAME_OK 0 /* frame_alloc return status */
#define FRAME_NO_MEMORY 1 /* frame_alloc return status */
#define FRAME_ERROR 2 /* frame_alloc return status */
 
static inline uintptr_t PFN2ADDR(pfn_t frame)
{
return (uintptr_t)(frame << FRAME_WIDTH);
88,7 → 84,7
#define IS_BUDDY_LEFT_BLOCK_ABS(zone, frame) (((frame_index_abs((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 0)
#define IS_BUDDY_RIGHT_BLOCK_ABS(zone, frame) (((frame_index_abs((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 1)
 
#define frame_alloc(order, flags) frame_alloc_generic(order, flags, NULL)
#define frame_alloc(order, flags) frame_alloc_generic(order, flags, NULL)
 
extern void frame_init(void);
extern void * frame_alloc_generic(uint8_t order, int flags, int *pzone);
111,6 → 107,5
 
#endif
 
/** @}
/** @}
*/