mm

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PGSIZE = 4 << 10
	// 1-100 Mb memory reverse for kernel image
	MEMSTART = 100 << 20
	// 默认可以使用的物理内存终止地址,如果能从grub那里获取就用grub的
	DEFAULT_MEMTOP = 256 << 20
	// 虚拟内存起始地址
	VMSTART = 1 << 30

	PTE_P = 0x001
	PTE_W = 0x002
	PTE_U = 0x004
)

Variables

This section is empty.

Functions

func Alloc

func Alloc() uintptr

func Fixmap

func Fixmap(va, pa, size uintptr)

func Init

func Init()

func Mmap

func Mmap(va, size uintptr) uintptr

func Munmap

func Munmap(va, size uintptr) bool

func PoolInit

func PoolInit(p *Pool, size uintptr)

size will align ptr size

func Sbrk

func Sbrk(n uintptr) uintptr

func SysFixedMmap

func SysFixedMmap(vaddr, paddr, size uintptr)

SysFixedMmap map the same physical address to the virtual address run in user mode

func SysMmap

func SysMmap(vaddr, size uintptr) uintptr

SysMmap like Mmap but can run in user mode wraper of syscall.Mmap

Types

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

Pool used to manage fixed size memory block

func (*Pool) Alloc

func (p *Pool) Alloc() uintptr

func (*Pool) Free

func (p *Pool) Free(ptr uintptr)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL