Commit 566f233b authored by Andrew Pinski's avatar Andrew Pinski Committed by Jinjie Ruan
Browse files

arm64: uapi: set __BITS_PER_LONG correctly for ILP32 and LP64

maillist inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8JVJ3
CVE: NA

Reference: https://github.com/norov/linux/commits/ilp32-5.2



--------------------------------

Define __BITS_PER_LONG depending on the ABI used (i.e. check whether
__ILP32__ or __LP64__ is defined).  This is necessary for glibc to
determine the appropriate type definitions for the system call interface.

Signed-off-by: default avatarAndrew Pinski <apinski@cavium.com>
Signed-off-by: default avatarPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: default avatarChristoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: default avatarYury Norov <ynorov@caviumnetworks.com>
Reviewed-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
Signed-off-by: default avatarYury Norov <ynorov@marvell.com>
Signed-off-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarChen Jiahao <chenjiahao16@huawei.com>
Signed-off-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
parent c6c09f78
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -17,7 +17,14 @@
#ifndef __ASM_BITSPERLONG_H
#define __ASM_BITSPERLONG_H

#if defined(__LP64__)
/* Assuming __LP64__ will be defined for native ELF64's and not for ILP32. */
#  define __BITS_PER_LONG 64
#elif defined(__ILP32__)
#  define __BITS_PER_LONG 32
#else
#  error "Neither LP64 nor ILP32: unsupported ABI in asm/bitsperlong.h"
#endif

#include <asm-generic/bitsperlong.h>