]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[librm] Specify regparm function attribute only for i386
authorMichael Brown <mcb30@ipxe.org>
Fri, 1 May 2026 13:34:52 +0000 (14:34 +0100)
committerMichael Brown <mcb30@ipxe.org>
Fri, 1 May 2026 13:34:52 +0000 (14:34 +0100)
The regparm function attribute is meaningful only for i386, not for
x86_64, and is reported as a build error by GCC 16.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/x86/transitions/librm_mgmt.c

index 89feec96a3163ea55abcf1cdc1310fe9033c9fbb..6c8d55f90e915127ee1596a717d0c2c680b96976 100644 (file)
@@ -21,6 +21,13 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  *
  */
 
+/* Calling convention used by interrupt wrapper */
+#ifdef __x86_64__
+#define __intrcall
+#else
+#define __intrcall __attribute__ (( regparm ( 3 ) ))
+#endif
+
 /** The interrupt wrapper */
 extern char interrupt_wrapper[];
 
@@ -247,9 +254,8 @@ interrupt_dump ( int intr, struct interrupt_frame32 *frame32,
  * @v frame64          64-bit interrupt wrapper stack frame (or NULL)
  * @v frame            Interrupt wrapper stack frame
  */
-void __attribute__ (( regparm ( 3 ) ))
-interrupt ( int intr, struct interrupt_frame32 *frame32,
-           struct interrupt_frame64 *frame64 ) {
+__intrcall void interrupt ( int intr, struct interrupt_frame32 *frame32,
+                           struct interrupt_frame64 *frame64 ) {
        struct profiler *profiler = interrupt_profiler ( intr );
        uint32_t discard_eax;