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");
|
||||
.{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 {
|
||||
pciAddr: PCIAddress,
|
||||
ioBase: u32,
|
||||
|
@ -15,27 +38,13 @@ SVGADevice := struct {
|
|||
height: int,
|
||||
bpp: int,
|
||||
pitch: int,
|
||||
fifo: FIFO,
|
||||
irq: IRQ,
|
||||
}
|
||||
|
||||
svga_device := fn(): SVGADevice {
|
||||
pci_addr := PCIAddress.(0, 0, 0)
|
||||
|
||||
return SVGADevice.(pci_addr, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
||||
}
|
||||
|
||||
/*
|
||||
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;
|
||||
*/
|
||||
fifo := new_fifo()
|
||||
irq := new_irq()
|
||||
return SVGADevice.(pci_addr, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, fifo, irq)
|
||||
}
|
Loading…
Reference in a new issue