~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to erts/emulator/beam/sys.h

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-06-11 12:18:07 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090611121807-ks7eb4xrt7dsysgx
Tags: 1:13.b.1-dfsg-1
* New upstream release.
* Removed unnecessary dependency of erlang-os-mon on erlang-observer and
  erlang-tools and added missing dependency of erlang-nox on erlang-os-mon
  (closes: #529512).
* Removed a patch to eunit application because the bug was fixed upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
246
246
typedef unsigned long Eterm;
247
247
typedef unsigned long Uint;
248
248
typedef long          Sint;
 
249
#define ERTS_SIZEOF_ETERM SIZEOF_LONG
249
250
#elif SIZEOF_VOID_P == SIZEOF_INT
250
251
typedef unsigned int Eterm;
251
252
typedef unsigned int Uint;
252
253
typedef int          Sint;
 
254
#define ERTS_SIZEOF_ETERM SIZEOF_INT
253
255
#else
254
256
#error Found no appropriate type to use for 'Eterm', 'Uint' and 'Sint'
255
257
#endif
298
300
#error 64-bit architecture, but no appropriate type to use for Uint64 and Sint64 found 
299
301
#endif
300
302
 
 
303
#if defined(ARCH_64)
 
304
#  define ERTS_WORD_ALIGN_PAD_SZ(X) \
 
305
    (((size_t) 8) - (((size_t) (X)) & ((size_t) 7)))
 
306
#elif defined(ARCH_32)
 
307
#  define ERTS_WORD_ALIGN_PAD_SZ(X) \
 
308
    (((size_t) 4) - (((size_t) (X)) & ((size_t) 3)))
 
309
#else
 
310
#error "Not supported..."
 
311
#endif
 
312
 
301
313
#include "erl_lock_check.h"
302
314
#include "erl_smp.h"
303
315
 
522
534
    int exit_status;            /* Report exit status of subprocess. */
523
535
    char *envir;                /* Environment of the port process, */
524
536
                                /* in Windows format. */
 
537
    char **argv;                /* Argument vector in Unix'ish format. */
525
538
    char *wd;                   /* Working directory. */
 
539
    unsigned spawn_type;        /* Bitfield of ERTS_SPAWN_DRIVER | 
 
540
                                   ERTS_SPAWN_EXTERNAL | both*/ 
526
541
 
527
542
#ifdef _OSE_
528
543
    enum PROCESS_TYPE process_type;
531
546
 
532
547
} SysDriverOpts;
533
548
 
 
549
extern char *erts_default_arg0;
534
550
 
535
551
extern char os_type[];
536
552
 
620
636
int local_to_univ(Sint *year, Sint *month, Sint *day, 
621
637
                  Sint *hour, Sint *minute, Sint *second, int isdst);
622
638
void get_now(Uint*, Uint*, Uint*);
 
639
void get_sys_now(Uint*, Uint*, Uint*);
623
640
EXTERN_FUNCTION(void, set_break_quit, (void (*)(void), void (*)(void)));
624
641
 
625
642
void os_flavor(char*, unsigned);
960
977
ERTS_GLB_INLINE long erts_refc_inctest(erts_refc_t *refcp, long min_val);
961
978
ERTS_GLB_INLINE void erts_refc_dec(erts_refc_t *refcp, long min_val);
962
979
ERTS_GLB_INLINE long erts_refc_dectest(erts_refc_t *refcp, long min_val);
 
980
ERTS_GLB_INLINE void erts_refc_add(erts_refc_t *refcp, long diff, long min_val);
963
981
ERTS_GLB_INLINE long erts_refc_read(erts_refc_t *refcp, long min_val);
964
982
 
965
983
#if ERTS_GLB_INLINE_INCL_FUNC_DEF
1024
1042
    return val;
1025
1043
}
1026
1044
 
 
1045
ERTS_GLB_INLINE void
 
1046
erts_refc_add(erts_refc_t *refcp, long diff, long min_val)
 
1047
{
 
1048
#ifdef ERTS_REFC_DEBUG
 
1049
    long val = erts_smp_atomic_addtest((erts_smp_atomic_t *) refcp, diff);
 
1050
    if (val < min_val)
 
1051
        erl_exit(ERTS_ABORT_EXIT,
 
1052
                 "erts_refc_add(%ld): Bad refc found (refc=%ld < %ld)!\n",
 
1053
                 diff, val, min_val);
 
1054
#else
 
1055
    erts_smp_atomic_add((erts_smp_atomic_t *) refcp, diff);
 
1056
#endif
 
1057
}
 
1058
 
1027
1059
ERTS_GLB_INLINE long
1028
1060
erts_refc_read(erts_refc_t *refcp, long min_val)
1029
1061
{