Subversion Repositories HelenOS-historic

Compare Revisions

No changes between revisions

Ignore whitespace Rev 755 → Rev 756

/kernel/trunk/arch/sparc64/include/mm/frame.h
31,7 → 31,8
 
#include <arch/types.h>
 
#define FRAME_SIZE 8192
#define FRAME_WIDTH 13
#define FRAME_SIZE (1<<FRAME_WIDTH)
 
union frame_address {
__address address;
/kernel/trunk/arch/sparc64/include/mm/page.h
38,11 → 38,10
#define KA2PA(x) ((__address) (x))
#define PA2KA(x) ((__address) (x))
 
#define GET_PTL0_ADDRESS_ARCH() 0
#define SET_PTL0_ADDRESS_ARCH(ptl0)
#define SET_PTL0_ADDRESS_ARCH(x) /**< To be removed as situation permits. */
 
/** Implementation of page hash table interface. */
#define HT_ENTRIES_ARCH 0
#define HT_WIDTH_ARCH 20 /* 1M */
#define HT_HASH_ARCH(page, asid) 0
#define HT_COMPARE_ARCH(page, asid, t) 0
#define HT_SLOT_EMPTY_ARCH(t) 1
/kernel/trunk/arch/sparc64/include/mm/as.h
42,4 → 42,6
 
#define as_install_arch(as)
 
extern void as_arch_init(void);
 
#endif
/kernel/trunk/arch/sparc64/Makefile.inc
64,6 → 64,7
arch/$(ARCH)/src/console.c \
arch/$(ARCH)/src/context.S \
arch/$(ARCH)/src/dummy.s \
arch/$(ARCH)/src/mm/as.c \
arch/$(ARCH)/src/mm/frame.c \
arch/$(ARCH)/src/mm/page.c \
arch/$(ARCH)/src/mm/tlb.c \
/kernel/trunk/arch/sparc64/src/mm/as.c
0,0 → 1,36
/*
* Copyright (C) 2006 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.
*/
 
#include <arch/mm/as.h>
#include <genarch/mm/as_ht.h>
 
/** Architecture dependent address space init. */
void as_arch_init(void)
{
as_operations = &as_ht_operations;
}
/kernel/trunk/arch/ia64/include/mm/page.h
43,11 → 43,10
#define KA2PA(x) ((__address) (x))
#define PA2KA(x) ((__address) (x))
 
#define GET_PTL0_ADDRESS_ARCH() ((pte_t *) 0)
#define SET_PTL0_ADDRESS_ARCH(ptl0)
#define SET_PTL0_ADDRESS_ARCH(x) /**< To be removed as situation permits. */
 
/** Implementation of page hash table interface. */
#define HT_ENTRIES_ARCH (VHPT_SIZE/sizeof(pte_t))
#define HT_WIDTH_ARCH 20 /* 1M */
#define HT_HASH_ARCH(page, asid) vhpt_hash((page), (asid))
#define HT_COMPARE_ARCH(page, asid, t) vhpt_compare((page), (asid), (t))
#define HT_SLOT_EMPTY_ARCH(t) ((t)->present.tag.tag_info.ti)
/kernel/trunk/arch/ia64/include/mm/as.h
42,4 → 42,6
 
#define as_install_arch(as)
 
extern void as_arch_init(void);
 
#endif
/kernel/trunk/arch/ia64/Makefile.inc
64,6 → 64,7
arch/$(ARCH)/src/cpu/cpu.c \
arch/$(ARCH)/src/ivt.S \
arch/$(ARCH)/src/interrupt.c \
arch/$(ARCH)/src/mm/as.c \
arch/$(ARCH)/src/mm/frame.c \
arch/$(ARCH)/src/mm/page.c \
arch/$(ARCH)/src/mm/tlb.c \
/kernel/trunk/arch/ia64/src/mm/tlb.c
33,11 → 33,7
#include <mm/tlb.h>
#include <arch/mm/asid.h>
 
/** Invalidate all TLB entries.
*
* Because of ASID management, region registers must be reset
* with new RIDs derived from the potentionally new ASID.
*/
/** Invalidate all TLB entries. */
void tlb_invalidate_all(void)
{
/* TODO */
/kernel/trunk/arch/ia64/src/mm/as.c
0,0 → 1,36
/*
* Copyright (C) 2006 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.
*/
 
#include <arch/mm/as.h>
#include <genarch/mm/as_ht.h>
 
/** Architecture dependent address space init. */
void as_arch_init(void)
{
as_operations = &as_ht_operations;
}
/kernel/trunk/arch/ppc32/include/mm/as.h
42,4 → 42,6
 
#define as_install_arch(as)
 
extern void as_arch_init(void);
 
#endif
/kernel/trunk/arch/ppc32/Makefile.inc
60,6 → 60,7
arch/$(ARCH)/src/start.S \
arch/$(ARCH)/src/asm.S \
arch/$(ARCH)/src/cpu/cpu.c \
arch/$(ARCH)/src/mm/as.c \
arch/$(ARCH)/src/mm/frame.c \
arch/$(ARCH)/src/mm/memory_init.c \
arch/$(ARCH)/src/mm/page.c
/kernel/trunk/arch/ppc32/src/mm/as.c
0,0 → 1,36
/*
* Copyright (C) 2006 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.
*/
 
#include <arch/mm/as.h>
#include <genarch/mm/as_pt.h>
 
/** Architecture dependent address space init. */
void as_arch_init(void)
{
as_operations = &as_pt_operations;
}
/kernel/trunk/arch/amd64/include/mm/as.h
42,4 → 42,6
 
#define as_install_arch(as)
 
extern void as_arch_init(void);
 
#endif
/kernel/trunk/arch/amd64/Makefile.inc
87,6 → 87,7
arch/$(ARCH)/src/amd64.c \
arch/$(ARCH)/src/bios/bios.c \
arch/$(ARCH)/src/interrupt.c \
arch/$(ARCH)/src/mm/as.c \
arch/$(ARCH)/src/mm/frame.c \
arch/$(ARCH)/src/mm/page.c \
arch/$(ARCH)/src/mm/tlb.c \
/kernel/trunk/arch/amd64/src/mm/as.c
0,0 → 1,0
link ../../../ia32/src/mm/as.c
Property changes:
Added: svn:special
+*
\ No newline at end of property
/kernel/trunk/arch/amd64/src/mm/page.c
38,32 → 38,24
#include <memstr.h>
#include <interrupt.h>
 
static __address bootstrap_dba;
 
void page_arch_init(void)
{
__address dba;
__address cur;
 
if (config.cpu_active == 1) {
page_operations = &page_pt_operations;
dba = frame_alloc(FRAME_KA | FRAME_PANIC, ONE_FRAME, NULL);
memsetb(dba, PAGE_SIZE, 0);
 
bootstrap_dba = dba;
 
/*
* PA2KA(identity) mapping for all frames.
*/
for (cur = 0; cur < last_frame; cur += FRAME_SIZE) {
page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, PAGE_CACHEABLE | PAGE_EXEC, KA2PA(dba));
page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, PAGE_CACHEABLE | PAGE_EXEC);
}
 
exc_register(14, "page_fault", page_fault);
write_cr3(KA2PA(dba));
write_cr3((__address) AS_KERNEL->page_table);
}
else {
write_cr3(KA2PA(bootstrap_dba));
write_cr3((__address) AS_KERNEL->page_table);
}
}
/kernel/trunk/arch/mips32/include/mm/as.h
41,4 → 41,6
#define USTACK_ADDRESS_ARCH (0x80000000-PAGE_SIZE)
#define UDATA_ADDRESS_ARCH 0x01001000
 
extern void as_arch_init(void);
 
#endif
/kernel/trunk/arch/mips32/src/mm/tlb.c
339,7 → 339,7
/*
* Check if the mapping exists in page tables.
*/
pte = page_mapping_find(AS, badvaddr, 0);
pte = page_mapping_find(AS, badvaddr);
if (pte && pte->lo.v) {
/*
* Mapping found in page tables.
356,7 → 356,7
* The higher-level page fault handler succeeded,
* The mapping ought to be in place.
*/
pte = page_mapping_find(AS, badvaddr, 0);
pte = page_mapping_find(AS, badvaddr);
ASSERT(pte && pte->lo.v);
return pte;
}
/kernel/trunk/arch/mips32/src/mm/as.c
27,6 → 27,7
*/
 
#include <arch/mm/as.h>
#include <genarch/mm/as_pt.h>
#include <arch/mm/tlb.h>
#include <mm/tlb.h>
#include <mm/as.h>
33,6 → 34,12
#include <arch/cp0.h>
#include <arch.h>
 
/** Architecture dependent address space init. */
void as_arch_init(void)
{
as_operations = &as_pt_operations;
}
 
/** Install address space.
*
* Install ASID.
56,3 → 63,4
spinlock_unlock(&as->lock);
interrupts_restore(ipl);
}
 
/kernel/trunk/arch/ia32/include/mm/as.h
42,4 → 42,6
 
#define as_install_arch(as)
 
extern void as_arch_init(void);
 
#endif
/kernel/trunk/arch/ia32/Makefile.inc
110,6 → 110,7
arch/$(ARCH)/src/pm.c \
arch/$(ARCH)/src/userspace.c \
arch/$(ARCH)/src/cpu/cpu.c \
arch/$(ARCH)/src/mm/as.c \
arch/$(ARCH)/src/mm/frame.c \
arch/$(ARCH)/src/mm/memory_init.c \
arch/$(ARCH)/src/mm/page.c \
/kernel/trunk/arch/ia32/src/smp/smp.c
66,9 → 66,9
 
if (config.cpu_count > 1) {
page_mapping_insert(AS_KERNEL, (__address) l_apic, (__address) l_apic,
PAGE_NOT_CACHEABLE, 0);
PAGE_NOT_CACHEABLE);
page_mapping_insert(AS_KERNEL, (__address) io_apic, (__address) io_apic,
PAGE_NOT_CACHEABLE, 0);
PAGE_NOT_CACHEABLE);
}
 
/*
/kernel/trunk/arch/ia32/src/mm/as.c
0,0 → 1,36
/*
* Copyright (C) 2006 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.
*/
 
#include <arch/mm/as.h>
#include <genarch/mm/as_pt.h>
 
/** Architecture dependent address space init. */
void as_arch_init(void)
{
as_operations = &as_pt_operations;
}
/kernel/trunk/arch/ia32/src/mm/page.c
42,32 → 42,24
#include <print.h>
#include <interrupt.h>
 
static __address bootstrap_dba;
 
void page_arch_init(void)
{
__address dba;
__address cur;
 
if (config.cpu_active == 1) {
page_operations = &page_pt_operations;
dba = frame_alloc(FRAME_KA | FRAME_PANIC, ONE_FRAME, NULL);
memsetb(dba, PAGE_SIZE, 0);
 
bootstrap_dba = dba;
/*
* PA2KA(identity) mapping for all frames until last_frame.
*/
for (cur = 0; cur < last_frame; cur += FRAME_SIZE)
page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, PAGE_CACHEABLE, KA2PA(dba));
page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, PAGE_CACHEABLE);
 
exc_register(14, "page_fault", page_fault);
write_cr3(KA2PA(dba));
write_cr3((__address) AS_KERNEL->page_table);
}
else {
write_cr3(KA2PA(bootstrap_dba));
write_cr3((__address) AS_KERNEL->page_table);
}
 
paging_on();
/kernel/trunk/arch/ia32/src/drivers/ega.c
59,7 → 59,7
{
__u8 hi, lo;
 
page_mapping_insert(AS_KERNEL, PA2KA(VIDEORAM), VIDEORAM, PAGE_NOT_CACHEABLE, 0);
page_mapping_insert(AS_KERNEL, PA2KA(VIDEORAM), VIDEORAM, PAGE_NOT_CACHEABLE);
outb(0x3d4,0xe);
hi = inb(0x3d5);
outb(0x3d4,0xf);