Commit 678e9c3a authored by Arnd Bergmann's avatar Arnd Bergmann

Merge branch 'asm-generic-headers-cleanup' into asm-generic

A series from Masahiro Yamada to clean up the uapi headers, making
sure they can actually be included from user space without additional
dependencies on either kernel headers or specific libc versions.

* asm-generic-headers-cleanup:
  sparc: add asm/stat.h to UAPI compile-test coverage
  powerpc: add asm/stat.h to UAPI compile-test coverage
  mips: add asm/stat.h to UAPI compile-test coverage
  riscv: add linux/bpf_perf_event.h to UAPI compile-test coverage
  kbuild: prevent exported headers from including <stdlib.h>, <stdbool.h>
  agpgart.h: do not include <stdlib.h> from exported header
parents 03a679a1 31a088b6
...@@ -19,11 +19,11 @@ ...@@ -19,11 +19,11 @@
struct stat { struct stat {
unsigned st_dev; unsigned st_dev;
long st_pad1[3]; /* Reserved for network id */ long st_pad1[3]; /* Reserved for network id */
ino_t st_ino; __kernel_ino_t st_ino;
mode_t st_mode; __kernel_mode_t st_mode;
__u32 st_nlink; __u32 st_nlink;
uid_t st_uid; __kernel_uid_t st_uid;
gid_t st_gid; __kernel_gid_t st_gid;
unsigned st_rdev; unsigned st_rdev;
long st_pad2[2]; long st_pad2[2];
long st_size; long st_size;
...@@ -55,11 +55,11 @@ struct stat64 { ...@@ -55,11 +55,11 @@ struct stat64 {
unsigned long long st_ino; unsigned long long st_ino;
mode_t st_mode; __kernel_mode_t st_mode;
__u32 st_nlink; __u32 st_nlink;
uid_t st_uid; __kernel_uid_t st_uid;
gid_t st_gid; __kernel_gid_t st_gid;
unsigned long st_rdev; unsigned long st_rdev;
unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */ unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */
...@@ -96,11 +96,11 @@ struct stat { ...@@ -96,11 +96,11 @@ struct stat {
unsigned long st_ino; unsigned long st_ino;
mode_t st_mode; __kernel_mode_t st_mode;
__u32 st_nlink; __u32 st_nlink;
uid_t st_uid; __kernel_uid_t st_uid;
gid_t st_gid; __kernel_gid_t st_gid;
unsigned int st_rdev; unsigned int st_rdev;
unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */ unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */
......
...@@ -29,16 +29,16 @@ struct __old_kernel_stat { ...@@ -29,16 +29,16 @@ struct __old_kernel_stat {
struct stat { struct stat {
unsigned long st_dev; unsigned long st_dev;
ino_t st_ino; __kernel_ino_t st_ino;
#ifdef __powerpc64__ #ifdef __powerpc64__
unsigned long st_nlink; unsigned long st_nlink;
mode_t st_mode; __kernel_mode_t st_mode;
#else #else
mode_t st_mode; __kernel_mode_t st_mode;
unsigned short st_nlink; unsigned short st_nlink;
#endif #endif
uid_t st_uid; __kernel_uid_t st_uid;
gid_t st_gid; __kernel_gid_t st_gid;
unsigned long st_rdev; unsigned long st_rdev;
long st_size; long st_size;
unsigned long st_blksize; unsigned long st_blksize;
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
/* 64 bit sparc */ /* 64 bit sparc */
struct stat { struct stat {
unsigned int st_dev; unsigned int st_dev;
ino_t st_ino; __kernel_ino_t st_ino;
mode_t st_mode; __kernel_mode_t st_mode;
short st_nlink; short st_nlink;
uid_t st_uid; __kernel_uid_t st_uid;
gid_t st_gid; __kernel_gid_t st_gid;
unsigned int st_rdev; unsigned int st_rdev;
long st_size; long st_size;
long st_atime; long st_atime;
...@@ -51,8 +51,8 @@ struct stat64 { ...@@ -51,8 +51,8 @@ struct stat64 {
/* 32 bit sparc */ /* 32 bit sparc */
struct stat { struct stat {
unsigned short st_dev; unsigned short st_dev;
ino_t st_ino; __kernel_ino_t st_ino;
mode_t st_mode; __kernel_mode_t st_mode;
short st_nlink; short st_nlink;
unsigned short st_uid; unsigned short st_uid;
unsigned short st_gid; unsigned short st_gid;
......
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
#ifndef __KERNEL__ #ifndef __KERNEL__
#include <linux/types.h> #include <linux/types.h>
#include <stdlib.h>
struct agp_version { struct agp_version {
__u16 major; __u16 major;
...@@ -64,10 +63,10 @@ typedef struct _agp_info { ...@@ -64,10 +63,10 @@ typedef struct _agp_info {
__u32 bridge_id; /* bridge vendor/device */ __u32 bridge_id; /* bridge vendor/device */
__u32 agp_mode; /* mode info of bridge */ __u32 agp_mode; /* mode info of bridge */
unsigned long aper_base;/* base of aperture */ unsigned long aper_base;/* base of aperture */
size_t aper_size; /* size of aperture */ __kernel_size_t aper_size; /* size of aperture */
size_t pg_total; /* max pages (swap + system) */ __kernel_size_t pg_total; /* max pages (swap + system) */
size_t pg_system; /* max pages (system) */ __kernel_size_t pg_system; /* max pages (system) */
size_t pg_used; /* current pages used */ __kernel_size_t pg_used; /* current pages used */
} agp_info; } agp_info;
typedef struct _agp_setup { typedef struct _agp_setup {
......
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _STDBOOL_H
#define _STDBOOL_H
#error "Please do not include <stdbool.h> from exported headers"
#endif /* _STDBOOL_H */
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _STDLIB_H
#define _STDLIB_H
#error "Please do not include <stdlib.h> from exported headers"
#endif /* _STDLIB_H */
...@@ -15,7 +15,7 @@ UAPI_CFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CFLAGS)) ...@@ -15,7 +15,7 @@ UAPI_CFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CFLAGS))
# USERCFLAGS might contain sysroot location for CC. # USERCFLAGS might contain sysroot location for CC.
UAPI_CFLAGS += $(USERCFLAGS) UAPI_CFLAGS += $(USERCFLAGS)
override c_flags = $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I$(objtree)/usr/include override c_flags = $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I $(obj) -I $(srctree)/usr/dummy-include
# The following are excluded for now because they fail to build. # The following are excluded for now because they fail to build.
# #
...@@ -65,21 +65,11 @@ no-header-test += asm/sigcontext.h ...@@ -65,21 +65,11 @@ no-header-test += asm/sigcontext.h
no-header-test += linux/if_bonding.h no-header-test += linux/if_bonding.h
endif endif
ifeq ($(SRCARCH),mips)
no-header-test += asm/stat.h
endif
ifeq ($(SRCARCH),powerpc) ifeq ($(SRCARCH),powerpc)
no-header-test += asm/stat.h
no-header-test += linux/bpf_perf_event.h
endif
ifeq ($(SRCARCH),riscv)
no-header-test += linux/bpf_perf_event.h no-header-test += linux/bpf_perf_event.h
endif endif
ifeq ($(SRCARCH),sparc) ifeq ($(SRCARCH),sparc)
no-header-test += asm/stat.h
no-header-test += asm/uctx.h no-header-test += asm/uctx.h
no-header-test += asm/fbio.h no-header-test += asm/fbio.h
endif endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment