common

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2017 License: MIT Imports: 9 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoUnpackHandler = errors.New("no kernel.Unpack() handler defined")
View Source
var UnknownUnpackType = errors.New("kernel.Unpack() does not support type")

Functions

func RegArgs

func RegArgs(u models.Usercorn, regs []int) func(n int) ([]uint64, error)

func StackArgs

func StackArgs(u models.Usercorn) func(n int) ([]uint64, error)

Types

type Buf

type Buf struct {
	Addr uint64
	K    *KernelBase
}

func NewBuf

func NewBuf(k Kernel, addr uint64) Buf

func (Buf) Pack

func (b Buf) Pack(i interface{}) error

func (Buf) Struc

func (b Buf) Struc() *models.StrucStream

func (Buf) Unpack

func (b Buf) Unpack(i interface{}) error

type Fd

type Fd int32

func (Fd) File

func (f Fd) File() *os.File

type Kernel

type Kernel interface {
	UsercornKernel() *KernelBase
}

type KernelBase

type KernelBase struct {
	Syscalls map[string]Syscall
	U        models.Usercorn
	Argjoy   argjoy.Argjoy
	Pack     func(b Buf, i interface{}) error
}

func (*KernelBase) UsercornKernel

func (k *KernelBase) UsercornKernel() *KernelBase

type Len

type Len uint64

type Obuf

type Obuf struct{ Buf }

type Off

type Off int64

type Ptr

type Ptr uint64

type Syscall

type Syscall struct {
	Name     string
	Kernel   *KernelBase
	Instance reflect.Value
	Method   reflect.Method
	In       []reflect.Type
	Out      []reflect.Type
	ObufArr  bool
	UintArr  bool
}

func Lookup

func Lookup(u models.Usercorn, kf Kernel, name string) *Syscall

func (Syscall) Call

func (sys Syscall) Call(args []uint64) uint64

Call a syscall from the dispatch table. Will panic() if anything goes terribly wrong.

func (Syscall) Trace

func (s Syscall) Trace(regs []uint64) string

func (Syscall) TraceRet

func (s Syscall) TraceRet(args []uint64, ret uint64) string

Jump to

Keyboard shortcuts

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