xen

package
Version: v0.0.0-...-b957d1f Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2017 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DOMID_SELF = 0x7FF0
)

Variables

This section is empty.

Functions

func MemoryBarrier

func MemoryBarrier()

MemoryBarrier issues a full read-write memory barrier.

func MemoryBarrierWrite

func MemoryBarrierWrite()

MemoryBarrierWrite issues a write memory barrier.

Types

type EventChannel

type EventChannel struct {
	Port uint32
}

func NewEventChannel

func NewEventChannel(remote uint32) *EventChannel

func (*EventChannel) Notify

func (ec *EventChannel) Notify()

func (*EventChannel) Wait

func (ec *EventChannel) Wait()

type FrontendRing

type FrontendRing struct {
	RequestProducer  uint32
	ResponseConsumer uint32

	EntrySize  uint32
	EntryCount uint32

	*SharedRing
}

FrontendRing provides the frontend interface to a SharedRing.

func NewFrontendRing

func NewFrontendRing(r *SharedRing, entrySize int) *FrontendRing

NewFrontendRing initializes a new FrontendRing from the provided SharedRing.

entrySize should be the size in bytes of the largest value to be stored in the ring.

func (*FrontendRing) CheckForResponses

func (r *FrontendRing) CheckForResponses() (more bool)

CheckForResponses checks for unconsumed responses, returning true if there is more work to do.

When there is no more work to do, it notifies the backend that all responses have been consumed.

func (*FrontendRing) NextRequest

func (r *FrontendRing) NextRequest() unsafe.Pointer

NextRequest returns a pointer to the next request, advancing the private producer index.

func (*FrontendRing) NextResponse

func (r *FrontendRing) NextResponse() unsafe.Pointer

NextResponse returns a pointer to the next response, advancing the private consumer index.

func (*FrontendRing) PushRequests

func (r *FrontendRing) PushRequests() (notify bool)

PushRequests updates the shared ring so the backend sees all pending requests.

If notify is true, the backend expects to receive an event channel notification.

type GrantTable

type GrantTable struct {
	Entries []GrantTableEntry
	// contains filtered or unexported fields
}

func MapGrantTable

func MapGrantTable() *GrantTable

MapGrantTable maps Xen's shared grant table into memory and returns a pointer to it.

func (*GrantTable) EndAccess

func (t *GrantTable) EndAccess(gref Gref) bool

func (*GrantTable) GrantAccess

func (t *GrantTable) GrantAccess(domid uint16, frame uintptr, readOnly bool) (Gref, bool)

type GrantTableEntry

type GrantTableEntry struct {
	Flags uint16
	DomID uint16
	Frame uint32
}

GrantTableEntry is the V2 grant table entry structure for full pages.

type Gref

type Gref uint32

type SharedRing

type SharedRing struct {
	RequestProducer uint32
	RequestEvent    uint32

	ResponseProducer uint32
	ResponseEvent    uint32

	// The remainder of the ring page is available for data.
	Data [3584]byte
	// contains filtered or unexported fields
}

SharedRing is a shared-memory producer-consumer ring.

It's memory layout is precise, and should be accessed through FrontendRing.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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