git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dedicated kthread interface and enablement of lrud auto-recycler
[lunaix-os.git]
/
lunaix-os
/
hal
/
char
/
devnull.c
diff --git
a/lunaix-os/hal/char/devnull.c
b/lunaix-os/hal/char/devnull.c
index 5d0aef5e6f72639dea3f8db0237ce686a2c5b85d..3991548addec6dee0731677d412c00ca55f3fe19 100644
(file)
--- a/
lunaix-os/hal/char/devnull.c
+++ b/
lunaix-os/hal/char/devnull.c
@@
-1,11
+1,11
@@
#include <lunaix/device.h>
#include <lunaix/device.h>
-#include <lunaix/mm/page.h>
+#include <lunaix/mm/page
table
.h>
static int
__null_wr_pg(struct device* dev, void* buf, size_t offset)
{
// do nothing
static int
__null_wr_pg(struct device* dev, void* buf, size_t offset)
{
// do nothing
- return P
G
_SIZE;
+ return P
AGE
_SIZE;
}
static int
}
static int
@@
-30,20
+30,22
@@
__null_rd(struct device* dev, void* buf, size_t offset, size_t len)
}
static int
}
static int
-pdev_nulldev_
init(struct device_def* def
)
+pdev_nulldev_
create(struct device_def* def, morph_t* obj
)
{
{
- struct device* devnull = device_a
ddseq(NULL, &def->class, NULL, "null"
);
+ struct device* devnull = device_a
llocseq(NULL, NULL
);
devnull->ops.write_page = __null_wr_pg;
devnull->ops.write = __null_wr;
devnull->ops.read_page = __null_rd_pg;
devnull->ops.read = __null_rd;
devnull->ops.write_page = __null_wr_pg;
devnull->ops.write = __null_wr;
devnull->ops.read_page = __null_rd_pg;
devnull->ops.read = __null_rd;
+ register_device(devnull, &def->class, "null");
+
return 0;
}
static struct device_def devnull_def = {
return 0;
}
static struct device_def devnull_def = {
-
.name = "null"
,
-
.class = DEVCLASS(DEVIF_NON, DEVFN_PSEUDO, DEV_BUILTIN, 0
),
- .init = pdev_nulldev_init
+
def_device_name("edendi")
,
+
def_device_class(LUNAIX, PSEUDO, NIHIL
),
+ def_on_create(pdev_nulldev_create)
};
};
-EXPORT_DEVICE(nulldev, &devnull_def, load_
earlystage
);
+EXPORT_DEVICE(nulldev, &devnull_def, load_
onboot
);