Changeset 86ffa27f in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2011-08-07T11:21:44Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cc574511
Parents:
15f3c3f (diff), e8067c0 (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:
4 added
8 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/bitops.h

    r15f3c3f r86ffa27f  
    3838#include <sys/types.h>
    3939
     40/** Mask with bit @a n set. */
     41#define BIT_V(type, n) \
     42    ((type)1 << ((n) - 1))
     43
     44/** Mask with rightmost @a n bits set. */
     45#define BIT_RRANGE(type, n) \
     46    (BIT_V(type, (n) + 1) - 1)
     47
     48/** Mask with bits @a hi .. @a lo set. @a hi >= @a lo. */
     49#define BIT_RANGE(type, hi, lo) \
     50    (BIT_RRANGE(type, (hi) - (lo) + 1) << (lo))
     51
     52/** Extract range of bits @a hi .. @a lo from @a value. */
     53#define BIT_RANGE_EXTRACT(type, hi, lo, value) \
     54    (((value) >> (lo)) & BIT_RRANGE(type, (hi) - (lo) + 1))
    4055
    4156/** Return position of first non-zero bit from left (i.e. [log_2(arg)]).
  • uspace/lib/c/include/elf/elf_load.h

    r15f3c3f r86ffa27f  
    11/*
     2 * Copyright (c) 2006 Sergey Bondari
    23 * Copyright (c) 2008 Jiri Svoboda
    34 * All rights reserved.
     
    3839
    3940#include <arch/elf.h>
     41#include <elf/elf.h>
    4042#include <sys/types.h>
    4143#include <loader/pcb.h>
    4244
    43 #include "elf.h"
     45/**
     46 * ELF error return codes
     47 */
     48#define EE_OK                   0       /* No error */
     49#define EE_INVALID              1       /* Invalid ELF image */
     50#define EE_MEMORY               2       /* Cannot allocate address space */
     51#define EE_INCOMPATIBLE         3       /* ELF image is not compatible with current architecture */
     52#define EE_UNSUPPORTED          4       /* Non-supported ELF (e.g. dynamic ELFs) */
     53#define EE_LOADER               5       /* The image is actually a program loader. */
     54#define EE_IRRECOVERABLE        6
    4455
    4556typedef enum {
     
    8293} elf_ld_t;
    8394
    84 int elf_load_file(const char *file_name, size_t so_bias, eld_flags_t flags,
    85     elf_info_t *info);
    86 void elf_create_pcb(elf_info_t *info, pcb_t *pcb);
     95extern const char *elf_error(unsigned int);
     96extern int elf_load_file(const char *, size_t, eld_flags_t, elf_info_t *);
     97extern void elf_create_pcb(elf_info_t *, pcb_t *);
    8798
    8899#endif
  • uspace/lib/c/include/ipc/console.h

    r15f3c3f r86ffa27f  
    4848        CONSOLE_SET_COLOR,
    4949        CONSOLE_SET_RGB_COLOR,
    50         CONSOLE_CURSOR_VISIBILITY,
    51         CONSOLE_KCON_ENABLE
     50        CONSOLE_CURSOR_VISIBILITY
    5251} console_request_t;
    5352
  • uspace/lib/c/include/ipc/services.h

    r15f3c3f r86ffa27f  
    3838#define LIBC_SERVICES_H_
    3939
     40#include <fourcc.h>
     41
    4042typedef enum {
    41         SERVICE_NONE = 0,
    42         SERVICE_LOAD,
    43         SERVICE_VIDEO,
    44         SERVICE_VFS,
    45         SERVICE_LOC,
    46         SERVICE_DEVMAN,
    47         SERVICE_IRC,
    48         SERVICE_CLIPBOARD,
    49         SERVICE_NETWORKING,
    50         SERVICE_LO,
    51         SERVICE_NE2000,
    52         SERVICE_ETHERNET,
    53         SERVICE_NILDUMMY,
    54         SERVICE_IP,
    55         SERVICE_ARP,
    56         SERVICE_ICMP,
    57         SERVICE_UDP,
    58         SERVICE_TCP
     43        SERVICE_NONE       = 0,
     44        SERVICE_LOAD       = FOURCC('l', 'o', 'a', 'd'),
     45        SERVICE_VIDEO      = FOURCC('v', 'i', 'd', ' '),
     46        SERVICE_VFS        = FOURCC('v', 'f', 's', ' '),
     47        SERVICE_LOC        = FOURCC('l', 'o', 'c', ' '),
     48        SERVICE_DEVMAN     = FOURCC('d', 'e', 'v', 'n'),
     49        SERVICE_IRC        = FOURCC('i', 'r', 'c', ' '),
     50        SERVICE_CLIPBOARD  = FOURCC('c', 'l', 'i', 'p'),
     51        SERVICE_NETWORKING = FOURCC('n', 'e', 't', ' '),
     52        SERVICE_LO         = FOURCC('l', 'o', ' ', ' '),
     53        SERVICE_NE2000     = FOURCC('n', 'e', '2', 'k'),
     54        SERVICE_ETHERNET   = FOURCC('e', 't', 'h', ' '),
     55        SERVICE_NILDUMMY   = FOURCC('n', 'i', 'l', 'd'),
     56        SERVICE_IP         = FOURCC('i', 'p', 'v', '4'),
     57        SERVICE_ARP        = FOURCC('a', 'r', 'p', ' '),
     58        SERVICE_ICMP       = FOURCC('i', 'c', 'm', 'p'),
     59        SERVICE_UDP        = FOURCC('u', 'd', 'p', ' '),
     60        SERVICE_TCP        = FOURCC('t', 'c', 'p', ' ')
    5961} services_t;
    6062
  • uspace/lib/c/include/rtld/elf_dyn.h

    r15f3c3f r86ffa27f  
    3939#include <sys/types.h>
    4040
    41 #include <elf.h>
     41#include <elf/elf.h>
    4242#include <libarch/rtld/elf_dyn.h>
    4343
  • uspace/lib/c/include/rtld/rtld.h

    r15f3c3f r86ffa27f  
    4949
    5050        /** List of all loaded modules including rtld and the program */
    51         link_t modules_head;
     51        list_t modules;
    5252
    5353        /** Temporary hack to place each module at different address. */
  • uspace/lib/c/include/rtld/symbol.h

    r15f3c3f r86ffa27f  
    3636#define LIBC_RTLD_SYMBOL_H_
    3737
     38#include <elf/elf.h>
    3839#include <rtld/rtld.h>
    39 #include <elf.h>
    4040
    4141elf_symbol_t *symbol_bfs_find(const char *name, module_t *start, module_t **mod);
  • uspace/lib/c/include/str.h

    r15f3c3f r86ffa27f  
    4848#define STR_BOUNDS(length)  ((length) << 2)
    4949
     50/**
     51 * Maximum size of a buffer needed to a string converted from space-padded
     52 * ASCII of size @a spa_size using spascii_to_str().
     53 */
     54#define SPASCII_STR_BUFSIZE(spa_size) ((spa_size) + 1)
     55
    5056extern wchar_t str_decode(const char *str, size_t *offset, size_t sz);
    5157extern int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t sz);
     
    7379extern void str_append(char *dest, size_t size, const char *src);
    7480
     81extern int spascii_to_str(char *dest, size_t size, const uint8_t *src, size_t n);
    7582extern void wstr_to_str(char *dest, size_t size, const wchar_t *src);
    7683extern char *wstr_to_astr(const wchar_t *src);
  • uspace/lib/c/include/unistd.h

    r15f3c3f r86ffa27f  
    6363extern ssize_t read(int, void *, size_t);
    6464
     65extern ssize_t read_all(int, void *, size_t);
     66extern ssize_t write_all(int, const void *, size_t);
     67
    6568extern off64_t lseek(int, off64_t, int);
    6669extern int ftruncate(int, aoff64_t);
Note: See TracChangeset for help on using the changeset viewer.