Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4343 → Rev 4344

/branches/dynload/kernel/arch/sparc64/include/types.h
57,7 → 57,9
typedef uint64_t unative_t;
typedef int64_t native_t;
 
typedef uintptr_t ioport_t;
typedef volatile uint8_t ioport8_t;
typedef volatile uint16_t ioport16_t;
typedef volatile uint32_t ioport32_t;
 
typedef struct {
} fncptr_t;
/branches/dynload/kernel/arch/sparc64/include/asm.h
44,49 → 44,49
#include <arch/stack.h>
#include <arch/barrier.h>
 
static inline void pio_write_8(ioport_t port, uint8_t v)
static inline void pio_write_8(ioport8_t *port, uint8_t v)
{
*((volatile uint8_t *)(port)) = v;
*port = v;
memory_barrier();
}
 
static inline void pio_write_16(ioport_t port, uint16_t v)
static inline void pio_write_16(ioport16_t *port, uint16_t v)
{
*((volatile uint16_t *)(port)) = v;
*port = v;
memory_barrier();
}
 
static inline void pio_write_32(ioport_t port, uint32_t v)
static inline void pio_write_32(ioport32_t *port, uint32_t v)
{
*((volatile uint32_t *)(port)) = v;
*port = v;
memory_barrier();
}
 
static inline uint8_t pio_read_8(ioport_t port)
static inline uint8_t pio_read_8(ioport8_t *port)
{
uint8_t rv;
 
rv = *((volatile uint8_t *)(port));
rv = *port;
memory_barrier();
 
return rv;
}
 
static inline uint16_t pio_read_16(ioport_t port)
static inline uint16_t pio_read_16(ioport16_t *port)
{
uint16_t rv;
 
rv = *((volatile uint16_t *)(port));
rv = *port;
memory_barrier();
 
return rv;
}
 
static inline uint32_t pio_read_32(ioport_t port)
static inline uint32_t pio_read_32(ioport32_t *port)
{
uint32_t rv;
 
rv = *((volatile uint32_t *)(port));
rv = *port;
memory_barrier();
 
return rv;
/branches/dynload/kernel/arch/sparc64/include/mm/frame.h
73,7 → 73,6
typedef union frame_address frame_address_t;
 
extern uintptr_t last_frame;
extern uintptr_t end_frame;
extern void frame_arch_init(void);
#define physmem_print()
 
/branches/dynload/kernel/arch/sparc64/include/drivers/z8530.h
File deleted
/branches/dynload/kernel/arch/sparc64/src/console.c
162,16 → 162,6
scr_redraw();
#endif
switch (kbd_type) {
#ifdef CONFIG_Z8530
case KBD_Z8530:
z8530_grab();
break;
#endif
#ifdef CONFIG_NS16550
case KBD_NS16550:
ns16550_grab();
break;
#endif
#ifdef CONFIG_SGCN
case KBD_SGCN:
sgcn_grab();
188,16 → 178,6
void arch_release_console(void)
{
switch (kbd_type) {
#ifdef CONFIG_Z8530
case KBD_Z8530:
z8530_release();
break;
#endif
#ifdef CONFIG_NS16550
case KBD_NS16550:
ns16550_release();
break;
#endif
#ifdef CONFIG_SGCN
case KBD_SGCN:
sgcn_release();
/branches/dynload/kernel/arch/sparc64/src/mm/frame.c
26,7 → 26,7
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/** @addtogroup sparc64mm
/** @addtogroup sparc64mm
* @{
*/
/** @file
41,7 → 41,6
#include <macros.h>
 
uintptr_t last_frame = NULL;
uintptr_t end_frame = NULL;
 
/** Create memory zones according to information stored in bootinfo.
*
80,8 → 79,6
*/
frame_mark_unavailable(ADDR2PFN(KA2PA(PFN2ADDR(0))), 1);
}
end_frame = last_frame;
}
 
/** @}
/branches/dynload/kernel/arch/sparc64/src/mm/page.c
26,7 → 26,7
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/** @addtogroup sparc64mm
/** @addtogroup sparc64mm
* @{
*/
/** @file
164,11 → 164,5
return virtaddr;
}
 
void hw_area(uintptr_t *physaddr, pfn_t *frames)
{
*physaddr = end_frame;
*frames = ADDR2PFN(0x7ffffffffff - end_frame);
}
 
/** @}
*/
/branches/dynload/kernel/arch/sparc64/src/drivers/fhc.c
45,6 → 45,7
#include <mm/slab.h>
#include <arch/types.h>
#include <genarch/ofw/ofw_tree.h>
#include <sysinfo/sysinfo.h>
 
fhc_t *central_fhc = NULL;
 
86,6 → 87,13
 
fhc->uart_imap = (uint32_t *) hw_map(paddr, reg->size);
/*
* Set sysinfo data needed by the uspace FHC driver.
*/
sysinfo_set_item_val("fhc.uart.size", NULL, reg->size);
sysinfo_set_item_val("fhc.uart.physical", NULL, paddr);
sysinfo_set_item_val("kbd.cir.fhc", NULL, 1);
 
return fhc;
}
 
/branches/dynload/kernel/arch/sparc64/src/drivers/kbd.c
47,6 → 47,7
#include <align.h>
#include <func.h>
#include <print.h>
#include <sysinfo/sysinfo.h>
 
kbd_type_t kbd_type = KBD_UNKNOWN;
 
65,6 → 66,13
const char *name;
cir_t cir;
void *cir_arg;
 
#ifdef CONFIG_NS16550
ns16550_t *ns16550;
#endif
#ifdef CONFIG_Z8530
z8530_t *z8530;
#endif
name = ofw_tree_node_name(node);
99,6 → 107,7
uintptr_t pa;
size_t size;
devno_t devno;
inr_t inr;
switch (kbd_type) {
131,7 → 140,6
return;
};
break;
default:
panic("Unexpected keyboard type.");
}
148,14 → 156,42
switch (kbd_type) {
#ifdef CONFIG_Z8530
case KBD_Z8530:
z8530_init(device_assign_devno(),
hw_map(aligned_addr, offset + size) + offset, inr, cir, cir_arg);
devno = device_assign_devno();
z8530 = (z8530_t *) hw_map(aligned_addr, offset + size) +
offset;
(void) z8530_init(z8530, devno, inr, cir, cir_arg);
/*
* This is the necessary evil until the userspace drivers are
* entirely self-sufficient.
*/
sysinfo_set_item_val("kbd", NULL, true);
sysinfo_set_item_val("kbd.type", NULL, KBD_Z8530);
sysinfo_set_item_val("kbd.devno", NULL, devno);
sysinfo_set_item_val("kbd.inr", NULL, inr);
sysinfo_set_item_val("kbd.address.virtual", NULL,
(uintptr_t) z8530);
sysinfo_set_item_val("kbd.address.physical", NULL, pa);
break;
#endif
#ifdef CONFIG_NS16550
case KBD_NS16550:
ns16550_init(device_assign_devno(),
(ioport_t) (hw_map(aligned_addr, offset + size) + offset), inr, cir, cir_arg);
devno = device_assign_devno();
ns16550 = (ns16550_t *) hw_map(aligned_addr, offset + size) +
offset;
(void) ns16550_init(ns16550, devno, inr, cir, cir_arg);
/*
* This is the necessary evil until the userspace driver is
* entirely self-sufficient.
*/
sysinfo_set_item_val("kbd", NULL, true);
sysinfo_set_item_val("kbd.type", NULL, KBD_NS16550);
sysinfo_set_item_val("kbd.devno", NULL, devno);
sysinfo_set_item_val("kbd.inr", NULL, inr);
sysinfo_set_item_val("kbd.address.virtual", NULL,
(uintptr_t) ns16550);
sysinfo_set_item_val("kbd.address.physical", NULL, pa);
break;
#endif
default:
/branches/dynload/kernel/arch/sparc64/src/drivers/sgcn.c
310,7 → 310,7
/**
* The driver works in polled mode, so no interrupt should be handled by it.
*/
static irq_ownership_t sgcn_claim(void *instance)
static irq_ownership_t sgcn_claim(irq_t *irq)
{
return IRQ_DECLINE;
}
381,13 → 381,7
volatile uint32_t *in_rdptr_ptr = &(SGCN_BUFFER_HEADER->in_rdptr);
if (*in_rdptr_ptr != *in_wrptr_ptr) {
if (sgcn_irq.notif_cfg.notify && sgcn_irq.notif_cfg.answerbox) {
ipc_irq_send_notif(&sgcn_irq);
spinlock_unlock(&sgcn_irq.lock);
interrupts_restore(ipl);
spinlock_unlock(&sgcn_input_lock);
return;
}
/* XXX: send notification to userspace */
}
spinlock_unlock(&sgcn_irq.lock);
/branches/dynload/kernel/arch/sparc64/src/drivers/pci.c
44,6 → 44,7
#include <print.h>
#include <func.h>
#include <arch/asm.h>
#include <sysinfo/sysinfo.h>
 
#define SABRE_INTERNAL_REG 0
#define PSYCHO_INTERNAL_REG 2
108,6 → 109,12
pci->op = &pci_sabre_ops;
pci->reg = (uint64_t *) hw_map(paddr, reg[SABRE_INTERNAL_REG].size);
 
/*
* Set sysinfo data needed by the uspace OBIO driver.
*/
sysinfo_set_item_val("obio.base.physical", NULL, paddr);
sysinfo_set_item_val("kbd.cir.obio", NULL, 1);
 
return pci;
}
 
149,6 → 156,12
pci->op = &pci_psycho_ops;
pci->reg = (uint64_t *) hw_map(paddr, reg[PSYCHO_INTERNAL_REG].size);
 
/*
* Set sysinfo data needed by the uspace OBIO driver.
*/
sysinfo_set_item_val("obio.base.physical", NULL, paddr);
sysinfo_set_item_val("kbd.cir.obio", NULL, 1);
 
return pci;
}