public
/
FUZIX.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
74d5108
)
usermem: add MISALIGNED
author
Alan Cox
<alan@linux.intel.com>
Thu, 11 Feb 2016 20:00:26 +0000
(20:00 +0000)
committer
Alan Cox
<alan@linux.intel.com>
Thu, 11 Feb 2016 20:00:26 +0000
(20:00 +0000)
Word sized misaligned user space memory accesses can now be faulted if
desired by the platform
Kernel/usermem.c
patch
|
blob
|
history
diff --git
a/Kernel/usermem.c
b/Kernel/usermem.c
index
5051ffe
..
baadab0
100644
(file)
--- a/
Kernel/usermem.c
+++ b/
Kernel/usermem.c
@@
-45,6
+45,12
@@
uint16_t ugetw(const void *user)
{
if (!valaddr(user, 2))
return -1;
+#ifdef MISALIGNED
+ if (MISALIGNED(user, 2)) }
+ ssig(udata.u_proc, SIGBUS);
+ return -1;
+ }
+#endif
return _ugetw(user);
}
@@
-82,6
+88,12
@@
int uputw(uint16_t value, void *user)
{
if (!valaddr(user, 2))
return -1;
+#ifdef MISALIGNED
+ if (MISALIGNED(user, 2)) }
+ ssig(udata.u_proc, SIGBUS);
+ return -1;
+ }
+#endif
return _uputw(value,user);
}