summaryrefslogtreecommitdiff
path: root/com32/lib/sys/entry.S
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-11-20 18:51:54 -0800
committerH. Peter Anvin <hpa@zytor.com>2007-11-20 18:51:54 -0800
commit033b7497db0d920bdc9f776ef3a65a7b65723ff0 (patch)
tree4406117dcc52d863b53c79cd3d41fa395cc79c50 /com32/lib/sys/entry.S
parent0188c20b01e4c5702108390eae6ea60a0af0a8e5 (diff)
downloadsyslinux-033b7497db0d920bdc9f776ef3a65a7b65723ff0.tar.gz
Add support for thunking cdecl/stdcall-style real-mode code
Add support for thunking cdecl/stdcall-style 16-bit functions which pass parameters on the stack. This is necessary in order to be able to call PnPBIOS functions without using the (rather scary) PM interface.
Diffstat (limited to 'com32/lib/sys/entry.S')
-rw-r--r--com32/lib/sys/entry.S10
1 files changed, 6 insertions, 4 deletions
diff --git a/com32/lib/sys/entry.S b/com32/lib/sys/entry.S
index be42c8b2..c959c091 100644
--- a/com32/lib/sys/entry.S
+++ b/com32/lib/sys/entry.S
@@ -1,6 +1,6 @@
# -----------------------------------------------------------------------
#
-# Copyright 2003-2004 H. Peter Anvin - All Rights Reserved
+# Copyright 2003-2007 H. Peter Anvin - All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
@@ -27,7 +27,9 @@
# COM32 start up code - must be linked first in the binary
-
+/* Number of arguments in our version of the entry structure */
+#define COM32_ARGS 6
+
.section ".init","ax"
.globl _start
.type _start, @function
@@ -49,7 +51,7 @@ _start:
# Copy COM32 invocation parameters
leal 4(%esp),%esi # Argument list
movl $__com32,%edi
- movl $5,%ecx
+ movl $COM32_ARGS,%ecx
movl %esp,-4(%edi) # Save the initial stack ptr
cmpl (%esi),%ecx
jbe 1f
@@ -87,4 +89,4 @@ _start:
.globl __entry_esp
__entry_esp: .space 4
.globl __com32
-__com32: .space 4*6
+__com32: .space 4*(COM32_ARGS+1)