Subversion Repositories HelenOS

Rev

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

Rev 3343 Rev 3489
Line 44... Line 44...
44
#include <arch/barrier.h>
44
#include <arch/barrier.h>
45
#include <preemption.h>
45
#include <preemption.h>
46
#include <time/delay.h>
46
#include <time/delay.h>
47
#include <panic.h>
47
#include <panic.h>
48
 
48
 
-
 
49
/** Set the contents of the outgoing interrupt vector data.
-
 
50
 *
-
 
51
 * The first data item (data 0) will be set to the value of func, the
-
 
52
 * rest of the vector will contain zeros.
-
 
53
 *
-
 
54
 * This is a helper function used from within the cross_call function.
-
 
55
 *
-
 
56
 * @param func value the first data item of the vector will be set to
-
 
57
 */
-
 
58
static inline void set_intr_w_data(void (* func)(void))
-
 
59
{
-
 
60
#if defined (US)
-
 
61
    asi_u64_write(ASI_INTR_W, ASI_UDB_INTR_W_DATA_0, (uintptr_t) func);
-
 
62
    asi_u64_write(ASI_INTR_W, ASI_UDB_INTR_W_DATA_1, 0);
-
 
63
    asi_u64_write(ASI_INTR_W, ASI_UDB_INTR_W_DATA_2, 0);
-
 
64
#elif defined (US3)
-
 
65
    asi_u64_write(ASI_INTR_W, VA_INTR_W_DATA_0, (uintptr_t) func);
-
 
66
    asi_u64_write(ASI_INTR_W, VA_INTR_W_DATA_1, 0);
-
 
67
    asi_u64_write(ASI_INTR_W, VA_INTR_W_DATA_2, 0);
-
 
68
    asi_u64_write(ASI_INTR_W, VA_INTR_W_DATA_3, 0);
-
 
69
    asi_u64_write(ASI_INTR_W, VA_INTR_W_DATA_4, 0);
-
 
70
    asi_u64_write(ASI_INTR_W, VA_INTR_W_DATA_5, 0);
-
 
71
    asi_u64_write(ASI_INTR_W, VA_INTR_W_DATA_6, 0);
-
 
72
    asi_u64_write(ASI_INTR_W, VA_INTR_W_DATA_7, 0);
-
 
73
#endif
-
 
74
}
-
 
75
 
49
/** Invoke function on another processor.
76
/** Invoke function on another processor.
50
 *
77
 *
51
 * Currently, only functions without arguments are supported.
78
 * Currently, only functions without arguments are supported.
52
 * Supporting more arguments in the future should be no big deal.
79
 * Supporting more arguments in the future should be no big deal.
53
 *
80
 *
Line 72... Line 99...
72
    status = asi_u64_read(ASI_INTR_DISPATCH_STATUS, 0);
99
    status = asi_u64_read(ASI_INTR_DISPATCH_STATUS, 0);
73
    if (status & INTR_DISPATCH_STATUS_BUSY)
100
    if (status & INTR_DISPATCH_STATUS_BUSY)
74
        panic("Interrupt Dispatch Status busy bit set\n");
101
        panic("Interrupt Dispatch Status busy bit set\n");
75
   
102
   
76
    do {
103
    do {
77
        asi_u64_write(ASI_UDB_INTR_W, ASI_UDB_INTR_W_DATA_0,
-
 
78
            (uintptr_t) func);
104
        set_intr_w_data(func);
79
        asi_u64_write(ASI_UDB_INTR_W, ASI_UDB_INTR_W_DATA_1, 0);
-
 
80
        asi_u64_write(ASI_UDB_INTR_W, ASI_UDB_INTR_W_DATA_2, 0);
-
 
81
        asi_u64_write(ASI_UDB_INTR_W,
105
        asi_u64_write(ASI_INTR_W,
82
            (mid << INTR_VEC_DISPATCH_MID_SHIFT) |
106
            (mid << INTR_VEC_DISPATCH_MID_SHIFT) |
83
            ASI_UDB_INTR_W_DISPATCH, 0);
107
            VA_INTR_W_DISPATCH, 0);
84
   
108
   
85
        membar();
109
        membar();
86
       
110
       
87
        do {
111
        do {
88
            status = asi_u64_read(ASI_INTR_DISPATCH_STATUS, 0);
112
            status = asi_u64_read(ASI_INTR_DISPATCH_STATUS, 0);