pci

package
v0.0.0-...-70d8496 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2019 License: BSD-3-Clause, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VENDOR   int = 0x0
	DEVICE       = 0x02
	STATUS       = 0x06
	CLASS        = 0x0b
	SUBCLASS     = 0x0a
	HEADER       = 0x0e

	BAR5 = 0x24
)
View Source
const (
	PCI_VEND_INTEL = 0x8086
	// PCI_DEV_PIIX3 = 0x7000
	// PCI_DEV_3400  = 0x3b20
	PCI_DEV_X540T     = 0x1528
	PCI_DEV_AHCI_QEMU = 0x2922
	PCI_DEV_AHCI_BHW  = 0x3b22
	PCI_DEV_AHCI_BHWX = 0xa102
	//PCI_DEV_AHCI_BHW2 = 0x8d02 // (0:31:2)
	PCI_DEV_AHCI_BHW2 = 0x8d62 // (0:17:4)
)
View Source
const BSIZE = 4096

Variables

View Source
var INT_DISK int = -1
View Source
var IRQ_DISK int = -1

Functions

func Breakpcitag

func Breakpcitag(b Pcitag_t) (int, int, int)

func Pci_bar_mem

func Pci_bar_mem(tag Pcitag_t, barn int) (uintptr, int)

some memory bars include size in the low bits; this method doesn't mask such bits out.

func Pci_dump

func Pci_dump()

func Pci_read

func Pci_read(tag Pcitag_t, reg, width int) int

width is width of the register in bytes

func Pci_register

func Pci_register(vendor, dev int, attach func(int, int, Pcitag_t))

func Pci_register_intel

func Pci_register_intel(dev int, attach func(int, int, Pcitag_t))

func Pci_write

func Pci_write(tag Pcitag_t, reg, val int)

func Pcibus_attach

func Pcibus_attach()

Types

type Disk_i

type Disk_i interface {
	Start(*Idebuf_t, bool)
	Complete([]uint8, bool)
	Intr() bool
	Int_clear()
}
var Disk Disk_i

our actual disk

type Idebuf_t

type Idebuf_t struct {
	Disk  int
	Block int
	Data  *[BSIZE]uint8
}

XXX delete and the disks that use it?

type Pcitag_t

type Pcitag_t uint

Jump to

Keyboard shortcuts

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