Changeset 6946f23 in mainline


Ignore:
Timestamp:
2013-12-17T14:11:24Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0773396, ac36aed
Parents:
f5ceb18 (diff), 2034f98 (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 POSIX-related updates

Math functions were moved to a separate library. This would
allow us to easily swap the dummy implementation with a real
one (e.g. from fdlibm).

Also added few Python examples to uspace/dist/src.

Merged branch: lp:~vojtech-horky/helenos/posix

Files:
6 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile

    rf5ceb18 r6946f23  
    9797        rm -f $(USPACE_PATH)/dist/srv/*
    9898        rm -rf $(USPACE_PATH)/dist/drv/*
    99         rm -f $(USPACE_PATH)/dist/lib/*
     99        rm -rf $(USPACE_PATH)/dist/lib/*
    100100        rm -rf $(USPACE_PATH)/dist/inc/*
    101101        rm -f $(USPACE_PATH)/dist/app/*
  • uspace/Makefile

    rf5ceb18 r6946f23  
    240240        lib/softrend \
    241241        lib/draw \
     242        lib/math \
    242243        lib/net \
    243244        lib/nic \
  • uspace/Makefile.common

    rf5ceb18 r6946f23  
    4545#
    4646#   POSIX_COMPAT       set to 'y' to use POSIX compatibility layer
     47#   NEEDS_MATH         set to 'y' to add implementation of mathematical functions
    4748#
    4849# Optionally, for a binary:
     
    109110LIBSOFTFLOAT_PREFIX = $(LIB_PREFIX)/softfloat
    110111LIBSOFTINT_PREFIX = $(LIB_PREFIX)/softint
     112LIBMATH_PREFIX = $(LIB_PREFIX)/math
    111113
    112114LIBPOSIX_PREFIX = $(LIB_PREFIX)/posix
     
    233235endif
    234236
     237# Do we need math?
     238ifeq ($(NEEDS_MATH),y)
     239        BASE_LIBS += $(LIBMATH_PREFIX)/libmath.a
     240endif
     241
    235242## Setup platform configuration
    236243#
  • uspace/lib/posix/Makefile

    rf5ceb18 r6946f23  
    6060        source/getopt.c \
    6161        source/locale.c \
    62         source/math.c \
    6362        source/pthread/condvar.c \
    6463        source/pthread/keys.c \
  • uspace/lib/posix/include/posix/math.h

    rf5ceb18 r6946f23  
    3636#define POSIX_MATH_H_
    3737
    38 #ifndef __POSIX_DEF__
    39 #define __POSIX_DEF__(x) x
    40 #endif
    41 
    42 #ifdef __GNUC__
    43         #define HUGE_VAL (__builtin_huge_val())
    44 #endif
    45 
    46 /* Normalization Functions */
    47 extern double __POSIX_DEF__(ldexp)(double x, int exp);
    48 extern double __POSIX_DEF__(frexp)(double num, int *exp);
    49 
    50 double __POSIX_DEF__(fabs)(double x);
    51 double __POSIX_DEF__(floor)(double x);
    52 double __POSIX_DEF__(modf)(double x, double *iptr);
    53 double __POSIX_DEF__(fmod)(double x, double y);
    54 double __POSIX_DEF__(pow)(double x, double y);
    55 double __POSIX_DEF__(exp)(double x);
    56 double __POSIX_DEF__(sqrt)(double x);
    57 double __POSIX_DEF__(log)(double x);
    58 double __POSIX_DEF__(sin)(double x);
    59 double __POSIX_DEF__(cos)(double x);
    60 double __POSIX_DEF__(atan2)(double y, double x);
     38#include "libc/math.h"
    6139
    6240#endif /* POSIX_MATH_H_ */
Note: See TracChangeset for help on using the changeset viewer.