Ignore:
Timestamp:
Feb 12, 2013, 6:33:31 PM (11 years ago)
Author:
meunier
Message:

Added support for memspaces and const.
Added an interrupt masking to the "giet_context_switch" syscall
Corrected two bugs in boot/boot_init.c (one minor and one regarding barriers initialization)
Reformatted the code in all files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/libs/libsrl/srl_endianness.h

    r160 r228  
    55
    66/** @this reads a big endian 16 bits value */
    7 #  define endian_le16(x)        (x)
     7#  define endian_le16(x)    (x)
    88/** @this reads a big endian 32 bits value */
    9 #  define endian_le32(x)        (x)
     9#  define endian_le32(x)    (x)
    1010/** @this reads a big endian 64 bits value */
    11 //#  define endian_le64(x)      (x)
     11//#  define endian_le64(x)    (x)
    1212/** @this reads a little endian 16 bits value */
    13 #  define endian_be16(x)        endian_swap16(x)
     13#  define endian_be16(x)    endian_swap16(x)
    1414/** @this reads a little endian 32 bits value */
    15 #  define endian_be32(x)        endian_swap32(x)
     15#  define endian_be32(x)    endian_swap32(x)
    1616/** @this reads a little endian 64 bits value */
    17 //#  define endian_be64(x)      endian_swap64(x)
     17//#  define endian_be64(x)    endian_swap64(x)
    1818
    1919/** @internal */
    20 static inline uint16_t endian_swap16(uint16_t x)
    21 {
    22   return (x >> 8) | (x << 8);
     20static inline uint16_t endian_swap16(uint16_t x) {
     21    return (x >> 8) | (x << 8);
    2322}
    2423
     24
    2525/** @internal */
    26 static inline uint32_t endian_swap32(uint32_t x)
    27 {
    28   return (((x >> 24) & 0x000000ff) |
    29           ((x >> 8 ) & 0x0000ff00) |
    30           ((x << 8 ) & 0x00ff0000) |
    31           ((x << 24) & 0xff000000));
     26static inline uint32_t endian_swap32(uint32_t x) {
     27    return (((x >> 24) & 0x000000ff) |
     28            ((x >> 8 ) & 0x0000ff00) |
     29            ((x << 8 ) & 0x00ff0000) |
     30            ((x << 24) & 0xff000000));
    3231}
    3332
     33
    3434/** @internal *//*
    35 static inline uint64_t __endian_swap64(uint64_t x)
    36 {
    37   return (((uint64_t)endian_swap32(x      ) << 32) |
    38           ((uint64_t)endian_swap32(x >> 32)      ));
    39 }*/
     35                   static inline uint64_t __endian_swap64(uint64_t x)
     36                   {
     37                   return (((uint64_t)endian_swap32(x      ) << 32) |
     38                   ((uint64_t)endian_swap32(x >> 32)      ));
     39                   }*/
    4040
    41 static inline uint32_t srl_uint32_le_to_machine(uint32_t x)
    42 {
    43         return endian_le32(x);
     41static inline uint32_t srl_uint32_le_to_machine(uint32_t x) {
     42    return endian_le32(x);
    4443}
    4544
    46 static inline uint32_t srl_uint32_machine_to_le(uint32_t x)
    47 {
    48         return endian_le32(x);
     45
     46static inline uint32_t srl_uint32_machine_to_le(uint32_t x) {
     47    return endian_le32(x);
    4948}
    5049
    51 static inline uint32_t srl_uint32_be_to_machine(uint32_t x)
    52 {
    53         return endian_be32(x);
     50
     51static inline uint32_t srl_uint32_be_to_machine(uint32_t x) {
     52    return endian_be32(x);
    5453}
    5554
    56 static inline uint32_t srl_uint32_machine_to_be(uint32_t x)
    57 {
    58         return endian_be32(x);
     55
     56static inline uint32_t srl_uint32_machine_to_be(uint32_t x) {
     57    return endian_be32(x);
    5958}
    6059
    61 static inline uint16_t srl_uint16_le_to_machine(uint16_t x)
    62 {
    63         return endian_le16(x);
     60
     61static inline uint16_t srl_uint16_le_to_machine(uint16_t x) {
     62    return endian_le16(x);
    6463}
    6564
    66 static inline uint16_t srl_uint16_machine_to_le(uint16_t x)
    67 {
    68         return endian_le16(x);
     65
     66static inline uint16_t srl_uint16_machine_to_le(uint16_t x) {
     67    return endian_le16(x);
    6968}
    7069
    71 static inline uint16_t srl_uint16_be_to_machine(uint16_t x)
    72 {
    73         return endian_be16(x);
     70
     71static inline uint16_t srl_uint16_be_to_machine(uint16_t x) {
     72    return endian_be16(x);
    7473}
    7574
    76 static inline uint16_t srl_uint16_machine_to_be(uint16_t x)
    77 {
    78         return endian_be16(x);
     75
     76static inline uint16_t srl_uint16_machine_to_be(uint16_t x) {
     77    return endian_be16(x);
    7978}
    8079
    8180
    8281#endif
     82
     83
     84// Local Variables:
     85// tab-width: 4
     86// c-basic-offset: 4
     87// c-file-offsets:((innamespace . 0)(inline-open . 0))
     88// indent-tabs-mode: nil
     89// End:
     90// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
     91
Note: See TracChangeset for help on using the changeset viewer.