X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/2236410f4582ab45ae8c384dd6eeeef5d10aab15..28c176b668c841a3b7fb093faccf0efa39257603:/lunaix-os/hal/char/devzero.c diff --git a/lunaix-os/hal/char/devzero.c b/lunaix-os/hal/char/devzero.c index f976c26..9013a47 100644 --- a/lunaix-os/hal/char/devzero.c +++ b/lunaix-os/hal/char/devzero.c @@ -1,13 +1,13 @@ #include -#include +#include #include static int __zero_rd_pg(struct device* dev, void* buf, size_t offset) { - memset(&((u8_t*)buf)[offset], 0, PG_SIZE); - return PG_SIZE; + memset(&((u8_t*)buf)[offset], 0, PAGE_SIZE); + return PAGE_SIZE; } static int @@ -24,7 +24,7 @@ pdev_zerodev_init(struct device_def* def) devzero->ops.read_page = __zero_rd_pg; devzero->ops.read = __zero_rd; - device_register(devzero, &def->class, "zero"); + register_device(devzero, &def->class, "zero"); return 0; } @@ -32,6 +32,5 @@ pdev_zerodev_init(struct device_def* def) static struct device_def devzero_def = { .name = "zero", .class = DEVCLASSV(DEVIF_NON, DEVFN_PSEUDO, DEV_ZERO, DEV_BUILTIN_ZERO), - .init = pdev_zerodev_init -}; + .init = pdev_zerodev_init}; EXPORT_DEVICE(zerodev, &devzero_def, load_onboot);