Changeset 3558ba93 in mainline for uspace/lib/c/include/setjmp.h


Ignore:
Timestamp:
2013-12-09T15:55:40Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5b89d43b
Parents:
12735849 (diff), 9521eca (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 GCC port updates

This commit includes various small changes needed to compile GCC or
dependent libraries on more architectures than ia32.

A lot of ARM EABI functions (softfloat) were added, mostly as aliases
to already existing ones.

A generic implementation of long jump was added, based on context save
and restore functions.

Examples in src/c/ were updated to be compilable again and new scripts
for compiling with GCC were added.

New uspace/overlay directory was added that is verbatim copied into the
final image. Cleaning its content is left to the user.

A small `untar' utility was implemented for unpacking tarballs (it does
not support the standard switches nor a compressed content).

Merged branch: lp:~vojtech-horky/helenos/gcc-port

File:
1 edited

Legend:

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

    r12735849 r3558ba93  
    11/*
    22 * Copyright (c) 2008 Josef Cejka
     3 * Copyright (c) 2013 Vojtech Horky
    34 * All rights reserved.
    45 *
     
    3031 * @{
    3132 */
    32 /** @file
     33/** @file Long jump implementation.
     34 *
     35 * Implementation inspired by Jiri Zarevucky's code from
     36 * http://bazaar.launchpad.net/~zarevucky-jiri/helenos/stdc/revision/1544/uspace/lib/posix/setjmp.h
    3337 */
    3438
     
    3842#include <libarch/fibril.h>
    3943
    40 typedef context_t jmp_buf[1];
     44struct jmp_buf_interal {
     45        context_t context;
     46        int return_value;
     47};
     48typedef struct jmp_buf_interal jmp_buf[1];
    4149
    42 extern int setjmp(jmp_buf env);
     50/*
     51 * Specified as extern to minimize number of included headers
     52 * because this file is used as is in libposix too.
     53 */
     54extern int context_save(context_t *ctx) __attribute__((returns_twice));
     55
     56/**
     57 * Save current environment (registers).
     58 *
     59 * This function may return twice.
     60 *
     61 * @param env Variable where to save the environment (of type jmp_buf).
     62 * @return Whether the call returned after longjmp.
     63 * @retval 0 Environment was saved, normal execution.
     64 * @retval other longjmp was executed and returned here.
     65 */
     66#define setjmp(env) \
     67        ((env)[0].return_value = 0, \
     68        context_save(&(env)[0].context), \
     69        (env)[0].return_value)
     70
    4371extern void longjmp(jmp_buf env, int val) __attribute__((noreturn));
    4472
Note: See TracChangeset for help on using the changeset viewer.