In a 64-bit system, when registering a tty device, you must note that android runs in el0 and 32-Bit mode, and the kernel runs in el1 and 64-Bit mode, not only does the kernel need to enable the config_compat option, but IOCTL called by many Android upper-layer applications must also provide the corresponding compat_ioctl () function in the underlying driver module;
When registering the TTY callback function, 32-bit registers the ioctl callback function. 64-bit registers the compat_ioctl callback. An error callback is registered when the eCall tool is added a few days ago, as a result, the kernel function cannot be successfully called through the serial port and cannot be accessed into the CTL callback. At the same time, the kernel must process get_user and copy_from_user when receiving parameters transmitted by the user State, in the 64-bit kernel, the pointer is 8 bytes, and the user-state pointer is 4 bytes. You need to adapt it. For details, refer to the kernel code, the kernel is widely used.
64-bit kernel registration tty device