fixed some stuff
This commit is contained in:
parent
6214398f1e
commit
d236a9e348
2 changed files with 6 additions and 7 deletions
|
@ -7,15 +7,15 @@ void *operator new(size_t s) {
|
||||||
void *operator new[](size_t s) {
|
void *operator new[](size_t s) {
|
||||||
return (void*)(*pmm, (s+4095)/4096);
|
return (void*)(*pmm, (s+4095)/4096);
|
||||||
}
|
}
|
||||||
void *operator delete(void *p) {
|
void operator delete(void *p) {
|
||||||
(*pmm)((phys_t)p,1);
|
(*pmm)((phys_t)p,1);
|
||||||
}
|
}
|
||||||
void *operator delete[](void *p) {
|
void operator delete[](void *p) {
|
||||||
(*pmm)((phys_t)p,1);
|
(*pmm)((phys_t)p,1);
|
||||||
}
|
}
|
||||||
void *operator delete(void *p, size_t s) {
|
void operator delete(void *p, size_t s) {
|
||||||
(*pmm)((phys_t)p,(s+4095)/4096);
|
(*pmm)((phys_t)p,(s+4095)/4096);
|
||||||
}
|
}
|
||||||
void *operator delete[](void *p, size_t s) {
|
void operator delete[](void *p, size_t s) {
|
||||||
(*pmm)((phys_t)p,(s+4095)/4096);
|
(*pmm)((phys_t)p,(s+4095)/4096);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <function.hpp>
|
#include <function.hpp>
|
||||||
|
#include <stdint.h>
|
||||||
struct PXIcmd {
|
struct PXIcmd {
|
||||||
uint32_t conid;
|
uint32_t conid;
|
||||||
uint32_t cmdid;
|
uint32_t cmdid;
|
||||||
|
@ -23,13 +24,11 @@ struct PXI {
|
||||||
function<PXIreply(PXIcmd)> pxi_handlers[16];
|
function<PXIreply(PXIcmd)> pxi_handlers[16];
|
||||||
uint32_t connid;
|
uint32_t connid;
|
||||||
PXI();
|
PXI();
|
||||||
~PXI();
|
|
||||||
|
|
||||||
void set_cmd_handler(uint32_t cmd, function<PXIreply(PXIcmd)> handler);
|
void set_cmd_handler(uint32_t cmd, function<PXIreply(PXIcmd)> handler);
|
||||||
void send_cmd(PXIcmd command, function<void(PXIreplay)> callback);
|
void send_cmd(PXIcmd command, function<void(PXIreply)> callback);
|
||||||
void main_loop();
|
void main_loop();
|
||||||
|
|
||||||
void
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern PXI pxi;
|
extern PXI pxi;
|
||||||
|
|
Loading…
Reference in a new issue