Author: kib
Date: Wed Sep 21 10:35:44 2016
New Revision: 306091
URL: https://svnweb.freebsd.org/changeset/base/306091

Log:
  Add a way for the architecture to specify the calling ABI for methods
  in the EFI Runtime Services Table.  On amd64, the calling conventions
  are MS.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:    1 week

Added:
  head/sys/amd64/include/efi.h   (contents, props changed)
  head/sys/arm/include/efi.h   (contents, props changed)
  head/sys/arm64/include/efi.h   (contents, props changed)
Modified:
  head/sys/sys/efi.h

Added: head/sys/amd64/include/efi.h
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/amd64/include/efi.h        Wed Sep 21 10:35:44 2016        
(r306091)
@@ -0,0 +1,42 @@
+/*-
+ * Copyright (c) 2016 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Konstantin Belousov <k...@freebsd.org>
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __AMD64_INCLUDE_EFI_H_
+#define __AMD64_INCLUDE_EFI_H_
+
+/*
+ * XXX: from gcc 6.2 manual:
+ * Note, the ms_abi attribute for Microsoft Windows 64-bit targets
+ * currently requires the -maccumulate-outgoing-args option.
+ */
+#define        EFIABI_ATTR     __attribute__((ms_abi))
+
+#endif /* __AMD64_INCLUDE_EFI_H_ */

Added: head/sys/arm/include/efi.h
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/include/efi.h  Wed Sep 21 10:35:44 2016        (r306091)
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2016 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Konstantin Belousov <k...@freebsd.org>
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __ARM_INCLUDE_EFI_H_
+#define __ARM_INCLUDE_EFI_H_
+
+#define        EFIABI_ATTR
+
+#endif /* __ARM_INCLUDE_EFI_H_ */

Added: head/sys/arm64/include/efi.h
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm64/include/efi.h        Wed Sep 21 10:35:44 2016        
(r306091)
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2016 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Konstantin Belousov <k...@freebsd.org>
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __ARM64_INCLUDE_EFI_H_
+#define __ARM64_INCLUDE_EFI_H_
+
+#define        EFIABI_ATTR
+
+#endif /* __ARM64_INCLUDE_EFI_H_ */

Modified: head/sys/sys/efi.h
==============================================================================
--- head/sys/sys/efi.h  Wed Sep 21 10:22:46 2016        (r306090)
+++ head/sys/sys/efi.h  Wed Sep 21 10:35:44 2016        (r306091)
@@ -30,6 +30,7 @@
 #define _SYS_EFI_H_
 
 #include <sys/uuid.h>
+#include <machine/efi.h>
 
 #define        EFI_PAGE_SHIFT          12
 #define        EFI_PAGE_SIZE           (1 << EFI_PAGE_SHIFT)
@@ -123,22 +124,25 @@ struct efi_tblhdr {
 
 struct efi_rt {
        struct efi_tblhdr rt_hdr;
-       efi_status      (*rt_gettime)(struct efi_tm *, struct efi_tmcap *);
-       efi_status      (*rt_settime)(struct efi_tm *);
+       efi_status      (*rt_gettime)(struct efi_tm *, struct efi_tmcap *)
+           EFIABI_ATTR;
+       efi_status      (*rt_settime)(struct efi_tm *) EFIABI_ATTR;
        efi_status      (*rt_getwaketime)(uint8_t *, uint8_t *,
-           struct efi_tm *);
-       efi_status      (*rt_setwaketime)(uint8_t, struct efi_tm *);
+           struct efi_tm *) EFIABI_ATTR;
+       efi_status      (*rt_setwaketime)(uint8_t, struct efi_tm *)
+           EFIABI_ATTR;
        efi_status      (*rt_setvirtual)(u_long, u_long, uint32_t,
-           struct efi_md *);
-       efi_status      (*rt_cvtptr)(u_long, void **);
+           struct efi_md *) EFIABI_ATTR;
+       efi_status      (*rt_cvtptr)(u_long, void **) EFIABI_ATTR;
        efi_status      (*rt_getvar)(efi_char *, struct uuid *, uint32_t *,
-           u_long *, void *);
-       efi_status      (*rt_scanvar)(u_long *, efi_char *, struct uuid *);
+           u_long *, void *) EFIABI_ATTR;
+       efi_status      (*rt_scanvar)(u_long *, efi_char *, struct uuid *)
+           EFIABI_ATTR;
        efi_status      (*rt_setvar)(efi_char *, struct uuid *, uint32_t,
-           u_long, void *);
-       efi_status      (*rt_gethicnt)(uint32_t *);
+           u_long, void *) EFIABI_ATTR;
+       efi_status      (*rt_gethicnt)(uint32_t *) EFIABI_ATTR;
        efi_status      (*rt_reset)(enum efi_reset, efi_status, u_long,
-           efi_char *);
+           efi_char *) EFIABI_ATTR;
 };
 
 struct efi_systbl {
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to