Displaying 20 results from an estimated 97 matches for "__little_endian".
2014 Apr 17
2
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote:
> +struct __qspinlock {
> + union {
> + atomic_t val;
> + struct {
> +#ifdef __LITTLE_ENDIAN
> + u16 locked_pending;
> + u16 tail;
> +#else
> + u16 tail;
> + u16 locked_pending;
> +#endif
> + };
> + };
> +};
> +
> +/**
> + * clear_pending_set_locked - take ownership and clear the pending bit.
> + * @lock: Pointer to queue spinlock structure
&...
2014 Apr 17
2
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote:
> +struct __qspinlock {
> + union {
> + atomic_t val;
> + struct {
> +#ifdef __LITTLE_ENDIAN
> + u16 locked_pending;
> + u16 tail;
> +#else
> + u16 tail;
> + u16 locked_pending;
> +#endif
> + };
> + };
> +};
> +
> +/**
> + * clear_pending_set_locked - take ownership and clear the pending bit.
> + * @lock: Pointer to queue spinlock structure
&...
2014 Apr 18
2
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...-0400, Waiman Long wrote:
> On 04/17/2014 11:56 AM, Peter Zijlstra wrote:
> >On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote:
> >>+struct __qspinlock {
> >>+ union {
> >>+ atomic_t val;
char bytes[4];
> >>+ struct {
> >>+#ifdef __LITTLE_ENDIAN
> >>+ u16 locked_pending;
> >>+ u16 tail;
> >>+#else
> >>+ u16 tail;
> >>+ u16 locked_pending;
> >>+#endif
> >>+ };
struct {
#ifdef __LITTLE_ENDIAN
u8 locked;
#else
u8 res[3];
u8 locked;
#endif
};
> >>+...
2014 Apr 18
2
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...-0400, Waiman Long wrote:
> On 04/17/2014 11:56 AM, Peter Zijlstra wrote:
> >On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote:
> >>+struct __qspinlock {
> >>+ union {
> >>+ atomic_t val;
char bytes[4];
> >>+ struct {
> >>+#ifdef __LITTLE_ENDIAN
> >>+ u16 locked_pending;
> >>+ u16 tail;
> >>+#else
> >>+ u16 tail;
> >>+ u16 locked_pending;
> >>+#endif
> >>+ };
struct {
#ifdef __LITTLE_ENDIAN
u8 locked;
#else
u8 res[3];
u8 locked;
#endif
};
> >>+...
2019 Oct 18
2
[PATCH] drm/virtio: print a single line with device features
...etions(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c
index 0b3cdb0d83b0..2f5773e43557 100644
--- a/drivers/gpu/drm/virtio/virtgpu_kms.c
+++ b/drivers/gpu/drm/virtio/virtgpu_kms.c
@@ -155,16 +155,15 @@ int virtio_gpu_init(struct drm_device *dev)
#ifdef __LITTLE_ENDIAN
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_VIRGL))
vgdev->has_virgl_3d = true;
- DRM_INFO("virgl 3d acceleration %s\n",
- vgdev->has_virgl_3d ? "enabled" : "not supported by host");
-#else
- DRM_INFO("virgl 3d acceleration not supported by gu...
2019 Oct 18
2
[PATCH] drm/virtio: print a single line with device features
...etions(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c
index 0b3cdb0d83b0..2f5773e43557 100644
--- a/drivers/gpu/drm/virtio/virtgpu_kms.c
+++ b/drivers/gpu/drm/virtio/virtgpu_kms.c
@@ -155,16 +155,15 @@ int virtio_gpu_init(struct drm_device *dev)
#ifdef __LITTLE_ENDIAN
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_VIRGL))
vgdev->has_virgl_3d = true;
- DRM_INFO("virgl 3d acceleration %s\n",
- vgdev->has_virgl_3d ? "enabled" : "not supported by host");
-#else
- DRM_INFO("virgl 3d acceleration not supported by gu...
2023 Jan 14
1
[klibc:time64] time: Use 64-bit time types on all architectures
....h>
> #include <sys/types.h>
> -#include <linux/time.h>
> +
> +struct timespec {
> + __kernel_time64_t tv_sec;
> +#if __BYTE_ORDER == __BIG_ENDIAN && __BITS_PER_LONG == 32
> + long __tv_pad;
> +#endif
> + long tv_nsec;
> +#if __BYTE_ORDER == __LITTLE_ENDIAN && __BITS_PER_LONG == 32
> + long __tv_pad;
> +#endif
> +};
The problem with this definition is applications doing things like
struct timespec ts = { 0, 5000 }; /* 5 ?s */
which on big-endian architectures ends up leaving tv_nsec
set to zero and the padding set to an invalid n...
2014 Apr 17
1
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote:
> +#if !defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN)
> +#error "Missing either LITTLE_ENDIAN or BIG_ENDIAN definition."
> +#endif
This seems entirely superfluous, I don't think a kernel build will go
anywhere if either is missing.
2014 Apr 18
0
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...n 04/17/2014 11:56 AM, Peter Zijlstra wrote:
>>> On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote:
>>>> +struct __qspinlock {
>>>> + union {
>>>> + atomic_t val;
> char bytes[4];
>
>>>> + struct {
>>>> +#ifdef __LITTLE_ENDIAN
>>>> + u16 locked_pending;
>>>> + u16 tail;
>>>> +#else
>>>> + u16 tail;
>>>> + u16 locked_pending;
>>>> +#endif
>>>> + };
> struct {
> #ifdef __LITTLE_ENDIAN
> u8 locked;
> #else
> u...
2014 May 08
1
[PATCH v10 07/19] qspinlock: Use a simple write to grab the lock, if applicable
...static inline struct mcs_spinlock *decode_tail(u32 tail)
> * can allow better optimization of the lock acquisition for the pending
> * bit holder.
> */
> -#if _Q_PENDING_BITS == 8
> -
> struct __qspinlock {
> union {
> atomic_t val;
> - struct {
> #ifdef __LITTLE_ENDIAN
> + u8 locked;
> + struct {
> u16 locked_pending;
> u16 tail;
> + };
> #else
> + struct {
> u16 tail;
> u16 locked_pending;
> -#endif
> };
> + struct {
> + u8 reserved[3];
> + u8 locked;
> + };
> +#endif
> };
>...
2015 Feb 12
0
Re: [PATCH 1/3] macosx: Includes/defines for byteswap operations
...toh for RHEL 5.
> */
> #if !defined(HAVE_BE32TOH) && !defined(be32toh)
> +
> +#if defined __APPLE__ && defined __MACH__
> +/* Define/include necessary items on MacOS X */
> +#include <machine/endian.h>
> +#define __BIG_ENDIAN BIG_ENDIAN
> +#define __LITTLE_ENDIAN LITTLE_ENDIAN
> +#define __BYTE_ORDER BYTE_ORDER
> +#include <libkern/OSByteOrder.h>
> +#define __bswap_32 OSSwapConstInt32
> +#endif /* __APPLE__ */
> +
> #if __BYTE_ORDER == __LITTLE_ENDIAN
> #define be32toh(x) __bswap_32 (x)
> #else
> diff --git a/sr...
2014 Apr 17
1
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote:
> +#if !defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN)
> +#error "Missing either LITTLE_ENDIAN or BIG_ENDIAN definition."
> +#endif
This seems entirely superfluous, I don't think a kernel build will go
anywhere if either is missing.
2014 May 08
1
[PATCH v10 07/19] qspinlock: Use a simple write to grab the lock, if applicable
...static inline struct mcs_spinlock *decode_tail(u32 tail)
> * can allow better optimization of the lock acquisition for the pending
> * bit holder.
> */
> -#if _Q_PENDING_BITS == 8
> -
> struct __qspinlock {
> union {
> atomic_t val;
> - struct {
> #ifdef __LITTLE_ENDIAN
> + u8 locked;
> + struct {
> u16 locked_pending;
> u16 tail;
> + };
> #else
> + struct {
> u16 tail;
> u16 locked_pending;
> -#endif
> };
> + struct {
> + u8 reserved[3];
> + u8 locked;
> + };
> +#endif
> };
>...
2015 Feb 12
8
[PATCH 1/3] macosx: Includes/defines for byteswap operations
...neither is defined
* then define be32toh for RHEL 5.
*/
#if !defined(HAVE_BE32TOH) && !defined(be32toh)
+
+#if defined __APPLE__ && defined __MACH__
+/* Define/include necessary items on MacOS X */
+#include <machine/endian.h>
+#define __BIG_ENDIAN BIG_ENDIAN
+#define __LITTLE_ENDIAN LITTLE_ENDIAN
+#define __BYTE_ORDER BYTE_ORDER
+#include <libkern/OSByteOrder.h>
+#define __bswap_32 OSSwapConstInt32
+#endif /* __APPLE__ */
+
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define be32toh(x) __bswap_32 (x)
#else
diff --git a/src/inspect-fs-windows.c b/src/inspect-fs-windo...
2019 Oct 23
1
[PATCH] drm/virtio: print a single line with device features
...o/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c
>> index 0b3cdb0d83b0..2f5773e43557 100644
>> --- a/drivers/gpu/drm/virtio/virtgpu_kms.c
>> +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c
>> @@ -155,16 +155,15 @@ int virtio_gpu_init(struct drm_device *dev)
>> #ifdef __LITTLE_ENDIAN
>> if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_VIRGL))
>> vgdev->has_virgl_3d = true;
>> - DRM_INFO("virgl 3d acceleration %s\n",
>> - vgdev->has_virgl_3d ? "enabled" : "not supported by host");
>> -#else
>> - DR...
2017 Feb 13
2
[PATCH] Enable specific ioctl calls for ICA crypto card (s390)
...e <endian.h>
+
+#ifdef __s390__
+#include <asm/zcrypt.h>
+#endif
#include "log.h"
#include "ssh-sandbox.h"
@@ -74,6 +79,13 @@
#endif /* SANDBOX_SECCOMP_FILTER_DEBUG */
/* Simple helpers to avoid manual errors (but larger BPF programs). */
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define LO_ARG(idx) offsetof(struct seccomp_data, args[(idx)])
+#elif __BYTE_ORDER == __BIG_ENDIAN
+#define LO_ARG(idx) offsetof(struct seccomp_data, args[(idx)]) + sizeof(_u32)
+#else
+#error "Unknown endianness"
+#endif
#define SC_DENY(_nr, _errno) \
BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K,...
2014 Apr 17
0
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
...c
index fcf06cb..55601b4 100644
--- a/kernel/locking/qspinlock.c
+++ b/kernel/locking/qspinlock.c
@@ -22,8 +22,13 @@
#include <linux/percpu.h>
#include <linux/hardirq.h>
#include <linux/mutex.h>
+#include <asm/byteorder.h>
#include <asm/qspinlock.h>
+#if !defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN)
+#error "Missing either LITTLE_ENDIAN or BIG_ENDIAN definition."
+#endif
+
/*
* The basic principle of a queue-based spinlock can best be understood
* by studying a classic queue-based spinlock implementation called the
@@ -48,6 +53,9 @@
* We can...
2023 Jan 14
1
[klibc:time64] time: Use 64-bit time types on all architectures
...nclude <klibc/endian.h>
#include <stddef.h>
#include <sys/types.h>
-#include <linux/time.h>
+
+struct timespec {
+ __kernel_time64_t tv_sec;
+#if __BYTE_ORDER == __BIG_ENDIAN && __BITS_PER_LONG == 32
+ long __tv_pad;
+#endif
+ long tv_nsec;
+#if __BYTE_ORDER == __LITTLE_ENDIAN && __BITS_PER_LONG == 32
+ long __tv_pad;
+#endif
+};
+
+struct timeval {
+ __kernel_time64_t tv_sec;
+ __kernel_suseconds_t tv_usec;
+};
+
+struct timeval_old {
+ __kernel_time_t tv_sec;
+ __kernel_suseconds_t tv_usec;
+};
+
+struct itimerspec {
+ struct timespec it_interval;
+ struct t...
2015 Apr 07
1
[PATCH v3 6/7] virtio: add explicit big-endian support to memory accessors
...pes.h>
> #include <uapi/linux/virtio_types.h>
>
> -/*
> - * Low-level memory accessors for handling virtio in modern little endian and in
> - * compatibility native endian format.
> - */
> +static inline bool virtio_legacy_is_little_endian(void)
> +{
> +#ifdef __LITTLE_ENDIAN
> + return true;
> +#else
> + return false;
> +#endif
> +}
>
> static inline u16 __virtio16_to_cpu(bool little_endian, __virtio16 val)
> {
> if (little_endian)
> return le16_to_cpu((__force __le16)val);
> else
> - return (__force u16)val;
> + retu...
2015 Apr 07
1
[PATCH v3 6/7] virtio: add explicit big-endian support to memory accessors
...pes.h>
> #include <uapi/linux/virtio_types.h>
>
> -/*
> - * Low-level memory accessors for handling virtio in modern little endian and in
> - * compatibility native endian format.
> - */
> +static inline bool virtio_legacy_is_little_endian(void)
> +{
> +#ifdef __LITTLE_ENDIAN
> + return true;
> +#else
> + return false;
> +#endif
> +}
>
> static inline u16 __virtio16_to_cpu(bool little_endian, __virtio16 val)
> {
> if (little_endian)
> return le16_to_cpu((__force __le16)val);
> else
> - return (__force u16)val;
> + retu...