X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/6123a1b5c5c97d90224ffa0dc6706dd7af2ebb9e..6942ebae59c3904674dce6b67cd07c43a3bbe00d:/lunaix-os/arch/x86/hal/rngx86.c diff --git a/lunaix-os/arch/x86/hal/rngx86.c b/lunaix-os/arch/x86/hal/rngx86.c index c444196..2baf96c 100644 --- a/lunaix-os/arch/x86/hal/rngx86.c +++ b/lunaix-os/arch/x86/hal/rngx86.c @@ -56,7 +56,7 @@ __rand_rd(struct device* dev, void* buf, size_t offset, size_t len) } int -pdev_randdev_init(struct device_def* devdef) +pdev_randdev_create(struct device_def* devdef, morph_t* obj) { // FIXME add check on cpuid for presence of rdrand struct device* devrand = device_allocseq(NULL, NULL); @@ -69,7 +69,8 @@ pdev_randdev_init(struct device_def* devdef) } static struct device_def devrandx86_def = { - .name = "x86 On-Chip RNG", - .class = DEVCLASS(DEVIF_SOC, DEVFN_CHAR, DEV_RNG), - .init = pdev_randdev_init}; + def_device_class(INTEL, CHAR, RNG), + def_device_name("x86 On-Chip RNG"), + def_on_create(pdev_randdev_create) +}; EXPORT_DEVICE(randdev, &devrandx86_def, load_onboot); \ No newline at end of file