Changeset 70253688 in mainline for uspace/lib/c


Ignore:
Timestamp:
2012-09-07T08:12:05Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e0c836e8
Parents:
131d9a4 (diff), 8cf4823 (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/c
Files:
7 added
27 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/Makefile

    r131d9a4 r70253688  
    9595        generic/inetping.c \
    9696        generic/io/asprintf.c \
     97        generic/io/input.c \
    9798        generic/io/io.c \
    9899        generic/io/chargrid.c \
     
    106107        generic/io/vsnprintf.c \
    107108        generic/io/printf_core.c \
     109        generic/io/con_srv.c \
    108110        generic/io/console.c \
    109111        generic/io/visualizer.c \
  • uspace/lib/c/arch/abs32le/_link.ld.in

    r131d9a4 r70253688  
    1515#ifdef LOADER
    1616        . = 0x70001000 + SIZEOF_HEADERS;
    17        
    18         .interp : {
    19                 *(.interp);
    20         } :interp :text
    2117#else
    2218        . = 0x1000 + SIZEOF_HEADERS;
    2319#endif
    24        
    25         /* Make sure the code is aligned reasonably */
    26         . = ALIGN(., 16);
    2720       
    2821        .text : {
     
    3023                *(.rodata .rodata.*);
    3124        } :text
     25       
     26#ifdef LOADER
     27        .interp : {
     28                *(.interp);
     29        } :interp :text
     30#endif
    3231       
    3332        . = . + 0x1000;
  • uspace/lib/c/arch/abs32le/include/types.h

    r131d9a4 r70253688  
    4747
    4848typedef uint32_t sysarg_t;
     49typedef int32_t native_t;
    4950
    5051typedef int32_t ssize_t;
  • uspace/lib/c/arch/amd64/_link.ld.in

    r131d9a4 r70253688  
    1616#ifdef LOADER
    1717        . = 0x70001000 + SIZEOF_HEADERS;
    18        
    19         .interp : {
    20                 *(.interp);
    21         } :interp :text
    2218#else
    2319        . = 0x1000 + SIZEOF_HEADERS;
    2420#endif
    25        
    26         /* Make sure the code is aligned reasonably */
    27         . = ALIGN(., 16);
    2821       
    2922        .init : {
     
    3528                *(.rodata .rodata.*);
    3629        } :text
     30       
     31#ifdef LOADER
     32        .interp : {
     33                *(.interp);
     34        } :interp :text
     35#endif
    3736       
    3837        . = . + 0x1000;
  • uspace/lib/c/arch/amd64/include/types.h

    r131d9a4 r70253688  
    4747
    4848typedef uint64_t sysarg_t;
     49typedef int64_t native_t;
    4950
    5051typedef int64_t ssize_t;
  • uspace/lib/c/arch/arm32/_link.ld.in

    r131d9a4 r70253688  
    1515#ifdef LOADER
    1616        . = 0x70001000 + SIZEOF_HEADERS;
    17        
    18         .interp : {
    19                 *(.interp);
    20         } :interp :text
    2117#else
    2218        . = 0x1000 + SIZEOF_HEADERS;
    2319#endif
    24        
    25         /* Make sure the code is aligned reasonably */
    26         . = ALIGN(., 8);
    2720       
    2821        .init : {
     
    3427                *(.rodata .rodata.*);
    3528        } :text
     29       
     30#ifdef LOADER
     31        .interp : {
     32                *(.interp);
     33        } :interp :text
     34#endif
    3635       
    3736        . = . + 0x1000;
  • uspace/lib/c/arch/arm32/include/types.h

    r131d9a4 r70253688  
    4848
    4949typedef uint32_t sysarg_t;
     50typedef int32_t native_t;
    5051
    5152typedef int32_t ssize_t;
  • uspace/lib/c/arch/ia32/_link.ld.in

    r131d9a4 r70253688  
    2424        . = 0x1000 + SIZEOF_HEADERS;
    2525#endif
    26        
    27 #if defined(LOADER) || defined(DLEXE)
    28         .interp : {
    29                 *(.interp);
    30         } :interp :text
    31 #endif
    32        
    33         /* Make sure the code is aligned reasonably */
    34         . = ALIGN(., 16);
    3526       
    3627        .init : {
     
    7162        } :text
    7263#endif
     64       
     65#if defined(LOADER) || defined(DLEXE)
     66        .interp : {
     67                *(.interp);
     68        } :interp :text
     69#endif
     70       
    7371        . = . + 0x1000;
    7472       
  • uspace/lib/c/arch/ia32/include/types.h

    r131d9a4 r70253688  
    4747
    4848typedef uint32_t sysarg_t;
     49typedef int32_t native_t;
    4950
    5051typedef int32_t ssize_t;
  • uspace/lib/c/arch/ia64/_link.ld.in

    r131d9a4 r70253688  
    1515#ifdef LOADER
    1616        . = 0x800000000 + SIZEOF_HEADERS;
    17        
    18         .interp : {
    19                 *(.interp);
    20         } :interp :text
    2117#else
    2218        . = 0x4000 + SIZEOF_HEADERS;
    2319#endif
    2420       
    25         /* Make sure the code is aligned reasonably */
     21        /* Workaround proper alignment of the .init section */
    2622        . = ALIGN(., 16);
    2723       
     
    3430                *(.rodata .rodata.*);
    3531        } :text
     32       
     33#ifdef LOADER
     34        .interp : {
     35                *(.interp);
     36        } :interp :text
     37#endif
    3638       
    3739        . = . + 0x4000;
  • uspace/lib/c/arch/ia64/include/types.h

    r131d9a4 r70253688  
    5757
    5858typedef uint64_t sysarg_t;
     59typedef int64_t native_t;
    5960
    6061typedef int64_t ssize_t;
  • uspace/lib/c/arch/mips32/_link.ld.in

    r131d9a4 r70253688  
    1515#ifdef LOADER
    1616        . = 0x70004000 + SIZEOF_HEADERS;
    17        
    18         .interp : {
    19                 *(.interp);
    20         } :interp :text
    2117#else
    2218        . = 0x4000 + SIZEOF_HEADERS;
    2319#endif
    24        
    25         /* Make sure the code is aligned reasonably */
    26         . = ALIGN(., 16);
    2720       
    2821        .init : {
     
    3427                *(.rodata .rodata.*);
    3528        } :text
     29       
     30#ifdef LOADER
     31        .interp : {
     32                *(.interp);
     33        } :interp :text
     34#endif
    3635       
    3736        . = . + 0x4000;
  • uspace/lib/c/arch/mips32/include/types.h

    r131d9a4 r70253688  
    4848
    4949typedef uint32_t sysarg_t;
     50typedef int32_t native_t;
    5051
    5152typedef int32_t ssize_t;
  • uspace/lib/c/arch/mips64/_link.ld.in

    r131d9a4 r70253688  
    1616#ifdef LOADER
    1717        . = 0x70004000 + SIZEOF_HEADERS;
    18        
    19         .interp : {
    20                 *(.interp);
    21         } :interp :text
    2218#else
    2319        . = 0x4000 + SIZEOF_HEADERS;
    2420#endif
    25        
    26         /* Make sure the code is aligned reasonably */
    27         . = ALIGN(., 16);
    2821       
    2922        .init : {
     
    3528                *(.rodata .rodata.*);
    3629        } :text
     30       
     31#ifdef LOADER
     32        .interp : {
     33                *(.interp);
     34        } :interp :text
     35#endif
    3736       
    3837        . = . + 0x4000;
  • uspace/lib/c/arch/mips64/include/types.h

    r131d9a4 r70253688  
    4848
    4949typedef uint64_t sysarg_t;
     50typedef int64_t native_t;
    5051
    5152typedef int64_t ssize_t;
  • uspace/lib/c/arch/ppc32/_link.ld.in

    r131d9a4 r70253688  
    1616#ifdef LOADER
    1717        . = 0x70001000 + SIZEOF_HEADERS;
    18        
    19         .interp : {
    20                 *(.interp);
    21         } :interp :text
    2218#else
    2319        . = 0x1000 + SIZEOF_HEADERS;
    2420#endif
    25        
    26         /* Make sure the code is aligned reasonably */
    27         . = ALIGN(., 4);
    2821       
    2922        .init : {
     
    3528                *(.rodata .rodata.*);
    3629        } :text
     30       
     31#ifdef LOADER
     32        .interp : {
     33                *(.interp);
     34        } :interp :text
     35#endif
    3736       
    3837        . = . + 0x1000;
  • uspace/lib/c/arch/ppc32/include/types.h

    r131d9a4 r70253688  
    4747
    4848typedef uint32_t sysarg_t;
     49typedef int32_t native_t;
    4950
    5051typedef int32_t ssize_t;
  • uspace/lib/c/arch/sparc64/_link.ld.in

    r131d9a4 r70253688  
    1515#ifdef LOADER
    1616        . = 0x70004000 + SIZEOF_HEADERS;
    17        
    18         .interp : {
    19                 *(.interp);
    20         } :interp :text
    2117#else
    2218        . = 0x4000 + SIZEOF_HEADERS;
    2319#endif
    24        
    25         /* Make sure the code is aligned reasonably */
    26         . = ALIGN(., 16);
    2720       
    2821        .init : {
     
    3427                *(.rodata .rodata.*);
    3528        } :text
     29       
     30#ifdef LOADER
     31        .interp : {
     32                *(.interp);
     33        } :interp :text
     34#endif
    3635       
    3736        . = . + 0x4000;
  • uspace/lib/c/arch/sparc64/include/types.h

    r131d9a4 r70253688  
    4747
    4848typedef uint64_t sysarg_t;
     49typedef int64_t native_t;
    4950
    5051typedef int64_t ssize_t;
  • uspace/lib/c/generic/io/console.c

    r131d9a4 r70253688  
    3838#include <async.h>
    3939#include <errno.h>
    40 #include <stdio.h>
    4140#include <malloc.h>
    4241#include <vfs/vfs_sess.h>
     
    126125{
    127126        async_exch_t *exch = async_exchange_begin(ctrl->output_sess);
    128         async_req_1_0(exch, CONSOLE_CURSOR_VISIBILITY, (show != false));
     127        async_req_1_0(exch, CONSOLE_SET_CURSOR_VISIBILITY, (show != false));
    129128        async_exchange_end(exch);
    130129}
     
    151150{
    152151        async_exch_t *exch = async_exchange_begin(ctrl->output_sess);
    153         async_req_2_0(exch, CONSOLE_GOTO, col, row);
     152        async_req_2_0(exch, CONSOLE_SET_POS, col, row);
    154153        async_exchange_end(exch);
    155154}
  • uspace/lib/c/generic/io/output.c

    r131d9a4 r70253688  
    3737#include <as.h>
    3838#include <ipc/output.h>
     39#include <io/concaps.h>
    3940#include <io/output.h>
    4041
  • uspace/lib/c/generic/tls.c

    r131d9a4 r70253688  
    4242#include <str.h>
    4343#include <align.h>
     44#include <unistd.h>
    4445
    4546/** Create TLS (Thread Local Storage) data structures.
     
    5758       
    5859        tcb = __alloc_tls(&data, tls_size);
     60        if (!tcb)
     61                return NULL;
    5962       
    6063        /*
     
    8992
    9093        result = malloc(sizeof(tcb_t) + size);
     94        if (!result)
     95                return NULL;
    9196        *data = ((void *)result) + sizeof(tcb_t);
     97
    9298        return result;
    9399}
     
    118124        size = ALIGN_UP(size, &_tls_alignment);
    119125        *data = memalign((uintptr_t) &_tls_alignment, sizeof(tcb_t) + size);
    120 
     126        if (!*data)
     127                return NULL;
    121128        tcb = (tcb_t *) (*data + size);
    122129        tcb->self = tcb;
  • uspace/lib/c/include/io/console.h

    r131d9a4 r70253688  
    3737
    3838#include <sys/time.h>
     39#include <io/concaps.h>
     40#include <io/kbd_event.h>
    3941#include <io/keycode.h>
    4042#include <async.h>
    4143#include <bool.h>
    4244#include <stdio.h>
    43 
    44 typedef enum {
    45         CONSOLE_CAP_NONE = 0,
    46         CONSOLE_CAP_STYLE = 1,
    47         CONSOLE_CAP_INDEXED = 2,
    48         CONSOLE_CAP_RGB = 4
    49 } console_caps_t;
    5045
    5146/** Console control structure. */
     
    6964        aid_t input_aid;
    7065} console_ctrl_t;
    71 
    72 typedef enum {
    73         KEY_PRESS,
    74         KEY_RELEASE
    75 } kbd_event_type_t;
    76 
    77 /** Console event structure. */
    78 typedef struct {
    79         /** List handle */
    80         link_t link;
    81        
    82         /** Press or release event. */
    83         kbd_event_type_t type;
    84        
    85         /** Keycode of the key that was pressed or released. */
    86         keycode_t key;
    87        
    88         /** Bitmask of modifiers held. */
    89         keymod_t mods;
    90        
    91         /** The character that was generated or '\0' for none. */
    92         wchar_t c;
    93 } kbd_event_t;
    9466
    9567extern console_ctrl_t *console_init(FILE *, FILE *);
  • uspace/lib/c/include/io/klog.h

    r131d9a4 r70253688  
    3838#include <sys/types.h>
    3939#include <stdarg.h>
     40#include <io/verify.h>
    4041
    4142extern size_t klog_write(const void *, size_t);
    4243extern void klog_update(void);
    43 extern int klog_printf(const char *, ...);
     44extern int klog_printf(const char *, ...)
     45    PRINTF_ATTRIBUTE(1, 2);
    4446extern int klog_vprintf(const char *, va_list);
    4547
  • uspace/lib/c/include/io/log.h

    r131d9a4 r70253688  
    3737#include <stdarg.h>
    3838#include <inttypes.h>
    39 #include <bool.h>
     39#include <io/verify.h>
    4040
    4141typedef enum {
     
    4646        LVL_DEBUG,
    4747        LVL_DEBUG2,
    48 
     48       
    4949        /** For checking range of values */
    5050        LVL_LIMIT
     
    6262extern log_t log_create(const char *, log_t);
    6363
    64 extern void log_msg(log_t, log_level_t, const char *, ...);
     64extern void log_msg(log_t, log_level_t, const char *, ...)
     65    PRINTF_ATTRIBUTE(3, 4);
    6566extern void log_msgv(log_t, log_level_t, const char *, va_list);
    6667
  • uspace/lib/c/include/ipc/console.h

    r131d9a4 r70253688  
    4343        CONSOLE_GET_EVENT,
    4444        CONSOLE_GET_POS,
    45         CONSOLE_GOTO,
     45        CONSOLE_SET_POS,
    4646        CONSOLE_CLEAR,
    4747        CONSOLE_SET_STYLE,
    4848        CONSOLE_SET_COLOR,
    4949        CONSOLE_SET_RGB_COLOR,
    50         CONSOLE_CURSOR_VISIBILITY
     50        CONSOLE_SET_CURSOR_VISIBILITY
    5151} console_request_t;
    5252
  • uspace/lib/c/include/stdio.h

    r131d9a4 r70253688  
    3939#include <stdarg.h>
    4040#include <str.h>
    41 
    42 #ifndef NVERIFY_PRINTF
    43 
    44 #define PRINTF_ATTRIBUTE(start, end) \
    45         __attribute__((format(gnu_printf, start, end)))
    46 
    47 #else /* NVERIFY_PRINTF */
    48 
    49 #define PRINTF_ATTRIBUTE(start, end)
    50 
    51 #endif /* NVERIFY_PRINTF */
     41#include <io/verify.h>
    5242
    5343#define EOF  (-1)
Note: See TracChangeset for help on using the changeset viewer.