Changeset 3deb0155 in mainline for uspace/lib


Ignore:
Timestamp:
2013-04-10T19:11:45Z (13 years ago)
Author:
Beniamino Galvani <b.galvani@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dd0c8a0
Parents:
44186b01 (diff), b4f43a1 (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
Files:
1 added
13 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/ia32/src/setjmp.S

    r44186b01 r3deb0155  
    3535.type setjmp,@function
    3636setjmp:
    37         movl 0(%esp),%eax       # save pc value into eax       
    38         movl 4(%esp),%edx       # address of the jmp_buf structure to save context to
    39 
    40                 # save registers to the jmp_buf structure
     37        movl 0(%esp),%eax  # save pc value into eax
     38        movl 4(%esp),%edx  # address of the jmp_buf structure to save context to
     39       
     40        # save registers to the jmp_buf structure
    4141        CONTEXT_SAVE_ARCH_CORE %edx %eax
    42 
    43         xorl %eax,%eax          # set_jmp returns 0
     42       
     43        xorl %eax,%eax  # set_jmp returns 0
    4444        ret
    4545
    4646.type longjmp,@function
    4747longjmp:
    48 
    49         movl 4(%esp), %ecx      # put address of jmp_buf into ecx
    50         movl 8(%esp), %eax      # put return value into eax     
    51 
    52                 # restore registers from the jmp_buf structure
     48        movl 4(%esp), %ecx  # put address of jmp_buf into ecx
     49        movl 8(%esp), %eax  # put return value into eax
     50       
     51        # restore registers from the jmp_buf structure
    5352        CONTEXT_RESTORE_ARCH_CORE %ecx %edx
    54 
    55         movl %edx,0(%esp)       # put saved pc on stack
     53       
     54        movl %edx,0(%esp)  # put saved pc on stack
    5655        ret
    57 
  • uspace/lib/c/generic/adt/hash_table.c

    r44186b01 r3deb0155  
    8181 * @param init_size Initial desired number of hash table buckets. Pass zero
    8282 *                 if you want the default initial size.
    83  * @param max_keys Maximal number of keys needed to identify an item.
     83 * @param max_load The table is resized when the average load per bucket
     84 *                 exceeds this number. Pass zero if you want the default.
    8485 * @param op       Hash table operations structure. remove_callback()
    8586 *                 is optional and can be NULL if no action is to be taken
  • uspace/lib/c/generic/async.c

    r44186b01 r3deb0155  
    20902090 * @param arg   User defined argument.
    20912091 * @param flags Storage for the received flags. Can be NULL.
    2092  * @param dst   Destination address space area base. Cannot be NULL.
     2092 * @param dst   Address of the storage for the destination address space area
     2093 *              base address. Cannot be NULL.
    20932094 *
    20942095 * @return Zero on success or a negative error code from errno.h.
     
    22182219 *
    22192220 * @param callid Hash of the IPC_M_DATA_WRITE call to answer.
    2220  * @param dst    Destination address space area base address.
     2221 * @param dst    Address of the storage for the destination address space area
     2222 *               base address.
    22212223 *
    22222224 * @return Zero on success or a value from @ref errno.h on failure.
  • uspace/lib/c/include/mem.h

    r44186b01 r3deb0155  
    4040#define bzero(ptr, len)  memset((ptr), 0, (len))
    4141
    42 extern void *memset(void *, int, size_t);
    43 extern void *memcpy(void *, const void *, size_t);
     42extern void *memset(void *, int, size_t)
     43    __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
     44extern void *memcpy(void *, const void *, size_t)
     45    __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
    4446extern void *memmove(void *, const void *, size_t);
    4547
  • uspace/lib/c/include/setjmp.h

    r44186b01 r3deb0155  
    3838#include <libarch/fibril.h>
    3939
    40 typedef context_t jmp_buf;
     40typedef context_t jmp_buf[1];
    4141
    4242extern int setjmp(jmp_buf env);
     
    4747/** @}
    4848 */
    49 
  • uspace/lib/c/include/sys/types.h

    r44186b01 r3deb0155  
    5050typedef volatile uint32_t ioport32_t;
    5151
     52typedef int16_t unaligned_int16_t __attribute__ ((aligned(1)));
     53typedef int32_t unaligned_int32_t __attribute__ ((aligned(1)));
     54typedef int64_t unaligned_int64_t __attribute__ ((aligned(1)));
     55
     56typedef uint16_t unaligned_uint16_t __attribute__ ((aligned(1)));
     57typedef uint32_t unaligned_uint32_t __attribute__ ((aligned(1)));
     58typedef uint64_t unaligned_uint64_t __attribute__ ((aligned(1)));
     59
    5260#endif
    5361
  • uspace/lib/gui/Makefile

    r44186b01 r3deb0155  
    3535SOURCES = \
    3636        button.c \
     37        canvas.c \
    3738        connection.c \
    3839        grid.c \
  • uspace/lib/gui/canvas.h

    r44186b01 r3deb0155  
    11/*
    2  * Copyright (c) 2008 Martin Decky
     2 * Copyright (c) 2013 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup genarch
     29/** @addtogroup gui
    3030 * @{
    3131 */
    32 /** @file
     32/**
     33 * @file
    3334 */
    3435
    35 #ifndef KERN_LOGO_196X66_H_
    36 #define KERN_LOGO_196X66_H_
     36#ifndef GUI_CANVAS_H_
     37#define GUI_CANVAS_H_
    3738
    38 #define LOGO_WIDTH   196
    39 #define LOGO_HEIGHT  66
    40 #define LOGO_COLOR   0xffffff
     39#include <stdbool.h>
     40#include <sys/types.h>
     41#include <io/pixel.h>
     42#include <surface.h>
     43#include "widget.h"
    4144
    42 #include <typedefs.h>
     45typedef struct {
     46        widget_t widget;
     47        sysarg_t width;
     48        sysarg_t height;
     49        surface_t *surface;
     50} canvas_t;
    4351
    44 extern uint32_t fb_logo[LOGO_WIDTH * LOGO_HEIGHT];
     52extern bool init_canvas(canvas_t *, widget_t *, sysarg_t, sysarg_t,
     53    surface_t *);
     54extern canvas_t *create_canvas(widget_t *, sysarg_t, sysarg_t, surface_t *);
     55extern void deinit_canvas(canvas_t *);
    4556
    4657#endif
  • uspace/lib/posix/include/posix/fcntl.h

    r44186b01 r3deb0155  
    4444#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
    4545
     46/* Dummy compatibility flag */
     47#undef O_NOCTTY
     48#define O_NOCTTY 0
     49
    4650/* fcntl commands */
    4751#undef F_DUPFD
  • uspace/lib/posix/include/posix/float.h

    r44186b01 r3deb0155  
    3636#define POSIX_FLOAT_H_
    3737
    38 /* Empty. Just to satisfy preprocessor. */
     38/* Rouding direction -1 - unknown */
     39#define FLT_ROUNDS (-1)
     40
     41/* define some standard C constants in terms of GCC built-ins */
     42#ifdef __GNUC__
     43        #undef DBL_MANT_DIG
     44        #define DBL_MANT_DIG __DBL_MANT_DIG__
     45        #undef DBL_MIN_EXP
     46        #define DBL_MIN_EXP __DBL_MIN_EXP__
     47        #undef DBL_MAX_EXP
     48        #define DBL_MAX_EXP __DBL_MAX_EXP__
     49        #undef DBL_MAX
     50        #define DBL_MAX __DBL_MAX__
     51        #undef DBL_MAX_10_EXP
     52        #define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
     53        #undef DBL_MIN_10_EXP
     54        #define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
     55        #undef DBL_MIN
     56        #define DBL_MIN __DBL_MIN__
     57        #undef DBL_DIG
     58        #define DBL_DIG __DBL_DIG__
     59        #undef DBL_EPSILON
     60        #define DBL_EPSILON __DBL_EPSILON__
     61        #undef FLT_RADIX
     62        #define FLT_RADIX __FLT_RADIX__
     63#endif
    3964
    4065#endif /* POSIX_FLOAT_H_ */
  • uspace/lib/posix/include/posix/limits.h

    r44186b01 r3deb0155  
    4949#define PATH_MAX 256
    5050
     51/* it's probably a safe assumption */
     52#undef CHAR_BIT
     53#define CHAR_BIT 8
     54
    5155#endif /* POSIX_LIMITS_H_ */
    5256
  • uspace/lib/posix/include/posix/math.h

    r44186b01 r3deb0155  
    3636#define POSIX_MATH_H_
    3737
     38#ifdef __GNUC__
     39        #define HUGE_VAL (__builtin_huge_val())
     40#endif
     41
    3842/* Normalization Functions */
    3943extern double posix_ldexp(double x, int exp);
    4044extern double posix_frexp(double num, int *exp);
    4145
     46double posix_fabs(double x);
     47double posix_floor(double x);
     48double posix_modf(double x, double *iptr);
     49double posix_fmod(double x, double y);
     50double posix_pow(double x, double y);
     51double posix_exp(double x);
     52double posix_sqrt(double x);
     53double posix_log(double x);
     54double posix_sin(double x);
     55double posix_cos(double x);
     56double posix_atan2(double y, double x);
     57
    4258#ifndef LIBPOSIX_INTERNAL
    4359        #define ldexp posix_ldexp
    4460        #define frexp posix_frexp
     61
     62        #define fabs posix_fabs
     63        #define floor posix_floor
     64        #define modf posix_modf
     65        #define fmod posix_fmod
     66        #define pow posix_pow
     67        #define exp posix_exp
     68        #define sqrt posix_sqrt
     69        #define log posix_log
     70        #define sin posix_sin
     71        #define cos posix_cos
     72        #define atan2 posix_atan2
    4573#endif
    4674
  • uspace/lib/posix/include/posix/stdio.h

    r44186b01 r3deb0155  
    6161
    6262typedef struct _IO_FILE FILE;
     63
     64#ifndef LIBPOSIX_INTERNAL
     65        enum _buffer_type {
     66                /** No buffering */
     67                _IONBF,
     68                /** Line buffering */
     69                _IOLBF,
     70                /** Full buffering */
     71                _IOFBF
     72        };
     73#endif
    6374
    6475extern FILE *stdin;
  • uspace/lib/posix/source/math.c

    r44186b01 r3deb0155  
    6262}
    6363
     64/**
     65 *
     66 * @param x
     67 * @return
     68 */
     69double posix_cos(double x)
     70{
     71        // TODO: Python dependency
     72        not_implemented();
     73}
     74
     75/**
     76 *
     77 * @param x
     78 * @param y
     79 * @return
     80 */
     81double posix_pow(double x, double y)
     82{
     83        // TODO: Python dependency
     84        not_implemented();
     85}
     86
     87/**
     88 *
     89 * @param x
     90 * @return
     91 */
     92double posix_floor(double x)
     93{
     94        // TODO: Python dependency
     95        not_implemented();
     96}
     97
     98/**
     99 *
     100 * @param x
     101 * @return
     102 */
     103double posix_fabs(double x)
     104{
     105        // TODO: Python dependency
     106        not_implemented();
     107}
     108
     109/**
     110 *
     111 * @param x
     112 * @param iptr
     113 * @return
     114 */
     115double posix_modf(double x, double *iptr)
     116{
     117        // TODO: Python dependency
     118        not_implemented();
     119}
     120
     121/**
     122 *
     123 * @param x
     124 * @param y
     125 * @return
     126 */
     127double posix_fmod(double x, double y)
     128{
     129        // TODO: Python dependency
     130        not_implemented();
     131}
     132
     133/**
     134 *
     135 * @param x
     136 * @return
     137 */
     138double posix_log(double x)
     139{
     140        // TODO: Python dependency
     141        not_implemented();
     142}
     143
     144/**
     145 *
     146 * @param x
     147 * @param y
     148 * @return
     149 */
     150double posix_atan2(double y, double x)
     151{
     152        // TODO: Python dependency
     153        not_implemented();
     154}
     155
     156/**
     157 *
     158 * @param x
     159 * @return
     160 */
     161double posix_sin(double x)
     162{
     163        // TODO: Python dependency
     164        not_implemented();
     165}
     166
     167/**
     168 *
     169 * @param x
     170 * @return
     171 */
     172double posix_exp(double x)
     173{
     174        // TODO: Python dependency
     175        not_implemented();
     176}
     177
     178/**
     179 *
     180 * @param x
     181 * @return
     182 */
     183double posix_sqrt(double x)
     184{
     185        // TODO: Python dependency
     186        not_implemented();
     187}
     188
    64189/** @}
    65190 */
Note: See TracChangeset for help on using the changeset viewer.