Changeset f6b5593 in mainline for uspace/lib/libc


Ignore:
Timestamp:
2009-09-21T11:53:03Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4098e38
Parents:
2f636b6 (diff), c1618ed (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 mainline changes.

Location:
uspace/lib/libc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/Makefile.toolchain

    r2f636b6 rf6b5593  
    6464#
    6565
     66ifeq ($(COMPILER),gcc_cross)
     67        CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
     68        AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
     69        LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
     70        AR = $(TOOLCHAIN_DIR)/$(TARGET)-ar
     71        OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
     72        OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
     73        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
     74endif
     75
    6676ifeq ($(COMPILER),gcc_native)
    6777        CC = gcc
     
    7484endif
    7585
    76 ifeq ($(COMPILER),icc_native)
     86ifeq ($(COMPILER),icc)
    7787        CC = icc
    7888        AS = as
     
    8494endif
    8595
    86 ifeq ($(COMPILER),gcc_cross)
    87         CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
    88         AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
    89         LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
    90         AR = $(TOOLCHAIN_DIR)/$(TARGET)-ar
    91         OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
    92         OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
     96ifeq ($(COMPILER),clang)
     97        CC = clang
     98        AS = $(BINUTILS_PREFIX)as
     99        LD = $(BINUTILS_PREFIX)ld
     100        AR = $(BINUTILS_PREFIX)ar
     101        OBJCOPY = $(BINUTILS_PREFIX)objcopy
     102        OBJDUMP = $(BINUTILS_PREFIX)objdump
    93103        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    94104endif
  • uspace/lib/libc/arch/ia64/include/atomic.h

    r2f636b6 rf6b5593  
    2727 */
    2828
    29 /** @addtogroup libcia64       
     29/** @addtogroup libcia64
    3030 * @{
    3131 */
     
    3636#define LIBC_ia64_ATOMIC_H_
    3737
    38 /** Atomic addition.
    39  *
    40  * @param val Atomic value.
    41  * @param imm Value to add.
    42  *
    43  * @return Value before addition.
    44  */
    45 static inline long atomic_add(atomic_t *val, int imm)
     38static inline void atomic_inc(atomic_t *val)
    4639{
    4740        long v;
     41       
     42        asm volatile (
     43                "fetchadd8.rel %[v] = %[count], 1\n"
     44                : [v] "=r" (v),
     45                  [count] "+m" (val->count)
     46        );
     47}
    4848
    49         asm volatile ("fetchadd8.rel %0 = %1, %2\n" : "=r" (v), "+m" (val->count) : "i" (imm));
    50  
     49static inline void atomic_dec(atomic_t *val)
     50{
     51        long v;
     52       
     53        asm volatile (
     54                "fetchadd8.rel %[v] = %[count], -1\n"
     55                : [v] "=r" (v),
     56                  [count] "+m" (val->count)
     57        );
     58}
     59
     60static inline long atomic_preinc(atomic_t *val)
     61{
     62        long v;
     63       
     64        asm volatile (
     65                "fetchadd8.rel %[v] = %[count], 1\n"
     66                : [v] "=r" (v),
     67                  [count] "+m" (val->count)
     68        );
     69       
     70        return (v + 1);
     71}
     72
     73static inline long atomic_predec(atomic_t *val)
     74{
     75        long v;
     76       
     77        asm volatile (
     78                "fetchadd8.rel %[v] = %[count], -1\n"
     79                : [v] "=r" (v),
     80                  [count] "+m" (val->count)
     81        );
     82       
     83        return (v - 1);
     84}
     85
     86static inline long atomic_postinc(atomic_t *val)
     87{
     88        long v;
     89       
     90        asm volatile (
     91                "fetchadd8.rel %[v] = %[count], 1\n"
     92                : [v] "=r" (v),
     93                  [count] "+m" (val->count)
     94        );
     95       
    5196        return v;
    5297}
    5398
    54 static inline void atomic_inc(atomic_t *val) { atomic_add(val, 1); }
    55 static inline void atomic_dec(atomic_t *val) { atomic_add(val, -1); }
    56 
    57 static inline long atomic_preinc(atomic_t *val) { return atomic_add(val, 1) + 1; }
    58 static inline long atomic_predec(atomic_t *val) { return atomic_add(val, -1) - 1; }
    59 
    60 static inline long atomic_postinc(atomic_t *val) { return atomic_add(val, 1); }
    61 static inline long atomic_postdec(atomic_t *val) { return atomic_add(val, -1); }
     99static inline long atomic_postdec(atomic_t *val)
     100{
     101        long v;
     102       
     103        asm volatile (
     104                "fetchadd8.rel %[v] = %[count], -1\n"
     105                : [v] "=r" (v),
     106                  [count] "+m" (val->count)
     107        );
     108       
     109        return v;
     110}
    62111
    63112#endif
  • uspace/lib/libc/generic/io/console.c

    r2f636b6 rf6b5593  
    4545}
    4646
    47 int console_get_size(int phone, ipcarg_t *rows, ipcarg_t *cols)
     47int console_get_size(int phone, int *cols, int *rows)
    4848{
    49         return async_req_0_2(phone, CONSOLE_GET_SIZE, rows, cols);
     49        ipcarg_t cols_v;
     50        ipcarg_t rows_v;
     51        int rc;
     52
     53        rc = async_req_0_2(phone, CONSOLE_GET_SIZE, &cols_v, &rows_v);
     54
     55        *cols = (int) cols_v;
     56        *rows = (int) rows_v;
     57        return rc;
    5058}
    5159
     
    8694}
    8795
    88 void console_goto(int phone, ipcarg_t row, ipcarg_t col)
     96void console_goto(int phone, int col, int row)
    8997{
    90         async_msg_2(phone, CONSOLE_GOTO, row, col);
     98        async_msg_2(phone, CONSOLE_GOTO, col, row);
    9199}
    92100
  • uspace/lib/libc/include/io/console.h

    r2f636b6 rf6b5593  
    6868extern void console_clear(int phone);
    6969
    70 extern int console_get_size(int phone, ipcarg_t *rows, ipcarg_t *cols);
    71 extern void console_goto(int phone, ipcarg_t row, ipcarg_t col);
     70extern int console_get_size(int phone, int *cols, int *rows);
     71extern void console_goto(int phone, int col, int row);
    7272
    7373extern void console_set_style(int phone, int style);
  • uspace/lib/libc/include/ipc/bd.h

    r2f636b6 rf6b5593  
    3939
    4040typedef enum {
    41         BD_READ_BLOCK = IPC_FIRST_USER_METHOD,
    42         BD_WRITE_BLOCK
     41        BD_GET_BLOCK_SIZE = IPC_FIRST_USER_METHOD,
     42        BD_READ_BLOCKS,
     43        BD_WRITE_BLOCKS
    4344} bd_request_t;
    4445
Note: See TracChangeset for help on using the changeset viewer.