Skip to content
Snippets Groups Projects
Commit c3596659 authored by Dor Laor's avatar Dor Laor
Browse files

Fix the bar read|write offset by addint the forgotten base addr

parent 934a112b
No related branches found
No related tags found
No related merge requests found
...@@ -56,12 +56,12 @@ using processor::outl; ...@@ -56,12 +56,12 @@ using processor::outl;
BAR_MMIO = 1, BAR_MMIO = 1,
}; };
u32 read(u32 offset) {return inl(offset);} u32 read(u32 offset) {return inl(_addr+offset);}
u16 readw(u32 offset) {return inw(offset);} u16 readw(u32 offset) {return inw(_addr+offset);}
u8 readb(u32 offset) {return inb(offset);} u8 readb(u32 offset) {return inb(_addr+offset);}
void write(u32 offset, u32 val) {outl(val, offset);} void write(u32 offset, u32 val) {outl(val, _addr+offset);}
void write(u32 offset, u16 val) {outw(val, offset);} void write(u32 offset, u16 val) {outw(val, _addr+offset);}
void write(u32 offset, u8 val) {outb(val, offset);} void write(u32 offset, u8 val) {outb(val, _addr+offset);}
private: private:
u32 _addr; u32 _addr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment