Subversion Repositories HelenOS

Rev

Rev 2131 | Rev 2416 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2131 Rev 2336
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (c) 2001-2004 Jakub Jermar
2
 * Copyright (C) 2001-2004 Jakub Jermar
3
 * All rights reserved.
3
 * All rights reserved.
4
 *
4
 *
5
 * Redistribution and use in source and binary forms, with or without
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
6
 * modification, are permitted provided that the following conditions
7
 * are met:
7
 * are met:
Line 38... Line 38...
38
#include <mm/tlb.h>
38
#include <mm/tlb.h>
39
#include <synch/spinlock.h>
39
#include <synch/spinlock.h>
40
#include <proc/scheduler.h>
40
#include <proc/scheduler.h>
41
#include <arch/cpu.h>
41
#include <arch/cpu.h>
42
#include <arch/context.h>
42
#include <arch/context.h>
-
 
43
#ifdef CONFIG_TIMEOUT_EXTAVL_TREE
-
 
44
#include <adt/extavl.h>
-
 
45
#endif
-
 
46
 
43
 
47
 
44
#define CPU_STACK_SIZE  STACK_SIZE
48
#define CPU_STACK_SIZE  STACK_SIZE
45
 
49
 
46
/** CPU structure.
50
/** CPU structure.
47
 *
51
 *
48
 * There is one structure like this for every processor.
52
 * There is one structure like this for every processor.
49
 */
53
 */
50
typedef struct {
54
typedef struct cpu {
51
    SPINLOCK_DECLARE(lock);
55
    SPINLOCK_DECLARE(lock);
52
 
56
 
53
    tlb_shootdown_msg_t tlb_messages[TLB_MESSAGE_QUEUE_LEN];
57
    tlb_shootdown_msg_t tlb_messages[TLB_MESSAGE_QUEUE_LEN];
54
    count_t tlb_messages_count;
58
    count_t tlb_messages_count;
55
   
59
   
Line 58... Line 62...
58
    atomic_t nrdy;
62
    atomic_t nrdy;
59
    runq_t rq[RQ_COUNT];
63
    runq_t rq[RQ_COUNT];
60
    volatile count_t needs_relink;
64
    volatile count_t needs_relink;
61
 
65
 
62
    SPINLOCK_DECLARE(timeoutlock);
66
    SPINLOCK_DECLARE(timeoutlock);
-
 
67
#ifdef CONFIG_TIMEOUT_EXTAVL_TREE
-
 
68
    /** Extended AVL tree structure. */
-
 
69
    extavltree_t timeout_active_tree;
-
 
70
#else
-
 
71
    /** Head of list of timeouts. */
63
    link_t timeout_active_head;
72
    link_t timeout_active_head;
-
 
73
#endif
64
 
74
 
65
    count_t missed_clock_ticks; /**< When system clock loses a tick, it is recorded here
75
    count_t missed_clock_ticks; /**< When system clock loses a tick, it is recorded here
66
                         so that clock() can react. This variable is
76
                         so that clock() can react. This variable is
67
                         CPU-local and can be only accessed when interrupts
77
                         CPU-local and can be only accessed when interrupts
68
                         are disabled. */
78
                         are disabled. */