Strict Standards: Declaration of action_plugin_importoldchangelog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /DISK2/WWW/pavel-rimsky.cz/helenos/lib/plugins/importoldchangelog/action.php on line 8 Strict Standards: Declaration of action_plugin_importoldindex::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /DISK2/WWW/pavel-rimsky.cz/helenos/lib/plugins/importoldindex/action.php on line 0 Deprecated: Function split() is deprecated in /DISK2/WWW/pavel-rimsky.cz/helenos/inc/auth.php on line 154 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /DISK2/WWW/pavel-rimsky.cz/helenos/inc/auth.php on line 456 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /DISK2/WWW/pavel-rimsky.cz/helenos/inc/auth.php on line 456 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /DISK2/WWW/pavel-rimsky.cz/helenos/inc/auth.php on line 453 Index: kernel/arch/sparc64/include/mm/mmu.h =================================================================== --- kernel/arch/sparc64/include/mm/mmu.h (revision 3489) +++ kernel/arch/sparc64/include/mm/mmu.h (working copy) @@ -54,7 +54,12 @@ #define VA_IMMU_SFSR 0x18 /**< IMMU sync fault status register. */ #define VA_IMMU_TSB_BASE 0x28 /**< IMMU TSB base register. */ #define VA_IMMU_TAG_ACCESS 0x30 /**< IMMU TLB tag access register. */ +#if defined (US3) +#define VA_IMMU_PRIMARY_EXTENSION 0x48 /**< IMMU TSB primary extension register */ +#define VA_IMMU_NUCLEUS_EXTENSION 0x58 /**< IMMU TSB nucleus extension register */ +#endif + /* D-MMU ASIs. */ #define ASI_DMMU 0x58 #define ASI_DMMU_TSB_8KB_PTR_REG 0x59 @@ -75,6 +80,11 @@ #define VA_DMMU_TAG_ACCESS 0x30 /**< DMMU TLB tag access register. */ #define VA_DMMU_VA_WATCHPOINT_REG 0x38 /**< DMMU VA data watchpoint register. */ #define VA_DMMU_PA_WATCHPOINT_REG 0x40 /**< DMMU PA data watchpoint register. */ +#if defined (US3) +#define VA_DMMU_PRIMARY_EXTENSION 0x48 /**< DMMU TSB primary extension register */ +#define VA_DMMU_SECONDARY_EXTENSION 0x50 /**< DMMU TSB secondary extension register */ +#define VA_DMMU_NUCLEUS_EXTENSION 0x58 /**< DMMU TSB nucleus extension register */ +#endif #ifndef __ASM__ Index: kernel/arch/sparc64/include/mm/tsb.h =================================================================== --- kernel/arch/sparc64/include/mm/tsb.h (revision 3488) +++ kernel/arch/sparc64/include/mm/tsb.h (working copy) @@ -107,6 +107,55 @@ asi_u64_write(ASI_DMMU, VA_DMMU_TSB_BASE, v); } +#if defined (US3) + +/** Write DTSB Primary Extension register. + * + * @param v New content of the DTSB Primary Extension register. + */ +static inline void dtsb_primary_extension_write(uint64_t v) +{ + asi_u64_write(ASI_DMMU, VA_DMMU_PRIMARY_EXTENSION, v); +} + +/** Write DTSB Secondary Extension register. + * + * @param v New content of the DTSB Secondary Extension register. + */ +static inline void dtsb_secondary_extension_write(uint64_t v) +{ + asi_u64_write(ASI_DMMU, VA_DMMU_SECONDARY_EXTENSION, v); +} + +/** Write DTSB Nucleus Extension register. + * + * @param v New content of the DTSB Nucleus Extension register. + */ +static inline void dtsb_nucleus_extension_write(uint64_t v) +{ + asi_u64_write(ASI_DMMU, VA_DMMU_NUCLEUS_EXTENSION, v); +} + +/** Write ITSB Primary Extension register. + * + * @param v New content of the ITSB Primary Extension register. + */ +static inline void itsb_primary_extension_write(uint64_t v) +{ + asi_u64_write(ASI_IMMU, VA_IMMU_PRIMARY_EXTENSION, v); +} + +/** Write ITSB Nucleus Extension register. + * + * @param v New content of the ITSB Nucleus Extension register. + */ +static inline void itsb_nucleus_extension_write(uint64_t v) +{ + asi_u64_write(ASI_IMMU, VA_IMMU_NUCLEUS_EXTENSION, v); +} + +#endif + /* Forward declarations. */ struct as; struct pte; Index: kernel/arch/sparc64/src/ddi/ddi.c =================================================================== --- kernel/arch/sparc64/src/ddi/ddi.c (revision 3488) +++ kernel/arch/sparc64/src/ddi/ddi.c (working copy) @@ -41,7 +41,7 @@ * Interrupts are disabled and task is locked. * * @param task Task. - * @param ioaddr Startign I/O space address. + * @param ioaddr Starting I/O space address. * @param size Size of the enabled I/O range. * * @return 0 on success or an error code from errno.h. Index: kernel/arch/sparc64/src/mm/tlb.c =================================================================== --- kernel/arch/sparc64/src/mm/tlb.c (revision 3488) +++ kernel/arch/sparc64/src/mm/tlb.c (working copy) @@ -92,6 +92,10 @@ * @param locked True for permanent mappings, false otherwise. * @param cacheable True if the mapping is cacheable, false otherwise. */ +// jen takove shrnuti toho, co mame zamceno +// - kernel, 4M od 0x400000 +// - spousta stranek, ktere mapuji HW zarizeni (viz page.c) +// - TSBcka, ktera se nevesla do kernelske stranky void dtlb_insert_mapping(uintptr_t page, uintptr_t frame, int pagesize, bool locked, bool cacheable) { @@ -103,7 +107,7 @@ pg.address = page; fr.address = frame; - tag.value = ASID_KERNEL; + tag.context = ASID_KERNEL; tag.vpn = pg.vpn; dtlb_tag_access_write(tag.value); Index: kernel/arch/sparc64/src/mm/as.c =================================================================== --- kernel/arch/sparc64/src/mm/as.c (revision 3488) +++ kernel/arch/sparc64/src/mm/as.c (working copy) @@ -53,10 +53,11 @@ { if (config.cpu_active == 1) { as_operations = &as_ht_operations; - asid_fifo_init(); + asid_fifo_init(); // alokuj pole o 8190 prvcich a nastrka do nej prvky 2, 3, 4, ..., 8191 (0 je kontext kernelu, 1 je vyhrazeno pro neplatny kontext) } } +// Tuto funkci zavola slab alokator pri vytvoreni objektu typu "as". int as_constructor_arch(as_t *as, int flags) { #ifdef CONFIG_TSB @@ -64,9 +65,11 @@ * The order must be calculated with respect to the emulated * 16K page size. */ + // order bude # ramcu, ktere zabira tabulka int order = fnzb32(((ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) * sizeof(tsb_entry_t)) >> FRAME_WIDTH); + // naalokujeme misto pro tsb, FRAME_KA znamena, ze se ma vratit kernelska adresa (nikoliv fyzicka adresa) uintptr_t tsb = (uintptr_t) frame_alloc(order, flags | FRAME_KA); if (!tsb) @@ -82,6 +85,7 @@ return 0; } +// Tuto funkci zavola slab alokator pri ruseni objektu typu "as". int as_destructor_arch(as_t *as) { #ifdef CONFIG_TSB @@ -98,6 +102,9 @@ #endif } +// Tato funkce se zavola ihned pote, co slab alokator vrati objekt typu AS. +// Ukolem teto fce je vycistit objekt AS (ktery predtim mohl pouzivat nekdo jiny +// - slab alokator znovuvyuziva nalokovane objekty). int as_create_arch(as_t *as, int flags) { #ifdef CONFIG_TSB @@ -130,6 +137,7 @@ * secondary context register from the TL=1 code just before switch to * userspace. */ + // funkce switch_to_userspace (z TL = 1) zkopiruje secondary ctx. register do primary ctx. register ctx.v = 0; ctx.context = as->asid; mmu_secondary_context_write(ctx.v); @@ -141,6 +149,14 @@ uintptr_t tsb = (uintptr_t) as->arch.itsb; + // bacha, bacha, bacha!!! Ta magicka konstanta "8" se bude muset prepsat, pokud by se zvetsil pocet polozek + // v TSB. + // Nerozumim nekolika vecem. + // Za prve, TSB zabira 8 stranek, ale my premapujeme jenom jednu. + // Zadruhe, Jakub v diplomce pise, ze TSB zabira jen jednu stranku. + // Za treti, kdyz se TSB alokuje pomoci frame alokatoru a (coz se v teto funkci pripousti) to frame alokator naalokuj + // nekde mimo tu 4MB kernelovskou uzamcenou stranku, jakto, ze konstruktor AS (asi o 2 fce vys) + // neselze, kdyz dovnitr TLB saha (kdyz to neni namapovano)? if (!overlaps(tsb, 8 * MMU_PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) { /* * TSBs were allocated from memory not covered @@ -148,7 +164,7 @@ * to map both TSBs explicitly. */ dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_NUCLEUS, tsb); - dtlb_insert_mapping(tsb, KA2PA(tsb), PAGESIZE_64K, true, true); + dtlb_insert_mapping(tsb, KA2PA(tsb), PAGESIZE_64K, true, true); // namapuje v kontextu 0 } /* @@ -164,7 +180,25 @@ itsb_base_write(tsb_base.value); tsb_base.base = ((uintptr_t) as->arch.dtsb) >> MMU_PAGE_WIDTH; dtsb_base_write(tsb_base.value); + +#if defined (US3) + /* + * Clear the extension registers. + * In HelenOS, primary and secondary context registers contain + * equal values and kernel misses (context 0, ie. the nucleus context) + * are excluded from the TSB miss handler, so it makes no sense + * to have separate TSBs for primary, secondary and nucleus contexts. + * Clearing the extension registers will ensure that the value of the + * TSB Base register will be used as an address of TSB, making the code + * compatible with the US port. + */ + itsb_primary_extension_write(0); + itsb_nucleus_extension_write(0); + dtsb_primary_extension_write(0); + dtsb_secondary_extension_write(0); + dtsb_nucleus_extension_write(0); #endif +#endif } /** Perform sparc64-specific tasks when an address space is removed from the Index: kernel/arch/sparc64/src/mm/cache.S =================================================================== --- kernel/arch/sparc64/src/mm/cache.S (revision 3488) +++ kernel/arch/sparc64/src/mm/cache.S (working copy) @@ -1,3 +1,7 @@ +// no, ony fce z tohoto souboru stejne nikdo nikdy nevola... Nevim, jestli jsou v souladu s US-III, +// ale zatim to nebudu kontrolovat. NEZAPOMEN SI ALE NEKAM POZNAMENAT, ZE SE MAS SEMHLE JESTE PODIVAT!!! + + /* * Copyright (c) 2006 Jakub Jermar * All rights reserved. @@ -35,6 +39,7 @@ .register %g3, #scratch /** Flush the whole D-cache. */ +// nejak jsem nevidel poradne zdokumentovany registr ASI_DCACHE_TAG, navic netusim, co je to "SF" .global dcache_flush dcache_flush: set (DCACHE_SIZE - DCACHE_LINE_SIZE), %g1 Index: kernel/arch/sparc64/src/mm/frame.c =================================================================== --- kernel/arch/sparc64/src/mm/frame.c (revision 3488) +++ kernel/arch/sparc64/src/mm/frame.c (working copy) @@ -60,7 +60,9 @@ * The memmap is created by HelenOS boot loader. * It already contains no holes. */ - + // nejak mi tu chybi vysvetleni toho, proc + // 1. nulty ramec oznacime za nealokovatelny (dobre, to bych byl jeste schopen pripustit) + // 2. ale hlavne, proc to confdata nesoupneme do ramce cislo 1, ale do 2? confdata = ADDR2PFN(start); if (confdata == ADDR2PFN(KA2PA(PFN2ADDR(0)))) confdata = ADDR2PFN(KA2PA(PFN2ADDR(2))); @@ -78,6 +80,9 @@ * here, no matter what is its address. */ frame_mark_unavailable(ADDR2PFN(KA2PA(PFN2ADDR(0))), 1); + + // jinak co se tyce oznaceni ramcu, v nichz jsou kernel, stack a init tasky za nealokovatelne, + // tak to se tady neresi. Genericky kod vse osetri. } } Index: kernel/arch/sparc64/src/mm/page.c =================================================================== --- kernel/arch/sparc64/src/mm/page.c (revision 3488) +++ kernel/arch/sparc64/src/mm/page.c (working copy) @@ -61,6 +61,13 @@ /** Perform sparc64 specific initialization of paging. */ void page_arch_init(void) { + // co se tyce volani teto funkce, tak + // - nejprve se zavola pro BSP (v main.c, volanim page_init()) + // - teprve o dost dal se vytvori vlakno kinit, to vytvori vlakno kmp a to probudi APs + // - a teprve tehdy, kdyz uz jsou APs probuzeny, zavola se pro ne tato funkce + + // tady se nastavi operace jako je vlozeni mapovani, smazani mapovani,... + // jeste pozor, ze v as.c je neco podobneho, ale tam se nastavi operace pro vytvoreni AS (tj. hashmapy), zruseni... if (config.cpu_active == 1) { page_mapping_operations = &ht_mapping_operations; } else { @@ -71,6 +78,8 @@ /* * Copy locked DTLB entries from the BSP. */ + // to pole bsp_locked_dtlb_entries se pouziva v podstate pouze pro stranky s pametove mapovanymi zarizenimi (a aktualizuje se z te druhe fce v tomhletom souboru) + // kernel je uzamcen ve vsech SMP, protoze se zamknul uz ve start.S, jeste v kodu spolecnem pro BSP a AP for (i = 0; i < bsp_locked_dtlb_entries; i++) { dtlb_insert_mapping(bsp_locked_dtlb_entry[i].virt_page, bsp_locked_dtlb_entry[i].phys_page, @@ -89,12 +98,15 @@ * lock in DTLB. * * @param physaddr Physical address of the page where the device is located. - * Must be at least page-aligned. + * Must be at least page-aligned. * @param size Size of the device's registers. Must not exceed 4M and must * include extra space caused by the alignment. * * @return Virtual address of the page where the device is mapped. */ +// vybereme vhodnou virtualni adresu, ktera se na zadanou fyzickou namapuje +// a potom namapujeme tolik sousednich stranek (o "vhodne", ale stejne velikosti), +// aby se namapoval blok o velikosti "size" uintptr_t hw_map(uintptr_t physaddr, size_t size) { unsigned int order; @@ -104,9 +116,11 @@ struct { int pagesize_code; - size_t increment; + size_t increment; // jak daleko budou zacatky jednotlivych naalokovanych stranek od sebe, 0, pokud se alokuje jenom 1 stranka count_t count; } sizemap[] = { + // pole urcuje, jak velke stranku alokovat a kolik jich naalokovat + // kazda polozka odpovida jednomu "order" promenne "size" { PAGESIZE_8K, 0, 1 }, /* 8K */ { PAGESIZE_8K, MMU_PAGE_SIZE, 2 }, /* 16K