The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
tlb.c File Reference

TLB shootdown (tlb.h). More...

#include "kernel/memory/tlb.h"
#include "arch/arch.h"
#include "arch/arch_cpu.h"
#include "kernel/memory/user_space.h"
#include "kernel/panic.h"
#include "kernel/sync/spinlock.h"

Macros

#define WAIT_LIMIT   (1u << 28)

Functions

void tlb_init (void)
 set up the shootdown.
void tlb_shootdown_user (user_space_t *space, uintptr_t start, uintptr_t end)
 flush [start, end) of a user space on the other cores that have it loaded, and wait until they have flushed.
void tlb_shootdown_kernel (uintptr_t start, uintptr_t end)
 flush [start, end) of the kernel half on all the other cores, and wait until they have flushed.
void tlb_do_pending (void)
 do the flush that another core asks of this core, if there is one.

Detailed Description

TLB shootdown (tlb.h).

Macro Definition Documentation

◆ WAIT_LIMIT

#define WAIT_LIMIT   (1u << 28)

Function Documentation

◆ tlb_init()

void tlb_init ( void )

set up the shootdown.

call once on the boot core, before the other cores start.

◆ tlb_shootdown_user()

void tlb_shootdown_user ( struct user_space * space,
uintptr_t start,
uintptr_t end )

flush [start, end) of a user space on the other cores that have it loaded, and wait until they have flushed.

call it after the change to the page tables and before the frames are freed. any context; interrupts can be on or off.

Parameters
spacethe user space whose page tables changed.
startthe first address, page-aligned.
endthe address after the range.

◆ tlb_shootdown_kernel()

void tlb_shootdown_kernel ( uintptr_t start,
uintptr_t end )

flush [start, end) of the kernel half on all the other cores, and wait until they have flushed.

as tlb_shootdown_user().

Parameters
startthe first address, page-aligned.
endthe address after the range.

◆ tlb_do_pending()

void tlb_do_pending ( void )

do the flush that another core asks of this core, if there is one.

the IPI handler calls it. call it with interrupts off.