forked from AbleOS/ableos
svga device struct updated to mostly reflect real device
This commit is contained in:
parent
d2488689fe
commit
570b566310
|
@ -1,6 +1,29 @@
|
||||||
pci := @use("../../../libraries/pci/src/lib.hb");
|
pci := @use("../../../libraries/pci/src/lib.hb");
|
||||||
.{PCIAddress} := pci
|
.{PCIAddress} := pci
|
||||||
|
|
||||||
|
FIFO := struct {
|
||||||
|
reserved_size: u32,
|
||||||
|
using_bounce_buffer: u8,
|
||||||
|
bounce_buffer: [u8; 1024 * 1024],
|
||||||
|
next_fence: u32,
|
||||||
|
}
|
||||||
|
new_fifo := fn(): FIFO {
|
||||||
|
bounce_buffer := @as([u8; 1024 * 1024], idk)
|
||||||
|
return FIFO.(0, 0, bounce_buffer, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
IRQ := struct {
|
||||||
|
pending: u32,
|
||||||
|
switchContext: u32,
|
||||||
|
//IntrContext oldContext;
|
||||||
|
//IntrContext newContext;
|
||||||
|
count: u32,
|
||||||
|
}
|
||||||
|
|
||||||
|
new_irq := fn(): IRQ {
|
||||||
|
return IRQ.(0, 0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
SVGADevice := struct {
|
SVGADevice := struct {
|
||||||
pciAddr: PCIAddress,
|
pciAddr: PCIAddress,
|
||||||
ioBase: u32,
|
ioBase: u32,
|
||||||
|
@ -15,27 +38,13 @@ SVGADevice := struct {
|
||||||
height: int,
|
height: int,
|
||||||
bpp: int,
|
bpp: int,
|
||||||
pitch: int,
|
pitch: int,
|
||||||
|
fifo: FIFO,
|
||||||
|
irq: IRQ,
|
||||||
}
|
}
|
||||||
|
|
||||||
svga_device := fn(): SVGADevice {
|
svga_device := fn(): SVGADevice {
|
||||||
pci_addr := PCIAddress.(0, 0, 0)
|
pci_addr := PCIAddress.(0, 0, 0)
|
||||||
|
fifo := new_fifo()
|
||||||
return SVGADevice.(pci_addr, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
irq := new_irq()
|
||||||
}
|
return SVGADevice.(pci_addr, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, fifo, irq)
|
||||||
|
}
|
||||||
/*
|
|
||||||
struct {
|
|
||||||
uint32 reservedSize;
|
|
||||||
Bool usingBounceBuffer;
|
|
||||||
uint8 bounceBuffer[1024 * 1024];
|
|
||||||
uint32 nextFence;
|
|
||||||
} fifo;
|
|
||||||
|
|
||||||
volatile struct {
|
|
||||||
uint32 pending;
|
|
||||||
uint32 switchContext;
|
|
||||||
IntrContext oldContext;
|
|
||||||
IntrContext newContext;
|
|
||||||
uint32 count;
|
|
||||||
} irq;
|
|
||||||
*/
|
|
Loading…
Reference in a new issue