Bug 294468 - x86/cputypes.h:57:21: error: expected register here
Summary: x86/cputypes.h:57:21: error: expected register here
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 16.0-CURRENT
Hardware: i386 Any
: --- Affects Only Me
Assignee: ShengYi Hung
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-04-13 10:25 UTC by Dan Kotowski
Modified: 2026-04-17 16:26 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Kotowski 2026-04-13 10:25:08 UTC
Introduced @2358492b0347 x86: Add zen identifier helper function

https://reviews.freebsd.org/D56330

--- locore.o ---
./x86/cputypes.h:57:21: error: expected register here
u_int ident_zen_cpu(void);
                    ^
*** [locore.o] Error code 1

make[2]: stopped making "all" in /usr/obj/usr/local/src/i386.i386/sys/GENERIC
Comment 1 ShengYi Hung freebsd_committer freebsd_triage 2026-04-13 14:03:16 UTC
(In reply to Dan Kotowski from comment #0)

I move the discussion to phab.
Comment 2 ShengYi Hung freebsd_committer freebsd_triage 2026-04-13 14:47:53 UTC
(In reply to Dan Kotowski from comment #0)
https://reviews.freebsd.org/D56377
Could you please try this?
Comment 3 Dan Kotowski 2026-04-13 15:00:53 UTC
(In reply to ShengYi Hung from comment #2)
Should this work?

diff --git a/sys/x86/include/cputypes.h b/sys/x86/include/cputypes.h
index ed26304a89ac..eaafa3f65b30 100644
--- a/sys/x86/include/cputypes.h
+++ b/sys/x86/include/cputypes.h
@@ -54,7 +54,9 @@
 #define CPU_AMD_UNKNOWN                0xffffffff
 
 #ifdef _KERNEL
+#ifndef _LOCORE
 u_int  ident_zen_cpu(void);
 #endif
+#endif
 
 #endif /* !_X86_CPUTYPES_H_ */
Comment 4 ShengYi Hung freebsd_committer freebsd_triage 2026-04-13 15:43:16 UTC
(In reply to Dan Kotowski from comment #3)
This is suggested by kib@. I think it should work
Comment 5 Dan Kotowski 2026-04-13 16:35:24 UTC
(In reply to ShengYi Hung from comment #4)

Actually s/_LOCORE/LOCORE/


diff --git a/sys/x86/include/cputypes.h b/sys/x86/include/cputypes.h
index ed26304a89ac..0b6f0f3746a9 100644
--- a/sys/x86/include/cputypes.h
+++ b/sys/x86/include/cputypes.h
@@ -54,7 +54,9 @@
 #define CPU_AMD_UNKNOWN                0xffffffff
 
 #ifdef _KERNEL
+#ifndef LOCORE
 u_int  ident_zen_cpu(void);
 #endif
+#endif
 
 #endif /* !_X86_CPUTYPES_H_ */


--------------------------------------------------------------
>>> Kernel build for GENERIC completed on Mon Apr 13 16:27:27 UTC 2026
--------------------------------------------------------------
>>> Kernel(s)  GENERIC built in 144 seconds, ncpu: 32, make -j32
--------------------------------------------------------------
Comment 6 commit-hook freebsd_committer freebsd_triage 2026-04-14 04:59:45 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=43d632779b7d1df6c96a5cc0f506c13e09a845f3

commit 43d632779b7d1df6c96a5cc0f506c13e09a845f3
Author:     ShengYi Hung <aokblast@FreeBSD.org>
AuthorDate: 2026-04-13 14:46:43 +0000
Commit:     ShengYi Hung <aokblast@FreeBSD.org>
CommitDate: 2026-04-14 04:58:39 +0000

    x86: Mark LOCORE to prevent build failure on i386 platform

    PR:     294468
    Reported by:    dan.kotowski@a9development.com
    Tested by:      dan.kotowski@a9development.com
    Discussed with: kib
    Fixes:  9289df1949cd ("x86: Add zen identifier helper function")
    MFC after:      2 weeks
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D56377

 sys/x86/include/cputypes.h | 2 ++
 1 file changed, 2 insertions(+)