]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
alpha: regularize the situation with asm/param.h
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 2 Dec 2024 00:28:34 +0000 (19:28 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 25 Jun 2025 02:02:05 +0000 (22:02 -0400)
The only reason why alpha can't do what sparc et.al. are doing
is that include/asm-generic/param.h relies upon the value of HZ
set for userland header in uapi/asm/param.h being 100.

We need that value to define USER_HZ and we need that definition
to outlive the redefinition of HZ kernel-side.  And alpha needs
it to be 1024, not 100 like everybody else.

So let's add __USER_HZ to uapi/asm-generic/param.h, defaulting to
100 and used to define HZ.  That way include/asm-generic/param.h
can use that thing instead of open-coding it - it won't be affected
by undefining and redefining HZ.

That done, alpha asm/param.h can be removed and uapi/asm/param.h
switched to defining __USER_HZ and EXEC_PAGESIZE and then including
<asm-generic/param.h> - asm/param.h will resolve to uapi/asm/param.h,
which pulls <asm-generic/param.h>, which will do the right thing
both in the kernel and userland contexts.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/alpha/include/asm/param.h [deleted file]
arch/alpha/include/uapi/asm/param.h
include/asm-generic/param.h
include/uapi/asm-generic/param.h

diff --git a/arch/alpha/include/asm/param.h b/arch/alpha/include/asm/param.h
deleted file mode 100644 (file)
index cfe947c..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _ASM_ALPHA_PARAM_H
-#define _ASM_ALPHA_PARAM_H
-
-#include <uapi/asm/param.h>
-
-# undef HZ
-# define HZ            CONFIG_HZ
-# define USER_HZ       1024
-# define CLOCKS_PER_SEC        USER_HZ /* frequency at which times() counts */
-
-#endif /* _ASM_ALPHA_PARAM_H */
index 49c7119934e222e67c0fd788b932f03160404c23..e4e410f9bf852d61d2d636c0f2585ae768655402 100644 (file)
@@ -2,14 +2,9 @@
 #ifndef _UAPI_ASM_ALPHA_PARAM_H
 #define _UAPI_ASM_ALPHA_PARAM_H
 
-#define HZ             1024
-
+#define __USER_HZ      1024
 #define EXEC_PAGESIZE  8192
 
-#ifndef NOGROUP
-#define NOGROUP                (-1)
-#endif
-
-#define MAXHOSTNAMELEN 64      /* max length of hostname */
+#include <asm-generic/param.h>
 
 #endif /* _UAPI_ASM_ALPHA_PARAM_H */
index 8d3009dd28ff2fa1dc535593cd6783ea4199874d..8348c116aa3b8d94ceb15eb007be657853f275f5 100644 (file)
@@ -6,6 +6,6 @@
 
 # undef HZ
 # define HZ            CONFIG_HZ       /* Internal kernel timer frequency */
-# define USER_HZ       100             /* some user interfaces are */
+# define USER_HZ       __USER_HZ       /* some user interfaces are */
 # define CLOCKS_PER_SEC        (USER_HZ)       /* in "ticks" like times() */
 #endif /* __ASM_GENERIC_PARAM_H */
index baad02ea7f93686ebb6282b968e66aa5c94f5576..3ed505dfea13054e8abcd14ceed3e42e1fd44237 100644 (file)
@@ -2,8 +2,12 @@
 #ifndef _UAPI__ASM_GENERIC_PARAM_H
 #define _UAPI__ASM_GENERIC_PARAM_H
 
+#ifndef __USER_HZ
+#define __USER_HZ      100
+#endif
+
 #ifndef HZ
-#define HZ 100
+#define HZ __USER_HZ
 #endif
 
 #ifndef EXEC_PAGESIZE