Changeset f1d1f5d3 in mainline


Ignore:
Timestamp:
2006-09-17T20:10:10Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
57da95c
Parents:
06e1e95
Message:

Fix bug in mm/as.c:

  • as_area_destroy() should not work with AS but as

sparc64 work:

  • start implementing TSB support
Location:
kernel
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/include/mm/as.h

    r06e1e95 rf1d1f5d3  
    4545#define USTACK_ADDRESS_ARCH     (USER_ADDRESS_SPACE_END_ARCH-(PAGE_SIZE-1))
    4646
     47typedef struct {
     48} as_arch_t;
     49
    4750#define as_install_arch(as)
     51#define as_invalidate_translation_cache(as, page, cnt)
    4852
    4953extern void as_arch_init(void);
  • kernel/arch/ia32/include/mm/as.h

    r06e1e95 rf1d1f5d3  
    4545#define USTACK_ADDRESS_ARCH     (USER_ADDRESS_SPACE_END_ARCH-(PAGE_SIZE-1))
    4646
     47typedef struct {
     48} as_arch_t;
     49
    4750#define as_install_arch(as)
     51#define as_invalidate_translation_cache(as, page, cnt)
    4852
    4953extern void as_arch_init(void);
  • kernel/arch/ia64/include/mm/as.h

    r06e1e95 rf1d1f5d3  
    4545#define USTACK_ADDRESS_ARCH     0x0000000ff0000000ULL
    4646
     47typedef struct {
     48} as_arch_t;
     49
     50#define as_invalidate_translation_cache(as, page, cnt)
     51
    4752extern void as_arch_init(void);
    4853
  • kernel/arch/mips32/include/mm/as.h

    r06e1e95 rf1d1f5d3  
    4545#define USTACK_ADDRESS_ARCH     (0x80000000-PAGE_SIZE)
    4646
     47typedef struct {
     48} as_arch_t;
     49
     50#define as_invalidate_translation_cache(as, page, cnt)
     51
    4752extern void as_arch_init(void);
    4853
  • kernel/arch/ppc32/include/mm/as.h

    r06e1e95 rf1d1f5d3  
    4545#define USTACK_ADDRESS_ARCH     (0x7fffffff-(PAGE_SIZE-1))
    4646
     47typedef struct {
     48} as_arch_t;
     49
     50#define as_invalidate_translation_cache(as, page, cnt)
     51
    4752extern void as_arch_init(void);
    4853
  • kernel/arch/ppc64/include/mm/as.h

    r06e1e95 rf1d1f5d3  
    4545#define USTACK_ADDRESS_ARCH     (0x7fffffff-(PAGE_SIZE-1))
    4646
     47typedef struct {
     48} as_arch_t;
     49
    4750#define as_install_arch(as)
     51#define as_invalidate_translation_cache(as, page, cnt)
    4852
    4953extern void as_arch_init(void);
  • kernel/arch/sparc64/Makefile.inc

    r06e1e95 rf1d1f5d3  
    108108        arch/$(ARCH)/src/drivers/kbd.c
    109109
     110ifdef CONFIG_TSB
     111ARCH_SOURCES += \
     112        arch/$(ARCH)/src/mm/tsb.c
     113endif
     114
    110115ifdef CONFIG_Z8530
    111116ARCH_SOURCES += \
  • kernel/arch/sparc64/include/mm/as.h

    r06e1e95 rf1d1f5d3  
    3636#define KERN_sparc64_AS_H_
    3737
     38#ifdef CONFIG_TSB
     39#include <arch/mm/tsb.h>
     40#endif
     41
    3842#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH      1
    3943
     
    4549#define USTACK_ADDRESS_ARCH     (0xffffffffffffffffULL-(PAGE_SIZE-1))
    4650
     51typedef struct {
     52#ifdef CONFIG_TSB
     53        tsb_entry_t *itsb;
     54        tsb_entry_t *dtsb;
     55#endif
     56} as_arch_t;
     57
     58#ifdef CONFIG_TSB
     59#       define as_invalidate_translation_cache(as, page, cnt)   tsb_invalidate(as, page, cnt)
     60#else
     61#       define as_invalidate_translation_cache(as, page, cnt)
     62#endif
     63
    4764extern void as_arch_init(void);
    4865
     
    5168/** @}
    5269 */
    53 
  • kernel/arch/xen32/include/mm/as.h

    r06e1e95 rf1d1f5d3  
    4545#define USTACK_ADDRESS_ARCH     (USER_ADDRESS_SPACE_END_ARCH-(PAGE_SIZE-1))
    4646
     47typedef struct {
     48} as_arch_t;
     49
    4750#define as_install_arch(as)
     51#define as_invalidate_translation_cache(as, page, cnt)
    4852
    4953extern void as_arch_init(void);
  • kernel/genarch/src/mm/asid.c

    r06e1e95 rf1d1f5d3  
    123123                 */
    124124                as->asid = ASID_INVALID;
     125               
     126                /*
     127                 * If the architecture uses some software cache
     128                 * of TLB entries (e.g. TSB on sparc64), the
     129                 * cache must be invalidated as well.
     130                 */
     131                as_invalidate_translation_cache(as, 0, 0);
     132               
    125133                mutex_unlock(&as->lock);
    126134
     
    142150
    143151                /*
    144                  * Purge the allocated rid from TLBs.
     152                 * Purge the allocated ASID from TLBs.
    145153                 */
    146154                tlb_shootdown_start(TLB_INVL_ASID, asid, 0, 0);
  • kernel/generic/include/mm/as.h

    r06e1e95 rf1d1f5d3  
    9494        /** Address space identifier. Constant on architectures that do not support ASIDs.*/
    9595        asid_t asid;
     96       
     97        /** Architecture specific content. */
     98        as_arch_t arch;
    9699};
    97100
  • kernel/generic/src/mm/as.c

    r06e1e95 rf1d1f5d3  
    360360                                        i = (start_free - b) >> PAGE_WIDTH;
    361361                                        if (!used_space_remove(area, start_free, c - i))
    362                                                 panic("Could not remove used space.");
     362                                                panic("Could not remove used space.\n");
    363363                                } else {
    364364                                        /*
     
    390390                tlb_invalidate_pages(AS->asid, area->base + pages*PAGE_SIZE, area->pages - pages);
    391391                tlb_shootdown_finalize();
     392               
     393                /*
     394                 * Invalidate software translation caches (e.g. TSB on sparc64).
     395                 */
     396                as_invalidate_translation_cache(as, area->base + pages*PAGE_SIZE, area->pages - pages);
    392397        } else {
    393398                /*
     
    441446         * Start TLB shootdown sequence.
    442447         */
    443         tlb_shootdown_start(TLB_INVL_PAGES, AS->asid, area->base, area->pages);
     448        tlb_shootdown_start(TLB_INVL_PAGES, as->asid, area->base, area->pages);
    444449
    445450        /*
     
    464469                                                b + j*PAGE_SIZE, PTE_GET_FRAME(pte));
    465470                                }
    466                                 page_mapping_remove(as, b + j*PAGE_SIZE);
     471                                page_mapping_remove(as, b + j*PAGE_SIZE);                               
    467472                                page_table_unlock(as, false);
    468473                        }
     
    473478         * Finish TLB shootdown sequence.
    474479         */
    475         tlb_invalidate_pages(AS->asid, area->base, area->pages);
     480        tlb_invalidate_pages(as->asid, area->base, area->pages);
    476481        tlb_shootdown_finalize();
     482       
     483        /*
     484         * Invalidate potential software translation caches (e.g. TSB on sparc64).
     485         */
     486        as_invalidate_translation_cache(as, area->base, area->pages);
    477487       
    478488        btree_destroy(&area->used_space);
     
    488498         * Remove the empty area from address space.
    489499         */
    490         btree_remove(&AS->as_area_btree, base, NULL);
     500        btree_remove(&as->as_area_btree, base, NULL);
    491501       
    492502        free(area);
    493503       
    494         mutex_unlock(&AS->lock);
     504        mutex_unlock(&as->lock);
    495505        interrupts_restore(ipl);
    496506        return 0;
  • kernel/kernel.config

    r06e1e95 rf1d1f5d3  
    108108! [ARCH=ia64] CONFIG_VHPT (n/y)
    109109
     110# Use TSB
     111! [ARCH=sparc64] CONFIG_TSB (n/y)
     112
    110113## Run-time configuration directives
    111114
Note: See TracChangeset for help on using the changeset viewer.