Subversion Repositories HelenOS

Rev

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

Rev 2131 Rev 2307
Line 46... Line 46...
46
#define SPECIAL     '?'
46
#define SPECIAL     '?'
47
 
47
 
48
#define PACKET_ADB  0x00
48
#define PACKET_ADB  0x00
49
#define PACKET_CUDA 0x01
49
#define PACKET_CUDA 0x01
50
 
50
 
51
#define CUDA_POWERDOWN 0x0a
51
#define CUDA_POWERDOWN  0x0a
-
 
52
#define CUDA_RESET      0x11
52
 
53
 
53
#define RS 0x200
54
#define RS 0x200
54
#define B (0 * RS)
55
#define B (0 * RS)
55
#define A (1 * RS)
56
#define A (1 * RS)
56
#define SR (10 * RS)
57
#define SR (10 * RS)
Line 189... Line 190...
189
    SPECIAL, /* PageDown */
190
    SPECIAL, /* PageDown */
190
    SPECIAL  /* F1 */
191
    SPECIAL  /* F1 */
191
};
192
};
192
 
193
 
193
 
194
 
194
void send_packet(const uint8_t kind, index_t count, ...);
-
 
195
 
-
 
196
 
-
 
197
static void receive_packet(uint8_t *kind, index_t count, uint8_t data[])
195
static void receive_packet(uint8_t *kind, index_t count, uint8_t data[])
198
{
196
{
199
    cuda[B] = cuda[B] & ~TIP;
197
    cuda[B] = cuda[B] & ~TIP;
200
    *kind = cuda[SR];
198
    *kind = cuda[SR];
201
   
199
   
Line 314... Line 312...
314
    sysinfo_set_item_val("kbd.inr", NULL, CUDA_IRQ);
312
    sysinfo_set_item_val("kbd.inr", NULL, CUDA_IRQ);
315
    sysinfo_set_item_val("kbd.address.virtual", NULL, base);
313
    sysinfo_set_item_val("kbd.address.virtual", NULL, base);
316
}
314
}
317
 
315
 
318
 
316
 
319
void send_packet(const uint8_t kind, index_t count, ...)
317
static void send_packet(const uint8_t kind, count_t count, ...)
320
{
318
{
321
    index_t i;
319
    index_t i;
322
    va_list va;
320
    va_list va;
323
   
321
   
324
    cuda[B] = cuda[B] | TIP;
322
    cuda[B] = cuda[B] | TIP;
Line 339... Line 337...
339
    cuda[B] = cuda[B] | TIP;
337
    cuda[B] = cuda[B] | TIP;
340
}
338
}
341
 
339
 
342
 
340
 
343
void cpu_halt(void) {
341
void cpu_halt(void) {
-
 
342
    asm volatile (
-
 
343
        "b 0\n"
-
 
344
    );
-
 
345
}
-
 
346
 
344
#ifdef CONFIG_POWEROFF
347
void arch_reboot(void) {
345
    send_packet(PACKET_CUDA, 1, CUDA_POWERDOWN);
348
    send_packet(PACKET_CUDA, 1, CUDA_RESET);
346
#endif
-
 
347
    asm volatile (
349
    asm volatile (
348
        "b 0\n"
350
        "b 0\n"
349
    );
351
    );
350
}
352
}
351
 
353