path: root/common
diff options
authorSascha Hauer <>2019-02-04 14:00:50 +0100
committerSascha Hauer <>2019-02-06 08:31:13 +0100
commitd60e9aa5f5a21374950dfd15bedafeccf76c3b1d (patch)
treee50c6df4a5f508ecfcd8fe727b5c23a397ec4189 /common
parent1455e221ae3023270a4716be6b47c038249955fd (diff)
misc: fix /dev/mem size
The size of /dev/mem was limited to the lower half of the 64bit address range. This is unfortunate since on some architectures (MIPS64, namely) the upper half contains meaningful addresses. We can't just set /dev/mem to its real size since that's bigger than the maximum loff_t. Set the DEVFS_IS_CHARACTER_DEV flag instead for /dev/mem which will cause the size checks in lseek and friends to be bypassed. Also fix the size the memory device is registered with. We used to set the size to ~0, but the real size is one higher. To do this explicitly register the device with specifying the end address rather than the size. This will make /dev/mem appear with filesize 0, but so does /dev/zero already. Signed-off-by: Sascha Hauer <>
Diffstat (limited to 'common')
0 files changed, 0 insertions, 0 deletions