aboutsummaryrefslogtreecommitdiff
path: root/i386
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-08-28 13:10:35 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-08-28 13:10:35 +0200
commit4f82ae66628a517585d6bef9465662a45481d024 (patch)
treebfe4affbca50e455b59925b007b19ea096bfb99f /i386
parent30c93547cd14db1ae44ea9e32bf36a2c2b152c07 (diff)
downloadgnumach-4f82ae66628a517585d6bef9465662a45481d024.tar.gz
gnumach-4f82ae66628a517585d6bef9465662a45481d024.tar.bz2
gnumach-4f82ae66628a517585d6bef9465662a45481d024.zip
copyinmsg: Set msgh_size inside copyinmsg rather than the caller
In the 32/64 conversion case it is copyinmsg that will know the eventual size.
Diffstat (limited to 'i386')
-rw-r--r--i386/i386/i386asm.sym2
-rw-r--r--i386/i386/locore.S4
2 files changed, 6 insertions, 0 deletions
diff --git a/i386/i386/i386asm.sym b/i386/i386/i386asm.sym
index 417c040d..9f4ebe55 100644
--- a/i386/i386/i386asm.sym
+++ b/i386/i386/i386asm.sym
@@ -171,3 +171,5 @@ offset shared_info si evtchn_mask EVTMASK
offset shared_info si vcpu_info[0].arch.cr2 CR2
#endif /* MACH_PV_PAGETABLES */
#endif /* MACH_XEN */
+
+offset mach_msg_header msgh msgh_size
diff --git a/i386/i386/locore.S b/i386/i386/locore.S
index 8a1054a6..162bb13a 100644
--- a/i386/i386/locore.S
+++ b/i386/i386/locore.S
@@ -1314,6 +1314,7 @@ ENTRY(copyinmsg)
movl 8+S_ARG0,%esi /* get user start address */
movl 8+S_ARG1,%edi /* get kernel destination address */
movl 8+S_ARG2,%ecx /* get count */
+ movl %ecx,%edx /* save count */
movl $USER_DS,%eax /* use user data segment for accesses */
mov %ax,%ds
@@ -1325,6 +1326,9 @@ ENTRY(copyinmsg)
movsl /* move longwords */
xorl %eax,%eax /* return 0 for success */
+ movl 8+S_ARG1,%edi
+ movl %edx,%es:MSGH_MSGH_SIZE(%edi) /* set msgh_size */
+
copyinmsg_ret:
mov %ss,%di /* restore DS to kernel segment */
mov %di,%ds