Blame source/uds/numericDefs.h

Packit Service 310c69
/*
Packit Service 310c69
 * Copyright (c) 2020 Red Hat, Inc.
Packit Service 310c69
 *
Packit Service 310c69
 * This program is free software; you can redistribute it and/or
Packit Service 310c69
 * modify it under the terms of the GNU General Public License
Packit Service 310c69
 * as published by the Free Software Foundation; either version 2
Packit Service 310c69
 * of the License, or (at your option) any later version.
Packit Service 310c69
 * 
Packit Service 310c69
 * This program is distributed in the hope that it will be useful,
Packit Service 310c69
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 310c69
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 310c69
 * GNU General Public License for more details.
Packit Service 310c69
 * 
Packit Service 310c69
 * You should have received a copy of the GNU General Public License
Packit Service 310c69
 * along with this program; if not, write to the Free Software
Packit Service 310c69
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
Packit Service 310c69
 * 02110-1301, USA. 
Packit Service 310c69
 *
Packit Service 310c69
 * $Id: //eng/uds-releases/jasper/kernelLinux/uds/numericDefs.h#1 $
Packit Service 310c69
 */
Packit Service 310c69
Packit Service 310c69
#ifndef LINUX_KERNEL_NUMERIC_DEFS_H
Packit Service 310c69
#define LINUX_KERNEL_NUMERIC_DEFS_H 1
Packit Service 310c69
Packit Service 310c69
#ifdef __x86_64__
Packit Service 310c69
/*
Packit Service 310c69
 * __builtin_bswap16 should work fine here too, but check for a
Packit Service 310c69
 * performance impact before changing it, just to be safe.
Packit Service 310c69
 */
Packit Service 310c69
#define bswap_16(x) \
Packit Service 310c69
  (__extension__                                                        \
Packit Service 310c69
   ({ register unsigned short int __v, __x = (unsigned short int) (x);  \
Packit Service 310c69
     __asm__ ("rorw $8, %w0"                                            \
Packit Service 310c69
              : "=r" (__v)                                              \
Packit Service 310c69
              : "0" (__x)                                               \
Packit Service 310c69
              : "cc");                                                  \
Packit Service 310c69
     __v; }))
Packit Service 310c69
#else
Packit Service 310c69
#define bswap_16(x) __builtin_bswap16(x)
Packit Service 310c69
#endif
Packit Service 310c69
Packit Service 310c69
#endif /* LINUX_KERNEL_NUMERIC_DEFS_H */