summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2004-01-13 22:49:45 +0000
committerobrien <obrien@FreeBSD.org>2004-01-13 22:49:45 +0000
commitdb0a9fc4de11e1379d9f2ca83f0208e6fa37e91d (patch)
treef7039b7597d74a7bd77879221a1b7a3c7d1302ff
parent2b3359f55f4200f40771fd330e14978be4e36b84 (diff)
downloadFreeBSD-src-db0a9fc4de11e1379d9f2ca83f0208e6fa37e91d.zip
FreeBSD-src-db0a9fc4de11e1379d9f2ca83f0208e6fa37e91d.tar.gz
AMD64 has a single MS-Win calling convention, so provide an empty __stdcall.
Centralize the definition to make it easier to change.
-rw-r--r--sys/compat/ndis/kern_ndis.c1
-rw-r--r--sys/compat/ndis/pe_var.h14
-rw-r--r--sys/compat/ndis/subr_hal.c5
-rw-r--r--sys/compat/ndis/subr_ndis.c1
-rw-r--r--sys/compat/ndis/subr_ntoskrnl.c1
-rw-r--r--sys/compat/ndis/subr_pe.c6
6 files changed, 14 insertions, 14 deletions
diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c
index e98ab76..d94d25c 100644
--- a/sys/compat/ndis/kern_ndis.c
+++ b/sys/compat/ndis/kern_ndis.c
@@ -75,7 +75,6 @@ __FBSDID("$FreeBSD$");
#include <compat/ndis/cfg_var.h>
#include <dev/if_ndis/if_ndisvar.h>
-#define __stdcall __attribute__((__stdcall__))
#define NDIS_DUMMY_PATH "\\\\some\\bogus\\path"
__stdcall static void ndis_status_func(ndis_handle, ndis_status,
diff --git a/sys/compat/ndis/pe_var.h b/sys/compat/ndis/pe_var.h
index 5178449..e62e5eb 100644
--- a/sys/compat/ndis/pe_var.h
+++ b/sys/compat/ndis/pe_var.h
@@ -408,6 +408,20 @@ struct image_patch_table {
typedef struct image_patch_table image_patch_table;
+/*
+ * Note: Windows uses the _stdcall calling convention. This means
+ * that the callback functions provided in the function table must
+ * be declared using __attribute__((__stdcall__)), otherwise the
+ * Windows code will likely screw up the %esp register and cause
+ * us to jump to an invalid address when it returns.
+ */
+
+#ifdef __amd64__
+#define __stdcall
+#else
+#define __stdcall __attribute__((__stdcall__))
+#endif
+
__BEGIN_DECLS
extern int pe_get_dos_header(vm_offset_t, image_dos_header *);
extern int pe_is_nt_image(vm_offset_t);
diff --git a/sys/compat/ndis/subr_hal.c b/sys/compat/ndis/subr_hal.c
index 32e8df1..9c8e86b 100644
--- a/sys/compat/ndis/subr_hal.c
+++ b/sys/compat/ndis/subr_hal.c
@@ -55,11 +55,6 @@ __FBSDID("$FreeBSD$");
#include <compat/ndis/hal_var.h>
#include <compat/ndis/ntoskrnl_var.h>
-#ifdef __amd64__
-#define __stdcall
-#else
-#define __stdcall __attribute__((__stdcall__))
-#endif
#define FUNC void(*)(void)
__stdcall static void hal_stall_exec_cpu(uint32_t);
diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c
index 8d5393c..e7c6a2e 100644
--- a/sys/compat/ndis/subr_ndis.c
+++ b/sys/compat/ndis/subr_ndis.c
@@ -100,7 +100,6 @@ __FBSDID("$FreeBSD$");
#include <compat/ndis/cfg_var.h>
#include <dev/if_ndis/if_ndisvar.h>
-#define __stdcall __attribute__((__stdcall__))
#define FUNC void(*)(void)
static struct mtx *ndis_interlock;
diff --git a/sys/compat/ndis/subr_ntoskrnl.c b/sys/compat/ndis/subr_ntoskrnl.c
index f986389..1d9c1cc 100644
--- a/sys/compat/ndis/subr_ntoskrnl.c
+++ b/sys/compat/ndis/subr_ntoskrnl.c
@@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$");
#include <compat/ndis/ndis_var.h>
#include <compat/ndis/ntoskrnl_var.h>
-#define __stdcall __attribute__((__stdcall__))
#define __regparm __attribute__((regparm(3)))
#define FUNC void(*)(void)
diff --git a/sys/compat/ndis/subr_pe.c b/sys/compat/ndis/subr_pe.c
index e947496..b1480cf 100644
--- a/sys/compat/ndis/subr_pe.c
+++ b/sys/compat/ndis/subr_pe.c
@@ -575,12 +575,6 @@ pe_functbl_match(functbl, name)
* Note that there are actually two copies of the jump table: one
* copy is left alone. In a .SYS file, the jump tables are usually
* merged into the INIT segment.
- *
- * Note: Windows uses the _stdcall calling convention. This means
- * that the callback functions provided in the function table must
- * be declared using __attribute__((__stdcall__)), otherwise the
- * Windows code will likely screw up the %esp register and cause
- * us to jump to an invalid address when it returns.
*/
int
OpenPOWER on IntegriCloud