Changeset 7910cff in mainline for arch


Ignore:
Timestamp:
2005-12-11T13:31:33Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a98d2ec
Parents:
442d0ae
Message:

Finer grained TLB invalidate functions for ia32 and amd64. Not yet deployed.

Location:
arch
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/include/asm.h

    r442d0ae r7910cff  
    3333#include <config.h>
    3434
    35 
    36 void asm_delay_loop(__u32 t);
    37 void asm_fake_loop(__u32 t);
     35extern void asm_delay_loop(__u32 t);
     36extern void asm_fake_loop(__u32 t);
    3837
    3938/** Return base address of current stack.
     
    229228}
    230229
     230/** Invalidate TLB Entry.
     231 *
     232 * @param addr Address on a page whose TLB entry is to be invalidated.
     233 */
     234static inline void invlpg(__address addr)
     235{
     236        __asm__ volatile ("invlpg %0\n" :: "m" (addr));
     237}
    231238
    232239extern size_t interrupt_handler_size;
  • arch/ia32/include/asm.h

    r442d0ae r7910cff  
    4343
    4444
    45 void asm_delay_loop(__u32 t);
    46 void asm_fake_loop(__u32 t);
     45extern void asm_delay_loop(__u32 t);
     46extern void asm_fake_loop(__u32 t);
    4747
    4848
     
    236236}
    237237
     238/** Invalidate TLB Entry.
     239 *
     240 * @param addr Address on a page whose TLB entry is to be invalidated.
     241 */
     242static inline void invlpg(__address addr)
     243{
     244        __asm__ volatile ("invlpg %0\n" :: "m" (addr));
     245}
     246
    238247#endif
  • arch/ia32/src/mm/tlb.c

    r442d0ae r7910cff  
    3030#include <arch/mm/asid.h>
    3131#include <arch/asm.h>
     32#include <arch/types.h>
    3233
    3334/** Invalidate all TLB entries
     
    4142        write_cr3(read_cr3());
    4243}
     44
     45/** Invalidate all entries in TLB. */
     46void tlb_invalidate_all(void)
     47{
     48        write_cr3(read_cr3());
     49}
     50
     51/** Invalidate all entries in TLB that belong to specified address space.
     52 *
     53 * @param asid This parameter is ignored as the architecture doesn't support it.
     54 */
     55void tlb_invalidate_asid(asid_t asid)
     56{
     57        tlb_invalidate_all();
     58}
     59
     60/** Invalidate TLB entry for specified page belongs to specified address space.
     61 *
     62 * @param asid This parameter is ignored as the architecture doesn't support it.
     63 * @param page Address of the page whose entry is to be invalidated.
     64 */
     65void tlb_invalidate_page(asid_t asid, __address page)
     66{
     67        invlpg(page);
     68}
Note: See TracChangeset for help on using the changeset viewer.