apic

package
v0.0.0-...-f78bcf1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package apic implements a driver for Intel Local (LAPIC) and I/O (IOAPIC) Advanced Programmable Interrupt Controllers adopting the following reference specifications:

  • Intel® 64 and IA-32 Architectures Software Developer’s Manual - Volume 3A - Chapter 10
  • 82093AA I/O Advanced Programmable Interrupt Controller (IOAPIC)

This package is only meant to be used with `GOOS=tamago` as supported by the TamaGo framework for bare metal Go, see https://github.com/usbarmory/tamago.

Index

Constants

View Source
const (
	// LAPIC and IOAPICs supported vectors
	MinVector = 16
	MaxVector = 255
)
View Source
const (
	IOREGSEL = 0x00
	IOWIN    = 0x10

	IOAPICID = 0x00

	IOAPICVER   = 0x01
	VER_ENTRIES = 16

	IOAPICREDTBLn  = 0x10
	REDTBL_DEST    = 56
	REDTBL_MASK    = 16
	REDTBL_DESTMOD = 11
	REDTBL_INTVEC  = 0
)

I/O APIC registers

View Source
const (
	LAPICID  = 0x20
	LAPICVER = 0x30
	LAPICEOI = 0xb0

	LAPICSVR   = 0xf0
	SVR_ENABLE = 8
)

LAPIC registers

Variables

This section is empty.

Functions

This section is empty.

Types

type IOAPIC

type IOAPIC struct {
	// Controller index
	Index int
	// Base register
	Base uint32
	// Global System Interrupt Base
	GSIBase int
}

IOAPIC represents an I/O APIC instance.

func (*IOAPIC) EnableInterrupt

func (io *IOAPIC) EnableInterrupt(index int, id int)

EnableInterrupt activates an IOAPIC redirection table entry at the corresponding index for the desired interrupt vector.

func (*IOAPIC) Entries

func (io *IOAPIC) Entries() int

Entries returns the size of the IOAPIC redirection table.

func (*IOAPIC) ID

func (io *IOAPIC) ID() uint32

ID returns the IOAPIC identification.

func (*IOAPIC) Init

func (io *IOAPIC) Init()

Init initializes the I/O APIC.

func (*IOAPIC) Version

func (io *IOAPIC) Version() uint32

Version returns the IOAPIC version register.

type LAPIC

type LAPIC struct {
	// Base register
	Base uint32
}

LAPIC represents a Local APIC instance.

func (*LAPIC) ClearInterrupt

func (io *LAPIC) ClearInterrupt()

ClearInterrupt signals the end of an interrupt handling routine.

func (*LAPIC) Disable

func (io *LAPIC) Disable()

Disable disables the Local APIC.

func (*LAPIC) Enable

func (io *LAPIC) Enable()

Enable enables the Local APIC.

func (*LAPIC) Entries

func (io *LAPIC) Entries() int

Entries returns the size of the LAPIC local vector table.

func (*LAPIC) ID

func (io *LAPIC) ID() uint32

ID returns the LAPIC identification register.

func (*LAPIC) Version

func (io *LAPIC) Version() uint32

Version returns the LAPIC version register.

Jump to

Keyboard shortcuts

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