Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2413 → Rev 2414

/branches/arm/kernel/arch/arm32/include/mm/asid.h
31,6 → 31,8
*/
/** @file
* @brief ASIDs related declarations.
*
* ARM CPUs doesn't support ASIDs.
*/
 
#ifndef KERN_arm32_ASID_H_
43,10 → 45,11
typedef uint8_t asid_t;
 
 
/* this works due to fact that this file is never included alone but only
through "generic/include/mm/asid.h" where ASID_START is defined
*/
#define asid_get() ( ASID_START + 1 )
/* this works due to fact that this file is never included alone but only
throught "generic/include/mm/asid.h" where ASID_START is defined
*/
 
#define asid_put(asid)
 
#endif
/branches/arm/kernel/arch/arm32/include/mm/page_fault.h
32,8 → 32,9
/** @file
* @brief Page fault related declarations.
*/
 
#ifndef KERN_arm32_PAGE_FAULT_H_
#define KERN_arm32_PAGE_FAULT_H
#define KERN_arm32_PAGE_FAULT_H_
 
#include <arch/types.h>
 
/branches/arm/kernel/arch/arm32/src/exception.c
161,7 → 161,7
* can not be used because of nested interrupts (which can occur
* because interrupt are enabled in higher levels of interrupt handler).
*/
inline static void switchToIrqServicingMode()
inline static void switch_to_irq_servicing_mode()
{
/* switch to Undefined mode */
asm volatile(
283,7 → 283,7
asm("sub lr, lr, #4");
setup_stack_and_save_regs();
switchToIrqServicingMode();
switch_to_irq_servicing_mode();
CALL_EXC_DISPATCH(EXC_IRQ)
 
/branches/arm/kernel/arch/arm32/src/ddi/ddi.c
30,7 → 30,7
* @{
*/
/** @file
* @brief DDI, not used on ARM.
* @brief DDI.
*/
 
#include <ddi/ddi.h>
37,7 → 37,7
#include <proc/task.h>
#include <arch/types.h>
 
/** Enable I/O space range for task (not used on ARM).
/** Enable I/O space range for task.
*
* Interrupts are disabled and task is locked.
*
/branches/arm/kernel/arch/arm32/src/mm/memory_init.c
37,7 → 37,7
#include <arch/mm/page.h>
#include <arch/machine.h>
 
/** Determine instaled memory size
/** Returns memory size.
*
* @return Memory size in bytes
*/
/branches/arm/kernel/arch/arm32/src/drivers/gxemul.c
46,7 → 46,7
#include <arch/debug/print.h>
 
 
/** Addresses of devices. */
/* Addresses of devices. */
#define GXEMUL_VIDEORAM 0x10000000
#define GXEMUL_KBD 0x10000000
#define GXEMUL_HALT_OFFSET 0x10
61,25 → 61,25
#define GXEMUL_FB 0x12000000
 
 
/** IRQs */
/* IRQs */
#define GXEMUL_KBD_IRQ 2
#define GXEMUL_TIMER_IRQ 4
 
static gxemul_hw_map_t gxemul_hw_map;
static chardev_t console;
static irq_t gxemul_irq;
static irq_t gxemul_console_irq;
static irq_t gxemul_timer_irq;
 
static bool hw_map_init_called = false;
 
static void gxemul_kbd_enable(chardev_t *dev);
static void gxemul_kbd_disable(chardev_t *dev);
static void gxemul_write(chardev_t *dev, const char ch);
static void gxemul_enable(chardev_t *dev);
static void gxemul_disable(chardev_t *dev);
static char gxemul_do_read(chardev_t *dev);
 
static chardev_operations_t gxemul_ops = {
.resume = gxemul_enable,
.suspend = gxemul_disable,
.resume = gxemul_kbd_enable,
.suspend = gxemul_kbd_disable,
.write = gxemul_write,
.read = gxemul_do_read,
};
129,7 → 129,11
}
 
 
/** Putchar that works with gxemul */
/** Putchar that works with gxemul.
*
* @param dev Not used.
* @param ch Characted to be printed.
*/
static void gxemul_write(chardev_t *dev, const char ch)
{
*((char *) gxemul_hw_map.videoram) = ch;
136,15 → 140,25
}
 
 
/* Called from getc(). */
static void gxemul_enable(chardev_t *dev)
/** Enables gxemul keyboard (interrupt unmasked).
*
* @param dev Not used.
*
* Called from getc().
*/
static void gxemul_kbd_enable(chardev_t *dev)
{
gxemul_irqc_unmask(GXEMUL_KBD_IRQ);
}
 
 
/* Called from getc(). */
static void gxemul_disable(chardev_t *dev)
/** Disables gxemul keyboard (interrupt masked).
*
* @param dev not used
*
* Called from getc().
*/
static void gxemul_kbd_disable(chardev_t *dev)
{
gxemul_irqc_mask(GXEMUL_KBD_IRQ);
}
171,7 → 185,11
}
 
 
/** Process keyboard interrupt. */
/** Process keyboard interrupt.
*
* @param irq IRQ information.
* @param arg Not used.
*/
static void gxemul_irq_handler(irq_t *irq, void *arg, ...)
{
if ((irq->notif_cfg.notify) && (irq->notif_cfg.answerbox)) {
201,9 → 219,9
void gxemul_grab_console(void)
{
ipl_t ipl = interrupts_disable();
spinlock_lock(&gxemul_irq.lock);
gxemul_irq.notif_cfg.notify = false;
spinlock_unlock(&gxemul_irq.lock);
spinlock_lock(&gxemul_console_irq.lock);
gxemul_console_irq.notif_cfg.notify = false;
spinlock_unlock(&gxemul_console_irq.lock);
interrupts_restore(ipl);
}
 
212,11 → 230,11
void gxemul_release_console(void)
{
ipl_t ipl = interrupts_disable();
spinlock_lock(&gxemul_irq.lock);
if (gxemul_irq.notif_cfg.answerbox) {
gxemul_irq.notif_cfg.notify = true;
spinlock_lock(&gxemul_console_irq.lock);
if (gxemul_console_irq.notif_cfg.answerbox) {
gxemul_console_irq.notif_cfg.notify = true;
}
spinlock_unlock(&gxemul_irq.lock);
spinlock_unlock(&gxemul_console_irq.lock);
interrupts_restore(ipl);
}
 
231,12 → 249,12
stdin = &console;
stdout = &console;
irq_initialize(&gxemul_irq);
gxemul_irq.devno = devno;
gxemul_irq.inr = GXEMUL_KBD_IRQ;
gxemul_irq.claim = gxemul_claim;
gxemul_irq.handler = gxemul_irq_handler;
irq_register(&gxemul_irq);
irq_initialize(&gxemul_console_irq);
gxemul_console_irq.devno = devno;
gxemul_console_irq.inr = GXEMUL_KBD_IRQ;
gxemul_console_irq.claim = gxemul_claim;
gxemul_console_irq.handler = gxemul_irq_handler;
irq_register(&gxemul_console_irq);
gxemul_irqc_unmask(GXEMUL_KBD_IRQ);
271,18 → 289,6
*/
static void gxemul_timer_irq_handler(irq_t *irq, void *arg, ...)
{
/* TODO time drifts ??
unsigned long drift;
 
drift = cp0_count_read() - nextcount;
while (drift > cp0_compare_value) {
drift -= cp0_compare_value;
CPU->missed_clock_ticks++;
}
nextcount = cp0_count_read() + cp0_compare_value - drift;
cp0_compare_write(nextcount);
*/
 
/*
* We are holding a lock which prevents preemption.
* Release the lock, call clock() and reacquire the lock again.
293,11 → 299,6
 
/* acknowledge tick */
*(uint32_t*) gxemul_hw_map.rtc_ack = 0;
/* TODO what's that? *
if (virtual_timer_fnc != NULL)
virtual_timer_fnc();
*/
}
 
 
/branches/arm/uspace/libc/arch/arm32/src/entry.s
1,5 → 1,5
#
# Copyright (c) 2006 Jakub Jermar
# Copyright (c) 2007 Michal Kebrt, Pavel Jancik
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without