aboutsummaryrefslogtreecommitdiffstats
path: root/package/lua/patches/300-opcode_performance.patch
diff options
context:
space:
mode:
Diffstat (limited to 'package/lua/patches/300-opcode_performance.patch')
0 files changed, 0 insertions, 0 deletions
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
/****************************************************************
 * acm_endian.h 
 * 
 * Copyright (C) 2005 IBM Corporation
 *
 * Author:
 * Stefan Berger <stefanb@watson.ibm.com>
 * 
 * Contributions:
 * Reiner Sailer <sailer@watson.ibm.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, version 2 of the
 * License.
 *
 * sHype header file defining endian-dependent functions for the
 * big-endian policy interface
 *
 */

#ifndef _ACM_ENDIAN_H
#define _ACM_ENDIAN_H

/* don't use these functions in performance critical sections! */

/* set during initialization by testing */
extern u8 little_endian;

static inline u32 ntohl(u32 x) 
{
    if (little_endian)
        return 
            ( (((x) >> 24) & 0xff      )| 
              (((x) >>  8) & 0xff00    )| 
              (((x) <<  8) & 0xff0000  )|
              (((x) << 24) & 0xff000000) );