https://archive.kernel.org/oldlinux/htmldocs/kernel-api/API-cdev-init.html

  • put_user(type val, type *address)

    • #include <asm/uaccess.h>
    • store the value val to user space address address
    • type can be 8, 16, 32, 64 bit (depends on hardware)
  • get_user(type val, type *address)

    • #include <asm/uaccess.h>
    • get the value val from user space address address
  • unsigned long copy_to_user(void __user *to, const void *from, unsigned long n)

    • #include <linux/uaccess.h>
    • copy nbytes from kernel-space to user-space
  • unsigned long copy_from_user(void *to, const void __user *from, unsigned long n)

    • #include <linux/uaccess.h>
    • copy n bytes from user-space to kernel-space