Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2083 → Rev 2089

/trunk/kernel/arch/sparc64/_link.ld.in
6,7 → 6,6
*
*/
 
#define __LINKER__
#include <arch/boot/boot.h>
 
ENTRY(kernel_image_start)
/trunk/kernel/arch/sparc64/include/interrupt.h
36,7 → 36,6
#ifndef KERN_sparc64_INTERRUPT_H_
#define KERN_sparc64_INTERRUPT_H_
 
#include <typedefs.h>
#include <arch/types.h>
#include <arch/regdef.h>
 
50,11 → 49,11
IPI_TLB_SHOOTDOWN = VECTOR_TLB_SHOOTDOWN_IPI
};
 
struct istate {
typedef struct {
uint64_t tnpc;
uint64_t tpc;
uint64_t tstate;
};
} istate_t;
 
static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr)
{
71,9 → 70,6
return istate->tpc;
}
 
 
extern void interrupt_register(int n, const char *name, iroutine f);
 
#endif
 
/** @}
/trunk/kernel/arch/sparc64/include/types.h
35,7 → 35,9
#ifndef KERN_sparc64_TYPES_H_
#define KERN_sparc64_TYPES_H_
 
#define NULL 0
#define NULL 0
#define false 0
#define true 1
 
typedef signed char int8_t;
typedef signed short int16_t;
47,6 → 49,10
typedef unsigned int uint32_t;
typedef unsigned long uint64_t;
 
typedef uint64_t size_t;
typedef uint64_t count_t;
typedef uint64_t index_t;
 
typedef uint64_t uintptr_t;
typedef uint64_t pfn_t;
 
55,8 → 61,12
typedef uint64_t unative_t;
typedef int64_t native_t;
 
typedef struct pte pte_t;
typedef uint8_t bool;
typedef uint64_t task_id_t;
typedef uint32_t context_id_t;
 
typedef int32_t inr_t;
typedef int32_t devno_t;
typedef uint8_t asi_t;
 
#endif
/trunk/kernel/arch/sparc64/include/syscall.h
35,8 → 35,8
#ifndef KERN_sparc64_SYSCALL_H_
#define KERN_sparc64_SYSCALL_H_
 
#include <typedefs.h>
#include <arch/types.h>
#include <arch/interrupt.h>
 
extern unative_t syscall(int n, istate_t *istate, unative_t a1, unative_t a2, unative_t a3, unative_t a4);
 
/trunk/kernel/arch/sparc64/include/atomic.h
37,7 → 37,6
 
#include <arch/barrier.h>
#include <arch/types.h>
#include <typedefs.h>
 
/** Atomic add operation.
*
/trunk/kernel/arch/sparc64/include/boot/boot.h
43,7 → 43,6
 
#include <config.h>
#include <arch/types.h>
#include <typedefs.h>
#include <genarch/ofw/ofw_tree.h>
 
#define TASKMAP_MAX_RECORDS 32
/trunk/kernel/arch/sparc64/include/asm.h
35,12 → 35,11
#ifndef KERN_sparc64_ASM_H_
#define KERN_sparc64_ASM_H_
 
#include <arch.h>
#include <typedefs.h>
#include <arch/arch.h>
#include <arch/types.h>
#include <align.h>
#include <arch/register.h>
#include <config.h>
#include <time/clock.h>
#include <arch/stack.h>
 
/** Read Processor State register.
/trunk/kernel/arch/sparc64/include/trap/interrupt.h
105,6 → 105,9
#endif /* __ASM__ */
 
#ifndef __ASM__
 
#include <arch/interrupt.h>
 
extern void interrupt(int n, istate_t *istate);
#endif /* !def __ASM__ */
 
/trunk/kernel/arch/sparc64/include/trap/exception.h
58,7 → 58,7
 
#ifndef __ASM__
 
#include <typedefs.h>
#include <arch/interrupt.h>
 
extern void dump_istate(istate_t *istate);
 
/trunk/kernel/arch/sparc64/include/sparc64.h
0,0 → 1,45
/*
* Copyright (c) 2005 Jakub Jermar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/** @addtogroup sparc64
* @{
*/
/** @file
*/
 
#ifndef KERN_sparc64_SPARC64_H_
#define KERN_sparc64_SPARC64_H_
 
#include <interrupt.h>
 
extern void interrupt_register(int n, const char *name, iroutine f);
 
#endif
 
/** @}
*/
/trunk/kernel/arch/sparc64/include/mm/memory_init.h
35,7 → 35,7
#ifndef KERN_sparc64_MEMORY_INIT_H_
#define KERN_sparc64_MEMORY_INIT_H_
 
#include <typedefs.h>
#include <arch/types.h>
 
extern size_t get_memory_size(void);
 
/trunk/kernel/arch/sparc64/include/mm/page.h
46,9 → 46,9
 
#ifndef __ASM__
 
#include <mm/page.h>
#include <arch/types.h>
#include <genarch/mm/page_ht.h>
//#include <arch/types.h>
//#include <genarch/mm/page_ht.h>
#include <arch/interrupt.h>
 
extern uintptr_t physmem_base;
 
55,16 → 55,14
#define KA2PA(x) (((uintptr_t) (x)) + physmem_base)
#define PA2KA(x) (((uintptr_t) (x)) - physmem_base)
 
union page_address {
typedef union {
uintptr_t address;
struct {
uint64_t vpn : 51; /**< Virtual Page Number. */
unsigned offset : 13; /**< Offset. */
} __attribute__ ((packed));
};
} page_address_t;
 
typedef union page_address page_address_t;
 
extern void page_arch_init(void);
 
#endif /* !def __ASM__ */
/trunk/kernel/arch/sparc64/include/mm/mmu.h
79,10 → 79,9
#include <arch/asm.h>
#include <arch/barrier.h>
#include <arch/types.h>
#include <typedefs.h>
 
/** LSU Control Register. */
union lsu_cr_reg {
typedef union {
uint64_t value;
struct {
unsigned : 23;
100,8 → 99,7
unsigned ic : 1; /**< I-Cache enable. */
} __attribute__ ((packed));
};
typedef union lsu_cr_reg lsu_cr_reg_t;
} lsu_cr_reg_t;
 
#endif /* !def __ASM__ */
 
/trunk/kernel/arch/sparc64/include/mm/tlb.h
76,7 → 76,6
#include <arch/asm.h>
#include <arch/barrier.h>
#include <arch/types.h>
#include <typedefs.h>
 
union tlb_context_reg {
uint64_t v;
/trunk/kernel/arch/sparc64/include/mm/as.h
35,9 → 35,7
#ifndef KERN_sparc64_AS_H_
#define KERN_sparc64_AS_H_
 
#ifdef CONFIG_TSB
#include <arch/mm/tsb.h>
#endif
#include <arch/mm/tte.h>
 
#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH 1
 
46,16 → 44,44
#define USER_ADDRESS_SPACE_START_ARCH (unsigned long) 0x0000000000000000
#define USER_ADDRESS_SPACE_END_ARCH (unsigned long) 0xffffffffffffffff
 
#define USTACK_ADDRESS_ARCH (0xffffffffffffffffULL-(PAGE_SIZE-1))
#define USTACK_ADDRESS_ARCH (0xffffffffffffffffULL - (PAGE_SIZE - 1))
 
#ifdef CONFIG_TSB
 
/** TSB Tag Target register. */
typedef union tsb_tag_target {
uint64_t value;
struct {
unsigned invalid : 1; /**< Invalidated by software. */
unsigned : 2;
unsigned context : 13; /**< Software ASID. */
unsigned : 6;
uint64_t va_tag : 42; /**< Virtual address bits <63:22>. */
} __attribute__ ((packed));
} tsb_tag_target_t;
 
/** TSB entry. */
typedef struct tsb_entry {
tsb_tag_target_t tag;
tte_data_t data;
} __attribute__ ((packed)) tsb_entry_t;
 
typedef struct {
#ifdef CONFIG_TSB
tsb_entry_t *itsb;
tsb_entry_t *dtsb;
#endif /* CONFIG_TSB */
} as_arch_t;
 
#else
 
typedef struct {
} as_arch_t;
 
#endif /* CONFIG_TSB */
 
#include <genarch/mm/as_ht.h>
 
#ifdef CONFIG_TSB
# include <arch/mm/tsb.h>
# define as_invalidate_translation_cache(as, page, cnt) tsb_invalidate(as, page, cnt)
#else
# define as_invalidate_translation_cache(as, page, cnt)
/trunk/kernel/arch/sparc64/include/mm/tsb.h
54,30 → 54,10
#include <arch/mm/tte.h>
#include <arch/mm/mmu.h>
#include <arch/types.h>
#include <typedefs.h>
#include <mm/as.h>
 
/** TSB Tag Target register. */
union tsb_tag_target {
uint64_t value;
struct {
unsigned invalid : 1; /**< Invalidated by software. */
unsigned : 2;
unsigned context : 13; /**< Software ASID. */
unsigned : 6;
uint64_t va_tag : 42; /**< Virtual address bits <63:22>. */
} __attribute__ ((packed));
};
typedef union tsb_tag_target tsb_tag_target_t;
 
/** TSB entry. */
struct tsb_entry {
tsb_tag_target_t tag;
tte_data_t data;
} __attribute__ ((packed));
typedef struct tsb_entry tsb_entry_t;
 
/** TSB Base register. */
union tsb_base_reg {
typedef union tsb_base_reg {
uint64_t value;
struct {
uint64_t base : 51; /**< TSB base address, bits 63:13. */
90,8 → 70,7
unsigned size : 3; /**< TSB size. Number of entries is
* 512 * 2^size. */
} __attribute__ ((packed));
};
typedef union tsb_base_reg tsb_base_reg_t;
} tsb_base_reg_t;
 
/** Read ITSB Base register.
*
/trunk/kernel/arch/sparc64/include/cpu.h
37,6 → 37,7
 
#include <arch/types.h>
#include <arch/register.h>
#include <arch/asm.h>
 
#define MANUF_FUJITSU 0x04
#define MANUF_ULTRASPARC 0x17 /**< UltraSPARC I, UltraSPARC II */
/trunk/kernel/arch/sparc64/include/drivers/z8530.h
36,7 → 36,6
#define KERN_sparc64_Z8530_H_
 
#include <arch/types.h>
#include <typedefs.h>
#include <arch/drivers/kbd.h>
 
#define Z8530_CHAN_A 4
/trunk/kernel/arch/sparc64/include/drivers/tick.h
35,7 → 35,7
#ifndef KERN_sparc64_TICK_H_
#define KERN_sparc64_TICK_H_
 
#include <typedefs.h>
#include <arch/interrupt.h>
 
extern void tick_init(void);
extern void tick_interrupt(int n, istate_t *istate);
/trunk/kernel/arch/sparc64/src/smp/smp.c
42,7 → 42,6
#include <arch/types.h>
#include <synch/synch.h>
#include <synch/waitq.h>
#include <typedefs.h>
#include <print.h>
 
/**
/trunk/kernel/arch/sparc64/src/smp/ipi.c
34,6 → 34,7
 
#include <smp/ipi.h>
#include <cpu.h>
#include <arch.h>
#include <arch/cpu.h>
#include <arch/asm.h>
#include <config.h>
/trunk/kernel/arch/sparc64/src/ddi/ddi.c
35,7 → 35,6
#include <ddi/ddi.h>
#include <proc/task.h>
#include <arch/types.h>
#include <typedefs.h>
 
/** Enable I/O space range for task.
*
/trunk/kernel/arch/sparc64/src/console.c
34,7 → 34,6
 
#include <arch/console.h>
#include <arch/types.h>
#include <typedefs.h>
 
#include <arch/drivers/scr.h>
#include <arch/drivers/kbd.h>
/trunk/kernel/arch/sparc64/src/trap/exception.c
40,7 → 40,6
#include <arch/asm.h>
#include <arch/register.h>
#include <debug.h>
#include <typedefs.h>
#include <symtab.h>
#include <print.h>
 
/trunk/kernel/arch/sparc64/src/trap/trap.c
43,7 → 43,6
#include <memstr.h>
#include <debug.h>
#include <arch/types.h>
#include <typedefs.h>
#include <arch/drivers/tick.h>
 
/** Initialize trap table. */
/trunk/kernel/arch/sparc64/src/trap/syscall.c
38,7 → 38,6
#include <syscall/syscall.h>
#include <panic.h>
#include <arch/types.h>
#include <typedefs.h>
 
unative_t syscall(int n, istate_t *istate, unative_t a1, unative_t a2, unative_t a3, unative_t a4)
{
/trunk/kernel/arch/sparc64/src/trap/interrupt.c
33,10 → 33,10
*/
 
#include <arch/interrupt.h>
#include <arch/sparc64.h>
#include <arch/trap/interrupt.h>
#include <interrupt.h>
#include <ddi/irq.h>
#include <typedefs.h>
#include <arch/types.h>
#include <debug.h>
#include <arch/asm.h>
/trunk/kernel/arch/sparc64/src/cpu/cpu.c
32,14 → 32,11
/** @file
*/
 
#include <arch/asm.h>
#include <cpu.h>
#include <arch.h>
#include <print.h>
#include <arch/register.h>
#include <genarch/ofw/ofw_tree.h>
#include <arch/types.h>
#include <arch/drivers/tick.h>
#include <print.h>
 
/** Perform sparc64 specific initialization of the processor structure for the
* current processor.
/trunk/kernel/arch/sparc64/src/mm/tlb.c
44,7 → 44,6
#include <arch.h>
#include <print.h>
#include <arch/types.h>
#include <typedefs.h>
#include <config.h>
#include <arch/trap/trap.h>
#include <arch/trap/exception.h>
/trunk/kernel/arch/sparc64/src/mm/as.c
34,7 → 34,7
 
#include <arch/mm/as.h>
#include <arch/mm/tlb.h>
#include <genarch/mm/as_ht.h>
#include <genarch/mm/page_ht.h>
#include <genarch/mm/asid_fifo.h>
#include <debug.h>
#include <config.h>
/trunk/kernel/arch/sparc64/src/mm/tsb.c
37,7 → 37,6
#include <arch/barrier.h>
#include <mm/as.h>
#include <arch/types.h>
#include <typedefs.h>
#include <macros.h>
#include <debug.h>
 
/trunk/kernel/arch/sparc64/src/mm/memory_init.c
34,7 → 34,6
 
#include <arch/mm/memory_init.h>
#include <arch/boot/boot.h>
#include <typedefs.h>
 
/** Return total size of available memory in bytes.
*
/trunk/kernel/arch/sparc64/src/drivers/fhc.c
41,10 → 41,9
 
#include <arch/drivers/fhc.h>
#include <arch/trap/interrupt.h>
#include <arch/mm/page.h>
#include <mm/page.h>
#include <mm/slab.h>
#include <arch/types.h>
#include <typedefs.h>
#include <genarch/ofw/ofw_tree.h>
 
fhc_t *central_fhc = NULL;
/trunk/kernel/arch/sparc64/src/drivers/kbd.c
44,7 → 44,6
#include <ddi/irq.h>
#include <arch/mm/page.h>
#include <arch/types.h>
#include <typedefs.h>
#include <align.h>
#include <func.h>
#include <print.h>
/trunk/kernel/arch/sparc64/src/drivers/scr.c
37,7 → 37,6
#include <genarch/fb/fb.h>
#include <genarch/fb/visuals.h>
#include <arch/types.h>
#include <typedefs.h>
#include <func.h>
#include <align.h>
#include <print.h>
/trunk/kernel/arch/sparc64/src/drivers/tick.c
34,9 → 34,9
 
#include <arch/drivers/tick.h>
#include <arch/interrupt.h>
#include <arch/sparc64.h>
#include <arch/asm.h>
#include <arch/register.h>
#include <typedefs.h>
#include <arch/cpu.h>
#include <arch/boot/boot.h>
#include <time/clock.h>
/trunk/kernel/arch/sparc64/src/drivers/pci.c
37,10 → 37,9
#include <arch/drivers/pci.h>
#include <genarch/ofw/ofw_tree.h>
#include <arch/trap/interrupt.h>
#include <arch/mm/page.h>
#include <mm/page.h>
#include <mm/slab.h>
#include <arch/types.h>
#include <typedefs.h>
#include <debug.h>
#include <print.h>
#include <func.h>