Changeset c621f4aa in mainline for uspace/lib/c/arch/mips32/include


Ignore:
Timestamp:
2010-07-25T10:11:13Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
377cce8
Parents:
24a2517 (diff), a2da43c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge with mainline.

Location:
uspace/lib/c/arch/mips32/include
Files:
12 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/mips32/include/atomic.h

    r24a2517 rc621f4aa  
    2727 */
    2828
    29 /** @addtogroup libcmips32     
     29/** @addtogroup libcmips32
    3030 * @{
    3131 */
    3232/** @file
    33  * @ingroup libcmips32eb       
     33 * @ingroup libcmips32eb
    3434 */
    3535
     
    4141#include <atomicdflt.h>
    4242
    43 #define atomic_inc(x)   ((void) atomic_add(x, 1))
    44 #define atomic_dec(x)   ((void) atomic_add(x, -1))
     43#define atomic_inc(x)  ((void) atomic_add(x, 1))
     44#define atomic_dec(x)  ((void) atomic_add(x, -1))
    4545
    46 #define atomic_postinc(x) (atomic_add(x, 1) - 1)
    47 #define atomic_postdec(x) (atomic_add(x, -1) + 1)
     46#define atomic_postinc(x)  (atomic_add(x, 1) - 1)
     47#define atomic_postdec(x)  (atomic_add(x, -1) + 1)
    4848
    49 #define atomic_preinc(x) atomic_add(x, 1)
    50 #define atomic_predec(x) atomic_add(x, -1)
     49#define atomic_preinc(x)  atomic_add(x, 1)
     50#define atomic_predec(x)  atomic_add(x, -1)
    5151
    5252/* Atomic addition of immediate value.
    5353 *
    5454 * @param val Memory location to which will be the immediate value added.
    55  * @param i Signed immediate that will be added to *val.
     55 * @param i   Signed immediate that will be added to *val.
    5656 *
    5757 * @return Value after addition.
     58 *
    5859 */
    59 static inline long atomic_add(atomic_t *val, int i)
     60static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i)
    6061{
    61         long tmp, v;
    62 
     62        atomic_count_t tmp;
     63        atomic_count_t v;
     64       
    6365        asm volatile (
    6466                "1:\n"
     
    7072                /*      nop     */              /* nop is inserted automatically by compiler */
    7173                "       nop\n"
    72                 : "=&r" (tmp), "+m" (val->count), "=&r" (v)
    73                 : "r" (i), "i" (0)
    74                 );
    75 
     74                : "=&r" (tmp),
     75                  "+m" (val->count),
     76                  "=&r" (v)
     77                : "r" (i),
     78                  "i" (0)
     79        );
     80       
    7681        return v;
    7782}
  • uspace/lib/c/arch/mips32/include/types.h

    r24a2517 rc621f4aa  
    2727 */
    2828
    29 /** @addtogroup libcmips32     
     29/** @addtogroup libcmips32
    3030 * @{
    3131 */
     
    3939#define __32_BITS__
    4040
    41 typedef unsigned int sysarg_t;
     41#include <libarch/common.h>
    4242
    43 typedef char int8_t;
    44 typedef short int int16_t;
    45 typedef long int int32_t;
    46 typedef long long int int64_t;
     43#define SIZE_MIN  UINT32_MIN
     44#define SIZE_MAX  UINT32_MAX
    4745
    48 typedef unsigned char uint8_t;
    49 typedef unsigned short int uint16_t;
    50 typedef unsigned long int uint32_t;
    51 typedef unsigned long long int uint64_t;
     46#define SSIZE_MIN  INT32_MIN
     47#define SSIZE_MAX  INT32_MAX
     48
     49typedef uint32_t sysarg_t;
    5250
    5351typedef int32_t ssize_t;
     
    5553
    5654typedef uint32_t uintptr_t;
     55typedef uint32_t atomic_count_t;
     56typedef int32_t atomic_signed_t;
    5757
    5858#endif
Note: See TracChangeset for help on using the changeset viewer.