Changeset 850235d in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2013-03-10T14:56:21Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
05bab88
Parents:
ea906c29 (diff), 2277e03 (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/include
Files:
2 added
30 edited
2 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/adt/hash_table.h

    rea906c29 r850235d  
    4040#include <adt/list.h>
    4141#include <unistd.h>
    42 #include <bool.h>
     42#include <stdbool.h>
    4343#include <macros.h>
    4444
  • uspace/lib/c/include/async.h

    rea906c29 r850235d  
    4444#include <sys/time.h>
    4545#include <atomic.h>
    46 #include <bool.h>
     46#include <stdbool.h>
    4747#include <task.h>
    4848
  • uspace/lib/c/include/atomicdflt.h

    rea906c29 r850235d  
    4141
    4242#include <stdint.h>
    43 #include <bool.h>
     43#include <stdbool.h>
    4444
    4545typedef struct atomic {
  • uspace/lib/c/include/bd_srv.h

    rea906c29 r850235d  
    3939#include <async.h>
    4040#include <fibril_synch.h>
    41 #include <bool.h>
     41#include <stdbool.h>
    4242#include <sys/types.h>
    4343
  • uspace/lib/c/include/cfg.h

    rea906c29 r850235d  
    4141#include <adt/list.h>
    4242#include <sys/types.h>
    43 #include <bool.h>
     43#include <stdbool.h>
    4444
    4545/**
  • uspace/lib/c/include/ddi.h

    rea906c29 r850235d  
    3636#define LIBC_DDI_H_
    3737
     38#include <stdbool.h>
    3839#include <sys/types.h>
     40#include <sys/time.h>
    3941#include <abi/ddi/irq.h>
    4042#include <task.h>
     
    5052extern int dmamem_unmap_anonymous(void *);
    5153
    52 extern int iospace_enable(task_id_t, void *, unsigned long);
    5354extern int pio_enable(void *, size_t, void **);
     55
     56typedef void (*trace_fnc)(const volatile void *place, uint32_t val,
     57    volatile void* base, size_t size, void *data, bool write);
     58
     59extern int pio_trace_enable(void *, size_t, trace_fnc, void *);
     60extern void pio_trace_log(const volatile void *, uint32_t val, bool write);
     61extern void pio_trace_disable(void *);
     62
     63extern void pio_write_8(ioport8_t *, uint8_t);
     64extern void pio_write_16(ioport16_t *, uint16_t);
     65extern void pio_write_32(ioport32_t *, uint32_t);
     66
     67extern uint8_t pio_read_8(const ioport8_t *);
     68extern uint16_t pio_read_16(const ioport16_t *);
     69extern uint32_t pio_read_32(const ioport32_t *);
     70
     71static inline uint8_t pio_change_8(
     72    ioport8_t *reg, uint8_t val, uint8_t mask, useconds_t delay)
     73{
     74        uint8_t v = pio_read_8(reg);
     75        udelay(delay);
     76        pio_write_8(reg, (v & ~mask) | val);
     77        return v;
     78}
     79
     80static inline uint16_t pio_change_16(
     81    ioport16_t *reg, uint16_t val, uint16_t mask, useconds_t delay)
     82{
     83        uint16_t v = pio_read_16(reg);
     84        udelay(delay);
     85        pio_write_16(reg, (v & ~mask) | val);
     86        return v;
     87}
     88
     89static inline uint32_t pio_change_32(
     90    ioport32_t *reg, uint32_t val, uint32_t mask, useconds_t delay)
     91{
     92        uint32_t v = pio_read_32(reg);
     93        udelay(delay);
     94        pio_write_32(reg, (v & ~mask) | val);
     95        return v;
     96}
     97
     98static inline uint8_t pio_set_8(ioport8_t *r, uint8_t v, useconds_t d)
     99{
     100        return pio_change_8(r, v, 0, d);
     101}
     102static inline uint16_t pio_set_16(ioport16_t *r, uint16_t v, useconds_t d)
     103{
     104        return pio_change_16(r, v, 0, d);
     105}
     106static inline uint32_t pio_set_32(ioport32_t *r, uint32_t v, useconds_t d)
     107{
     108        return pio_change_32(r, v, 0, d);
     109}
     110
     111static inline uint8_t pio_clear_8(ioport8_t *r, uint8_t v, useconds_t d)
     112{
     113        return pio_change_8(r, 0, v, d);
     114}
     115static inline uint16_t pio_clear_16(ioport16_t *r, uint16_t v, useconds_t d)
     116{
     117        return pio_change_16(r, 0, v, d);
     118}
     119static inline uint32_t pio_clear_32(ioport32_t *r, uint32_t v, useconds_t d)
     120{
     121        return pio_change_32(r, 0, v, d);
     122}
    54123
    55124extern int irq_register(int, int, int, irq_code_t *);
  • uspace/lib/c/include/device/hw_res.h

    rea906c29 r850235d  
    3838#include <ipc/dev_iface.h>
    3939#include <async.h>
    40 #include <bool.h>
     40#include <stdbool.h>
    4141
    4242#define DMA_MODE_ON_DEMAND  0
  • uspace/lib/c/include/devman.h

    rea906c29 r850235d  
    4040#include <ipc/loc.h>
    4141#include <async.h>
    42 #include <bool.h>
     42#include <stdbool.h>
    4343
    4444extern async_exch_t *devman_exchange_begin_blocking(devman_interface_t);
  • uspace/lib/c/include/fibril_synch.h

    rea906c29 r850235d  
    4040#include <libarch/tls.h>
    4141#include <sys/time.h>
    42 #include <bool.h>
     42#include <stdbool.h>
    4343
    4444typedef struct {
  • uspace/lib/c/include/inet/iplink_srv.h

    rea906c29 r850235d  
    3838#include <async.h>
    3939#include <fibril_synch.h>
    40 #include <bool.h>
     40#include <stdbool.h>
    4141#include <sys/types.h>
    4242
  • uspace/lib/c/include/io/charfield.h

    rea906c29 r850235d  
    3838
    3939#include <sys/types.h>
    40 #include <bool.h>
     40#include <stdbool.h>
    4141#include <io/color.h>
    4242#include <io/style.h>
  • uspace/lib/c/include/io/con_srv.h

    rea906c29 r850235d  
    4444#include <io/pixel.h>
    4545#include <io/style.h>
    46 #include <bool.h>
     46#include <stdbool.h>
    4747#include <sys/time.h>
    4848#include <sys/types.h>
  • uspace/lib/c/include/io/console.h

    rea906c29 r850235d  
    4141#include <io/keycode.h>
    4242#include <async.h>
    43 #include <bool.h>
     43#include <stdbool.h>
    4444#include <stdio.h>
    4545
  • uspace/lib/c/include/io/klog.h

    rea906c29 r850235d  
    4242extern size_t klog_write(const void *, size_t);
    4343extern void klog_update(void);
     44extern void klog_command(const void *, size_t);
    4445extern int klog_printf(const char *, ...)
    4546    PRINTF_ATTRIBUTE(1, 2);
  • uspace/lib/c/include/io/pixel.h

    rea906c29 r850235d  
    4242        ((channel) >> (8 - (bits)))
    4343
     44#define INVERT(pixel) ((pixel) ^ 0x00ffffff)
     45
    4446#define ALPHA(pixel)  ((pixel) >> 24)
    4547#define RED(pixel)    (((pixel) & 0x00ff0000) >> 16)
  • uspace/lib/c/include/io/pixelmap.h

    rea906c29 r850235d  
    5252    sysarg_t y)
    5353{
    54         size_t offset = y * pixelmap->width + x;
    55         pixel_t *pixel = pixelmap->data + offset;
    56         return pixel;
     54        if (x < pixelmap->width && y < pixelmap->height) {
     55                size_t offset = y * pixelmap->width + x;
     56                pixel_t *pixel = pixelmap->data + offset;
     57                return pixel;
     58        } else {
     59                return NULL;
     60        }
    5761}
    5862
  • uspace/lib/c/include/io/window.h

    rea906c29 r850235d  
    3636#define LIBC_IO_WINDOW_H_
    3737
    38 #include <bool.h>
     38#include <stdbool.h>
    3939#include <sys/types.h>
    4040#include <async.h>
     
    7171        ET_POSITION_EVENT,
    7272        ET_SIGNAL_EVENT,
     73        ET_WINDOW_FOCUS,
     74        ET_WINDOW_UNFOCUS,
    7375        ET_WINDOW_RESIZE,
    7476        ET_WINDOW_REFRESH,
     
    100102} window_grab_flags_t;
    101103
    102 extern int win_register(async_sess_t *, service_id_t *, service_id_t *);
     104extern int win_register(async_sess_t *, service_id_t *, service_id_t *, sysarg_t, sysarg_t);
    103105
    104106extern int win_get_event(async_sess_t *, window_event_t *);
  • uspace/lib/c/include/ipc/vfs.h

    rea906c29 r850235d  
    3838#include <ipc/common.h>
    3939#include <sys/types.h>
    40 #include <bool.h>
     40#include <stdbool.h>
    4141
    4242#define FS_NAME_MAXLEN  20
  • uspace/lib/c/include/loc.h

    rea906c29 r850235d  
    3838#include <ipc/loc.h>
    3939#include <async.h>
    40 #include <bool.h>
     40#include <stdbool.h>
    4141
    4242typedef void (*loc_cat_change_cb_t)(void);
  • uspace/lib/c/include/macros.h

    rea906c29 r850235d  
    3838#define min(a, b)  ((a) < (b) ? (a) : (b))
    3939#define max(a, b)  ((a) > (b) ? (a) : (b))
     40#define abs(a)     ((a) >= 0 ? (a) : (-a))
     41
    4042
    4143#define KiB2SIZE(kb)  ((kb) << 10)
     
    6062#endif
    6163
     64#define _paddname(line) PADD_ ## line ## __
     65#define _padd(width, line) uint ## width ## _t _paddname(line)
     66#define PADD32 _padd(32, __LINE__)
     67#define PADD16 _padd(16, __LINE__)
     68#define PADD8 _padd(8, __LINE__)
     69
    6270/** @}
    6371 */
  • uspace/lib/c/include/nic/nic.h

    rea906c29 r850235d  
    4040
    4141#include <nic/eth_phys.h>
    42 #include <bool.h>
     42#include <stdbool.h>
    4343
    4444/** Ethernet address length. */
  • uspace/lib/c/include/rtld/dynamic.h

    rea906c29 r850235d  
    3636#define LIBC_RTLD_DYNAMIC_H_
    3737
    38 #include <bool.h>
     38#include <stdbool.h>
    3939#include <rtld/elf_dyn.h>
    4040#include <libarch/rtld/dynamic.h>
  • uspace/lib/c/include/sort.h

    rea906c29 r850235d  
    3737
    3838#include <sys/types.h>
    39 #include <bool.h>
     39#include <stdbool.h>
    4040
    4141typedef int (* sort_cmp_t)(void *, void *, void *);
  • uspace/lib/c/include/stack.h

    rea906c29 r850235d  
    11/*
    2  * Copyright (c) 2006 Martin Decky
     2 * Copyright (c) 2012 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    3333 */
    3434
    35 #ifndef LIBC_BOOL_H_
    36 #define LIBC_BOOL_H_
     35#ifndef LIBC_STACK_H_
     36#define LIBC_STACK_H_
    3737
    3838#include <libarch/types.h>
    39 #include <abi/bool.h>
    4039
    41 #define false  0
    42 #define true   1
     40extern size_t stack_size_get(void);
    4341
    4442#endif
  • uspace/lib/c/include/stacktrace.h

    rea906c29 r850235d  
    3838
    3939#include <sys/types.h>
    40 #include <bool.h>
     40#include <stdbool.h>
    4141
    4242typedef struct {
  • uspace/lib/c/include/stats.h

    rea906c29 r850235d  
    3939#include <thread.h>
    4040#include <stdint.h>
    41 #include <bool.h>
     41#include <stdbool.h>
    4242#include <sys/types.h>
    4343#include <abi/sysinfo.h>
  • uspace/lib/c/include/stdbool.h

    rea906c29 r850235d  
    11/*
    2  * Copyright (c) 2011 Jiri Zarevucky
     2 * Copyright (c) 2006 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libposix
     29/** @addtogroup libc
    3030 * @{
    3131 */
    32 /** @file Boolean type and values.
     32/** @file
    3333 */
    3434
    35 #ifndef POSIX_STDBOOL_H_
    36 #define POSIX_STDBOOL_H_
     35#ifndef LIBC_BOOL_H_
     36#define LIBC_BOOL_H_
    3737
    38 #ifdef LIBC_BOOL_H_
     38#include <libarch/types.h>
     39#include <abi/bool.h>
    3940
    40 #if (!defined(POSIX_STDIO_H_)) && \
    41     (!defined(POSIX_STDLIB_H_)) && \
    42     (!defined(POSIX_STRING_H_))
    43         #error "You can't include bool.h and stdbool.h at the same time."
     41#define false  0
     42#define true   1
     43
     44#define __bool_true_false_are_defined 1
     45
    4446#endif
    4547
    46 #endif /* LIBC_BOOL_H */
    47 
    48 #define LIBC_BOOL_H_
    49 
    50 #define bool _Bool
    51 #define true 1
    52 #define false 0
    53 #define __bool_true_false_are_defined 1
    54 
    55 #endif /* POSIX_STDBOOL_H_ */
     48/** @}
     49 */
  • uspace/lib/c/include/stdio.h

    rea906c29 r850235d  
    4040#include <str.h>
    4141#include <io/verify.h>
     42#include <abi/klog.h>
    4243
    4344#define EOF  (-1)
     
    5152                int _n = snprintf(_buf, sizeof(_buf), fmt, ##__VA_ARGS__); \
    5253                if (_n > 0) \
    53                         (void) __SYSCALL3(SYS_KLOG, 1, (sysarg_t) _buf, str_size(_buf)); \
     54                        (void) __SYSCALL3(SYS_KLOG, KLOG_WRITE, (sysarg_t) _buf, str_size(_buf)); \
    5455        }
    5556
  • uspace/lib/c/include/str.h

    rea906c29 r850235d  
    3939#include <mem.h>
    4040#include <sys/types.h>
    41 #include <bool.h>
     41#include <stdbool.h>
    4242
    4343#define U_SPECIAL  '?'
  • uspace/lib/c/include/sys/stat.h

    rea906c29 r850235d  
    3737
    3838#include <sys/types.h>
    39 #include <bool.h>
     39#include <stdbool.h>
    4040#include <ipc/vfs.h>
    4141#include <ipc/loc.h>
  • uspace/lib/c/include/sysinfo.h

    rea906c29 r850235d  
    3737
    3838#include <sys/types.h>
    39 #include <bool.h>
     39#include <stdbool.h>
    4040#include <abi/sysinfo.h>
    4141
  • uspace/lib/c/include/tls.h

    rea906c29 r850235d  
    4848extern char _tbss_end;
    4949
    50 extern tcb_t *__make_tls(void);
    51 extern tcb_t *__alloc_tls(void **, size_t);
    52 extern void __free_tls(tcb_t *);
    53 extern void __free_tls_arch(tcb_t *, size_t);
     50extern tcb_t *tls_make(void);
     51extern tcb_t *tls_alloc_arch(void **, size_t);
     52extern void tls_free(tcb_t *);
     53extern void tls_free_arch(tcb_t *, size_t);
    5454
    5555#ifdef CONFIG_TLS_VARIANT_1
Note: See TracChangeset for help on using the changeset viewer.