Subversion Repositories HelenOS

Rev

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

Rev 2274 Rev 2284
Line 77... Line 77...
77
    .read = gxemul_do_read,
77
    .read = gxemul_do_read,
78
};
78
};
79
 
79
 
80
 
80
 
81
/** Initializes #gxemul_hw_map. */
81
/** Initializes #gxemul_hw_map. */
82
void machine_hw_map_init(void)
82
void gxemul_hw_map_init(void)
83
{
83
{
84
    gxemul_hw_map.videoram = hw_map(GXEMUL_VIDEORAM, PAGE_SIZE);
84
    gxemul_hw_map.videoram = hw_map(GXEMUL_VIDEORAM, PAGE_SIZE);
85
    gxemul_hw_map.kbd = hw_map(GXEMUL_KBD, PAGE_SIZE);
85
    gxemul_hw_map.kbd = hw_map(GXEMUL_KBD, PAGE_SIZE);
86
    gxemul_hw_map.rtc = hw_map(GXEMUL_RTC, PAGE_SIZE);
86
    gxemul_hw_map.rtc = hw_map(GXEMUL_RTC, PAGE_SIZE);
87
    gxemul_hw_map.irqc = hw_map(GXEMUL_IRQC, PAGE_SIZE);
87
    gxemul_hw_map.irqc = hw_map(GXEMUL_IRQC, PAGE_SIZE);
Line 141... Line 141...
141
            ch = *((char *) gxemul_hw_map.kbd);
141
            ch = *((char *) gxemul_hw_map.kbd);
142
            if (ch =='\r')
142
            if (ch =='\r')
143
                ch = '\n';
143
                ch = '\n';
144
            if (ch == 0x7f)
144
            if (ch == 0x7f)
145
                ch = '\b';
145
                ch = '\b';
146
            //chardev_push_character(&console, ch);
146
            chardev_push_character(&console, ch);
147
            printf("%c", ch);
-
 
148
    }
147
    }
149
}
148
}
150
 
149
 
151
static irq_ownership_t gxemul_claim(void)
150
static irq_ownership_t gxemul_claim(void)
152
{
151
{
Line 252... Line 251...
252
    /*
251
    /*
253
    * We are holding a lock which prevents preemption.
252
    * We are holding a lock which prevents preemption.
254
    * Release the lock, call clock() and reacquire the lock again.
253
    * Release the lock, call clock() and reacquire the lock again.
255
    */
254
    */
256
    spinlock_unlock(&irq->lock);
255
    spinlock_unlock(&irq->lock);
257
    //clock();
256
//  clock();
258
    puts(" ");
-
 
259
    spinlock_lock(&irq->lock);
257
    spinlock_lock(&irq->lock);
260
 
258
 
261
    /* acknowledge tick */
259
    /* acknowledge tick */
262
    *(uint32_t*) gxemul_hw_map.rtc_ack = 0;
260
    *(uint32_t*) gxemul_hw_map.rtc_ack = 0;
263
   
261
   
Line 291... Line 289...
291
{
289
{
292
    return  *((int*)(GXEMUL_MP + GXEMUL_MP_MEMSIZE_OFFSET));
290
    return  *((int*)(GXEMUL_MP + GXEMUL_MP_MEMSIZE_OFFSET));
293
}
291
}
294
 
292
 
295
void gxemul_debug_putc(char ch) {
293
void gxemul_debug_putc(char ch) {
296
    *((volatile char *) GXEMUL_KBD) = ch;
294
//  *((volatile char *) GXEMUL_KBD) = ch;
-
 
295
//TODO commented version doesn't work, don't know why (as ??
-
 
296
    *((char *) gxemul_hw_map.videoram) = ch;
297
}
297
}
298
 
298
 
299
/** @}
299
/** @}
300
 */
300
 */