Skip to content

Commit

Permalink
shmbuf.h: add asm/shmbuf.h to UAPI compile-test coverage
Browse files Browse the repository at this point in the history
asm/shmbuf.h is currently excluded from the UAPI compile-test because of
the errors like follows:

    HDRTEST usr/include/asm/shmbuf.h
  In file included from ./usr/include/asm/shmbuf.h:6,
                   from <command-line>:
  ./usr/include/asm-generic/shmbuf.h:26:33: error: field ‘shm_perm’ has incomplete type
     26 |         struct ipc64_perm       shm_perm;       /* operation perms */
        |                                 ^~~~~~~~
  ./usr/include/asm-generic/shmbuf.h:27:9: error: unknown type name ‘size_t’
     27 |         size_t                  shm_segsz;      /* size of segment (bytes) */
        |         ^~~~~~
  ./usr/include/asm-generic/shmbuf.h:40:9: error: unknown type name ‘__kernel_pid_t’
     40 |         __kernel_pid_t          shm_cpid;       /* pid of creator */
        |         ^~~~~~~~~~~~~~
  ./usr/include/asm-generic/shmbuf.h:41:9: error: unknown type name ‘__kernel_pid_t’
     41 |         __kernel_pid_t          shm_lpid;       /* pid of last operator */
        |         ^~~~~~~~~~~~~~

The errors can be fixed by replacing size_t with __kernel_size_t and by
including proper headers.

Then, remove the no-header-test entry from user/include/Makefile.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
  • Loading branch information
masahir0y authored and arndb committed Feb 17, 2022
1 parent 72113d0 commit 4a3233c
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 8 deletions.
7 changes: 5 additions & 2 deletions arch/mips/include/uapi/asm/shmbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#ifndef _ASM_SHMBUF_H
#define _ASM_SHMBUF_H

#include <asm/ipcbuf.h>
#include <asm/posix_types.h>

/*
* The shmid64_ds structure for the MIPS architecture.
* Note extra padding because this structure is passed back and forth
Expand All @@ -16,7 +19,7 @@
#ifdef __mips64
struct shmid64_ds {
struct ipc64_perm shm_perm; /* operation perms */
size_t shm_segsz; /* size of segment (bytes) */
__kernel_size_t shm_segsz; /* size of segment (bytes) */
long shm_atime; /* last attach time */
long shm_dtime; /* last detach time */
long shm_ctime; /* last change time */
Expand All @@ -29,7 +32,7 @@ struct shmid64_ds {
#else
struct shmid64_ds {
struct ipc64_perm shm_perm; /* operation perms */
size_t shm_segsz; /* size of segment (bytes) */
__kernel_size_t shm_segsz; /* size of segment (bytes) */
unsigned long shm_atime; /* last attach time */
unsigned long shm_dtime; /* last detach time */
unsigned long shm_ctime; /* last change time */
Expand Down
2 changes: 2 additions & 0 deletions arch/parisc/include/uapi/asm/shmbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#define _PARISC_SHMBUF_H

#include <asm/bitsperlong.h>
#include <asm/ipcbuf.h>
#include <asm/posix_types.h>

/*
* The shmid64_ds structure for parisc architecture.
Expand Down
5 changes: 4 additions & 1 deletion arch/powerpc/include/uapi/asm/shmbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#ifndef _ASM_POWERPC_SHMBUF_H
#define _ASM_POWERPC_SHMBUF_H

#include <asm/ipcbuf.h>
#include <asm/posix_types.h>

/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -34,7 +37,7 @@ struct shmid64_ds {
unsigned long shm_ctime; /* last change time */
unsigned long __unused4;
#endif
size_t shm_segsz; /* size of segment (bytes) */
__kernel_size_t shm_segsz; /* size of segment (bytes) */
__kernel_pid_t shm_cpid; /* pid of creator */
__kernel_pid_t shm_lpid; /* pid of last operator */
unsigned long shm_nattch; /* no. of current attaches */
Expand Down
5 changes: 4 additions & 1 deletion arch/sparc/include/uapi/asm/shmbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#ifndef _SPARC_SHMBUF_H
#define _SPARC_SHMBUF_H

#include <asm/ipcbuf.h>
#include <asm/posix_types.h>

/*
* The shmid64_ds structure for sparc architecture.
* Note extra padding because this structure is passed back and forth
Expand All @@ -25,7 +28,7 @@ struct shmid64_ds {
unsigned long shm_ctime_high;
unsigned long shm_ctime; /* last change time */
#endif
size_t shm_segsz; /* size of segment (bytes) */
__kernel_size_t shm_segsz; /* size of segment (bytes) */
__kernel_pid_t shm_cpid; /* pid of creator */
__kernel_pid_t shm_lpid; /* pid of last operator */
unsigned long shm_nattch; /* no. of current attaches */
Expand Down
6 changes: 5 additions & 1 deletion arch/x86/include/uapi/asm/shmbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
#if !defined(__x86_64__) || !defined(__ILP32__)
#include <asm-generic/shmbuf.h>
#else

#include <asm/ipcbuf.h>
#include <asm/posix_types.h>

/*
* The shmid64_ds structure for x86 architecture with x32 ABI.
*
Expand All @@ -15,7 +19,7 @@

struct shmid64_ds {
struct ipc64_perm shm_perm; /* operation perms */
size_t shm_segsz; /* size of segment (bytes) */
__kernel_size_t shm_segsz; /* size of segment (bytes) */
__kernel_long_t shm_atime; /* last attach time */
__kernel_long_t shm_dtime; /* last detach time */
__kernel_long_t shm_ctime; /* last change time */
Expand Down
5 changes: 4 additions & 1 deletion arch/xtensa/include/uapi/asm/shmbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@
#ifndef _XTENSA_SHMBUF_H
#define _XTENSA_SHMBUF_H

#include <asm/ipcbuf.h>
#include <asm/posix_types.h>

struct shmid64_ds {
struct ipc64_perm shm_perm; /* operation perms */
size_t shm_segsz; /* size of segment (bytes) */
__kernel_size_t shm_segsz; /* size of segment (bytes) */
unsigned long shm_atime; /* last attach time */
unsigned long shm_atime_high;
unsigned long shm_dtime; /* last detach time */
Expand Down
4 changes: 3 additions & 1 deletion include/uapi/asm-generic/shmbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#define __ASM_GENERIC_SHMBUF_H

#include <asm/bitsperlong.h>
#include <asm/ipcbuf.h>
#include <asm/posix_types.h>

/*
* The shmid64_ds structure for x86 architecture.
Expand All @@ -24,7 +26,7 @@

struct shmid64_ds {
struct ipc64_perm shm_perm; /* operation perms */
size_t shm_segsz; /* size of segment (bytes) */
__kernel_size_t shm_segsz; /* size of segment (bytes) */
#if __BITS_PER_LONG == 64
long shm_atime; /* last attach time */
long shm_dtime; /* last detach time */
Expand Down
1 change: 0 additions & 1 deletion usr/include/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ override c_flags = $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I$(objtree)/usr/include
# Please consider to fix the header first.
#
# Sorted alphabetically.
no-header-test += asm/shmbuf.h
no-header-test += asm/ucontext.h
no-header-test += drm/vmwgfx_drm.h
no-header-test += linux/am437x-vpfe.h
Expand Down

0 comments on commit 4a3233c

Please sign in to comment.