Ticket #3763: libroot.diff

File libroot.diff, 20.2 KB (added by pfoetchen_, 15 years ago)
  • src/system/libroot/os/arch/arm/time.c

     
     1/*
     2 * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
     3 * Distributed under the terms of the MIT License.
     4 */
     5
     6#include <OS.h>
     7
     8#include <arch_cpu.h>
     9#include <libroot_private.h>
     10#include <real_time_data.h>
     11
     12
     13static struct arch_real_time_data *sRealTimeData;
     14
     15void
     16__arch_init_time(struct real_time_data *data, bool setDefaults)
     17{
     18    sRealTimeData = &data->arch_data;
     19
     20    if (setDefaults) {
     21        sRealTimeData->data[0].system_time_offset = 0;
     22        sRealTimeData->system_time_conversion_factor = 1000000000LL;
     23        sRealTimeData->version = 0;
     24    }
     25#warning todo system time
     26//  __m68k_setup_system_time(&sRealTimeData->system_time_conversion_factor);
     27}
     28
     29
     30bigtime_t
     31__arch_get_system_time_offset(struct real_time_data *data)
     32{
     33    int32 version;
     34    bigtime_t offset;
     35    do {
     36        version = sRealTimeData->version;
     37        offset = sRealTimeData->data[version % 2].system_time_offset;
     38    } while (version != sRealTimeData->version);
     39
     40    return offset;
     41}
     42
  • src/system/libroot/os/arch/arm/byteorder.S

     
     1/*
     2** Copyright 2003, Axel D�fler, axeld@pinc-software.de. All rights reserved.
     3** Distributed under the terms of the OpenBeOS License.
     4*/
     5
     6#include <asm_defs.h>
     7
     8.text
     9
     10/* uint16 __swap_int16(uint16 value)
     11 */
     12FUNCTION(__swap_int16):
     13        rev16 r0,r0;
     14FUNCTION_END(__swap_int16)
     15
     16/* uint32 __swap_int32(uint32 value)
     17 */
     18FUNCTION(__swap_int32):
     19        rev r0,r0;
     20FUNCTION_END(__swap_int32)
     21
     22/* uint64 __swap_int64(uint64 value)
     23 */
     24FUNCTION(__swap_int64):
     25        rev r0,r0;
     26        rev r1,r1;
     27        mov r12,r0;
     28        mov r0,r1;
     29        mov r1,r12;
     30FUNCTION_END(__swap_int64)
     31
     32/* TODO: The following functions can surely be optimized. A simple optimization
     33 * would be to define macros with the contents of the __swap_int{32,64}
     34 * functions and use those instead of calling the functions.
     35 */
     36
     37/* float __swap_float(float value)
     38 */
     39FUNCTION(__swap_float):
     40        b       __swap_int32
     41        //rts
     42FUNCTION_END(__swap_float)
     43
     44
     45/* double __swap_double(double value)
     46 */
     47FUNCTION(__swap_double):
     48        b       __swap_int32
     49        //rts
     50#warning M68K: XXX:check sizeof(double)
     51FUNCTION_END(__swap_double)
     52
  • src/system/libroot/os/arch/arm/stack_frame.c

     
     1/*
     2 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
     3 * Distributed under the terms of the MIT License.
     4*/
     5
     6#include <SupportDefs.h>
     7
     8#include <libroot_private.h>
     9
     10
     11void*
     12get_stack_frame(void)
     13{
     14    // TODO: Implement!
     15    return NULL;
     16}
     17
     18
     19void*
     20__arch_get_caller(void)
     21{
     22    // TODO: Implement!
     23    return NULL;
     24}
  • src/system/libroot/os/arch/arm/system_time.c

     
     1/*
     2 * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
     3 * All rights reserved. Distributed under the terms of the MIT License.
     4 */
     5
     6#include <OS.h>
     7
     8#include <arch_cpu.h>
     9#include <libroot_private.h>
     10#include <real_time_data.h>
     11
     12
     13static vint32 *sConversionFactor;
     14
     15void
     16__m68k_setup_system_time(vint32 *cvFactor)
     17{
     18    sConversionFactor = cvFactor;
     19}
     20
     21
     22//XXX: this is a hack
     23// remove me when platform code works
     24int64
     25__m68k_get_time_base(void)
     26{
     27    static uint64 time_dilation_field = 0;
     28    return time_dilation_field++;
     29}
     30
     31bigtime_t
     32system_time(void)
     33{
     34    uint64 timeBase = __m68k_get_time_base();
     35
     36    uint32 cv = *sConversionFactor;
     37    return (timeBase >> 32) * cv + (((timeBase & 0xffffffff) * cv) >> 32);
     38}
  • src/system/libroot/os/arch/arm/system_time_asm.S

     
     1/*
     2** Copyright 2003, Axel D�fler, axeld@pinc-software.de. All rights reserved.
     3** Distributed under the terms of the OpenBeOS License.
     4*/
     5
     6#include <asm_defs.h>
     7
     8.text
     9
     10/* int64 __m68k_get_time_base(void)
     11 */
     12#if 0
     13FUNCTION(__m68k_get_time_base):
     14#warning M68K: implement __m68k_get_time_base()
     15        clr.l   %d0
     16        clr.l   %d1
     17        rts
     18FUNCTION_END(__m68k_get_time_base)
     19#endif
  • src/system/libroot/os/arch/arm/tls.c

     
     1/*
     2** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
     3** Distributed under the terms of the OpenBeOS License.
     4*/
     5
     6// ToDo: this is a dummy implementation - I've not yet gained enough knowledge
     7//  to decide how this should be done, so it's just broken now (okay for single
     8//  threaded apps, though).
     9
     10// we don't want to have the inline assembly included here
     11#ifndef _NO_INLINE_ASM
     12#   define _NO_INLINE_ASM 1
     13#endif
     14
     15#include "support/TLS.h"
     16#include "tls.h"
     17
     18
     19static int32 gNextSlot = TLS_FIRST_FREE_SLOT;
     20static void *gSlots[TLS_MAX_KEYS];
     21
     22
     23int32
     24tls_allocate(void)
     25{
     26    int32 next = atomic_add(&gNextSlot, 1);
     27    if (next >= TLS_MAX_KEYS)
     28        return B_NO_MEMORY;
     29
     30    return next;
     31}
     32
     33
     34void *
     35tls_get(int32 index)
     36{
     37    return gSlots[index];
     38}
     39
     40
     41void **
     42tls_address(int32 index)
     43{
     44    return &gSlots[index];
     45}
     46
     47
     48void
     49tls_set(int32 index, void *value)
     50{
     51    gSlots[index] = value;
     52}
     53
  • src/system/libroot/os/arch/arm/syscalls.inc

     
     1/*
     2** Copyright 2002, Travis Geiselbrecht. All rights reserved.
     3** Distributed under the terms of the NewOS License.
     4*/
     5
     6#define FUNC(name) .align 2 ; .globl name ; .type name,@function ; name:
     7
     8/* lure the preprocessor to not substitute the syscall as string */
     9#define IMM #
     10
     11#define SYSCALL0(name, n) \
     12FUNC(name) \
     13    move.l  IMM n,%d0       ;  \
     14    trap    #0      ;  \
     15    rts
     16
     17#define SYSCALL1(name, n) \
     18FUNC(name) \
     19    move.l  IMM n,%d0       ;  \
     20    trap    #0      ;  \
     21    rts
     22
     23#define SYSCALL2(name, n) \
     24FUNC(name) \
     25    move.l  IMM n,%d0       ;  \
     26    trap    #0      ;  \
     27    rts
     28
     29#define SYSCALL3(name, n) \
     30FUNC(name) \
     31    move.l  IMM n,%d0       ;  \
     32    trap    #0      ;  \
     33    rts
     34
     35#define SYSCALL4(name, n) \
     36FUNC(name) \
     37    move.l  IMM n,%d0       ;  \
     38    trap    #0      ;  \
     39    rts
     40
     41#define SYSCALL5(name, n) \
     42FUNC(name) \
     43    move.l  IMM n,%d0       ;  \
     44    trap    #0      ;  \
     45    rts
     46
     47#define SYSCALL6(name, n) \
     48FUNC(name) \
     49    move.l  IMM n,%d0       ;  \
     50    trap    #0      ;  \
     51    rts
     52
     53#define SYSCALL7(name, n) \
     54FUNC(name) \
     55    move.l  IMM n,%d0       ;  \
     56    trap    #0      ;  \
     57    rts
     58
     59#define SYSCALL8(name, n) \
     60FUNC(name) \
     61    move.l  IMM n,%d0       ;  \
     62    trap    #0      ;  \
     63    rts
     64
     65#define SYSCALL9(name, n) \
     66FUNC(name) \
     67    move.l  IMM n,%d0       ;  \
     68    trap    #0      ;  \
     69    rts
     70
     71#define SYSCALL10(name, n) \
     72FUNC(name) \
     73    move.l  IMM n,%d0       ;  \
     74    trap    #0      ;  \
     75    rts
     76
     77#define SYSCALL11(name, n) \
     78FUNC(name) \
     79    move.l  IMM n,%d0       ;  \
     80    trap    #0      ;  \
     81    rts
     82
     83#define SYSCALL12(name, n) \
     84FUNC(name) \
     85    move.l  IMM n,%d0       ;  \
     86    trap    #0      ;  \
     87    rts
     88
     89#define SYSCALL13(name, n) \
     90FUNC(name) \
     91    move.l  IMM n,%d0       ;  \
     92    trap    #0      ;  \
     93    rts
     94
  • src/system/libroot/os/arch/arm/Jamfile

     
     1SubDir HAIKU_TOP src system libroot os arch arm ;
     2
     3UsePrivateKernelHeaders ;
     4UsePrivateSystemHeaders ;
     5
     6MergeObject os_arch_$(TARGET_ARCH).o :
     7    atomic.S
     8    byteorder.S
     9    compatibility.c # only here until the places where those functions are used
     10                    # are fixed
     11    stack_frame.c
     12#   systeminfo.c
     13    system_time.c
     14    system_time_asm.S
     15    thread.c
     16    time.c
     17    tls.c
     18;
  • src/system/libroot/os/arch/arm/thread.c

     
     1#include <OS.h>
     2#include "syscalls.h"
     3
     4
     5thread_id
     6find_thread(const char *name)
     7{
     8    return _kern_find_thread(name);
     9}
  • src/system/libroot/os/arch/arm/atomic.S.save

     
     1/*
     2** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
     3** Distributed under the terms of the OpenBeOS License.
     4*/
     5
     6#include <asm_defs.h>
     7
     8
     9
     10.text
     11
     12/* int atomic_add(int *value, int increment)
     13 */
     14FUNCTION(atomic_add):
     15        move.l  (4,%a7),%a0
     16        move.l  (%a0),%d0
     17miss1:  move.l  %d0,%d1
     18        add.l   (8,%a7),%d1
     19        cas.l   %d0,%d1,(%a0)
     20        bne     miss1
     21        // d0 = old value
     22        rts
     23FUNCTION_END(atomic_add)
     24
     25/* int atomic_and(int *value, int andValue)
     26 */
     27FUNCTION(atomic_and):
     28        move.l  (4,%a7),%a0
     29        move.l  (%a0),%d0
     30miss2:  move.l  %d0,%d1
     31        and.l   (8,%a7),%d1
     32        cas.l   %d0,%d1,(%a0)
     33        bne     miss2
     34        // d0 = old value
     35        rts
     36FUNCTION_END(atomic_and)
     37
     38/* int atomic_or(int *value, int orValue)
     39 */
     40FUNCTION(atomic_or):
     41        move.l  (4,%a7),%a0
     42        move.l  (%a0),%d0
     43miss3:  move.l  %d0,%d1
     44        or.l    (8,%a7),%d1
     45        cas.l   %d0,%d1,(%a0)
     46        bne     miss3
     47        rts
     48FUNCTION_END(atomic_or)
     49
     50/* int atomic_set(int *value, int setTo)
     51 */
     52FUNCTION(atomic_set):
     53        move.l  (4,%a7),%a0
     54        move.l  (%a0),%d0
     55        move.l  (8,%a7),%d1
     56miss4:  cas.l   %d0,%d1,(%a0)
     57        bne     miss4
     58        rts
     59FUNCTION_END(atomic_set)
     60
     61/* int atomic_test_and_set(int *value, int setTo, int testValue)
     62 */
     63FUNCTION(atomic_test_and_set):
     64        move.l  (4,%a7),%a0
     65        move.l  (8,%a7),%d1
     66        move.l  (12,%a7),%d0
     67        cas.l   %d0,%d1,(%a0)
     68        rts
     69FUNCTION_END(atomic_test_and_set)
     70
     71/* int atomic_get(int *value)
     72 */
     73FUNCTION(atomic_get):
     74        move.l  (4,%a7),%a0
     75        move.l  (%a0),%d0
     76        move.l  %d0,%d1
     77        cas.l   %d0,%d1,(%a0)
     78        // we must use cas... so we change to the same value if matching,
     79        // else we get the correct one anyway
     80        rts
     81FUNCTION_END(atomic_get)
     82
     83/* m68k elf convention is to return structs in (a0)
     84 * but use d0/d1 for int64 and small structs.
     85 * d0 MSB, d1 LSB
     86 */
     87#warning M68K: 68060 doesn't have CAS2: use spinlock ??
     88/* see http://retropc.net/x68000/software/develop/as/has060/m68k.htm */
     89
     90/* int64    atomic_add64(vint64 *value, int64 addValue) */
     91FUNCTION(atomic_add64):
     92        movem.l %d2-%d3/%a2,-(%a7)
     93        move.l  (4,%a7),%a2
     94        lea.l   (4,%a2),%a1
     95        // addValue
     96        move.l  (12,%a7),%d3    /*LSB*/
     97        move.l  (8,%a7),%d2     /*MSB*/
     98miss5:  // old value
     99        move.l  (%a1),%d1       /*LSB*/
     100        move.l  (%a2),%d0       /*MSB*/
     101        add.l   %d1,%d3
     102        addx.l  %d0,%d2
     103        cas2.l  %d0:%d1,%d2:%d3,(%a2):(%a1)
     104        bne     miss5
     105        // return value d0:d1
     106        movem.l (%a7)+,%d2-%d3/%a2
     107        rts
     108FUNCTION_END(atomic_add64)
     109
     110/* int64    atomic_and64(vint64 *value, int64 andValue) */
     111FUNCTION(atomic_and64):
     112        movem.l %d2-%d3/%a2,-(%a7)
     113        move.l  (4,%a7),%a2
     114        lea.l   (4,%a2),%a1
     115        // addValue
     116        move.l  (12,%a7),%d3    /*LSB*/
     117        move.l  (8,%a7),%d2     /*MSB*/
     118miss6:  // old value
     119        move.l  (%a1),%d1       /*LSB*/
     120        move.l  (%a2),%d0       /*MSB*/
     121        and.l   %d1,%d3
     122        and.l   %d0,%d2
     123        cas2.l  %d0:%d1,%d2:%d3,(%a2):(%a1)
     124        bne     miss6
     125        // return value d0:d1
     126        movem.l (%a7)+,%d2-%d3/%a2
     127        rts
     128FUNCTION_END(atomic_and64)
     129
     130/* int64    atomic_or64(vint64 *value, int64 orValue) */
     131FUNCTION(atomic_or64):
     132        movem.l %d2-%d3/%a2,-(%a7)
     133        move.l  (4,%a7),%a2
     134        lea.l   (4,%a2),%a1
     135        // addValue
     136        move.l  (12,%a7),%d3    /*LSB*/
     137        move.l  (8,%a7),%d2     /*MSB*/
     138miss7:  // old value
     139        move.l  (%a1),%d1       /*LSB*/
     140        move.l  (%a2),%d0       /*MSB*/
     141        or.l    %d1,%d3
     142        or.l    %d0,%d2
     143        cas2.l  %d0:%d1,%d2:%d3,(%a2):(%a1)
     144        bne     miss7
     145        // return value d0:d1
     146        movem.l (%a7)+,%d2-%d3/%a2
     147        rts
     148FUNCTION_END(atomic_or64)
     149
     150/* int64    atomic_set64(vint64 *value, int64 newValue) */
     151FUNCTION(atomic_set64):
     152        movem.l %d2-%d3/%a2,-(%a7)
     153        move.l  (4,%a7),%a2
     154        lea.l   (4,%a2),%a1
     155        // new value
     156        move.l  (12,%a7),%d3    /*LSB*/
     157        move.l  (8,%a7),%d2     /*MSB*/
     158        // old value
     159        move.l  (%a1),%d1       /*LSB*/
     160        move.l  (%a2),%d0       /*MSB*/
     161miss8:  cas2.l  %d0:%d1,%d2:%d3,(%a2):(%a1)
     162        bne     miss8
     163        // return value d0:d1
     164        movem.l (%a7)+,%d2-%d3/%a2
     165        rts
     166FUNCTION_END(atomic_set64)
     167
     168/* int64    atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst) */
     169FUNCTION(atomic_test_and_set64):
     170        movem.l %d2-%d3/%a2,-(%a7)
     171        move.l  (4,%a7),%a2
     172        lea.l   (4,%a2),%a1
     173        // new value
     174        move.l  (12,%a7),%d3    /*LSB*/
     175        move.l  (8,%a7),%d2     /*MSB*/
     176        // test against value
     177        move.l  (20,%a7),%d1    /*LSB*/
     178        move.l  (16,%a7),%d0    /*MSB*/
     179        cas2.l  %d0:%d1,%d2:%d3,(%a2):(%a1)
     180        // return value d0:d1
     181        movem.l (%a7)+,%d2-%d3/%a2
     182        rts
     183FUNCTION_END(atomic_test_and_set64)
     184
     185/* int64    atomic_get64(vint64 *value) */
     186FUNCTION(atomic_get64):
     187        movem.l %d2-%d3/%a2,-(%a7)
     188        move.l  (4,%a7),%a2
     189        lea.l   (4,%a2),%a1
     190        move.l  (%a1),%d1   /*LSB*/
     191        move.l  (%a2),%d0       /*MSB*/
     192        move.l  %d1,%d3
     193        move.l  %d0,%d2
     194        // we must use cas... so we change to the same value if matching,
     195        // else we get the correct one anyway
     196        cas2.l  %d0:%d1,%d2:%d3,(%a2):(%a1)
     197        // return value
     198        movem.l (%a7)+,%d2-%d3/%a2
     199        rts
     200FUNCTION_END(atomic_get64)
  • src/system/libroot/os/arch/arm/compatibility.c

     
     1/*
     2 * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
     3 * Distributed under the terms of the MIT License.
     4 */
     5
     6// This file includes some known R5 syscalls
     7// ToDo: maybe they should indeed do something...
     8
     9#include <SupportDefs.h>
     10
     11
     12int _kset_mon_limit_(int num);
     13int _kset_fd_limit_(int num);
     14int _kget_cpu_state_(int cpuNum);
     15int _kset_cpu_state_(int cpuNum, int state);
     16
     17
     18int
     19_kset_mon_limit_(int num)
     20{
     21    return B_ERROR;
     22}
     23
     24
     25int
     26_kset_fd_limit_(int num)
     27{
     28    return B_ERROR;
     29}
     30
     31
     32int
     33_kget_cpu_state_(int cpuNum)
     34{
     35    return 1;
     36}
     37
     38
     39int
     40_kset_cpu_state_(int cpuNum, int state)
     41{
     42    return state ? B_OK : B_ERROR;
     43}
     44
  • src/system/libroot/os/arch/arm/atomic.S

     
     1#/*
     2** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
     3** Distributed under the terms of the OpenBeOS License.
     4*/
     5
     6#include <asm_defs.h>
     7
     8
     9.text
     10
     11/* int atomic_add(int *value, int increment)
     12 */
     13FUNCTION(atomic_add):
     14miss1:          ldrex       r12, [r0]
     15            add         r2,  r12, r1
     16            strex       r3,  r2,  [r0]
     17            teq         r3,  #0
     18            bne         miss1
     19            mov         r0,  r12
     20            bx          lr
     21FUNCTION_END(atomic_add)
     22
     23
     24
     25
     26/* int atomic_and(int *value, int andValue)
     27 */
     28FUNCTION(atomic_and):
     29miss2:          ldrex       r12, [r0]
     30            and         r2,  r12, r1
     31            strex       r3,  r2,  [r0]
     32            teq         r3,  #0
     33            bne         miss2
     34            mov         r0,  r12
     35            bx          lr
     36FUNCTION_END(atomic_and)
     37
     38/* int atomic_or(int *value, int orValue)
     39 */
     40FUNCTION(atomic_or):
     41miss3:          ldrex       r12, [r0]
     42            eor         r2,  r12, r1
     43            strex       r3,  r2,  [r0]
     44            teq         r3,  #0
     45            bne         miss3
     46            mov         r0,  r12
     47            bx          lr
     48FUNCTION_END(atomic_or)
     49
     50/* int atomic_set(int *value, int setTo)
     51 */
     52FUNCTION(atomic_set):
     53miss4:      ldrex   r12, [r0]
     54            strex   r3, r1, [r0]
     55            teq     r3, #0
     56            bne     miss4
     57        bx  lr
     58FUNCTION_END(atomic_set)
     59
     60/* int atomic_test_and_set(int *value, int setTo, int testValue)
     61 */
     62FUNCTION(atomic_test_and_set):
     63miss5:  ldrex       r12, [r0]                       @ load from the address and mark it exclusive
     64        cmp         r12, r2                         @ compare the value with the comperand(r2)
     65        strexeq     r3,  r1,  [r0]                  @ if they were equal, attempt to store the new value (r1)
     66        bne         differ                          @ if they were not equal jump to (differ) which clears the exclusive tag on the address and returns<
     67        cmp         r3,  #1                         @ check the status of the store (returned in r3)
     68        beq         miss5                           @ go back to the start if it failed (0=success, 1=failure)
     69        bne         same                            @ if it succeeded, jump to (same) and return. there is no need to clrex if strex succeeded
     70differ: clrex                                   @ clrex
     71same:   mov         r0,  r12
     72        mov         pc,  lr
     73FUNCTION_END(atomic_test_and_set)
     74
     75/* int atomic_get(int *value)
     76 */
     77/*FUNCTION(atomic_get):
     78        move.l  (4,%a7),%a0
     79        move.l  (%a0),%d0
     80        move.l  %d0,%d1
     81        cas.l   %d0,%d1,(%a0)
     82        // we must use cas... so we change to the same value if matching,
     83        // else we get the correct one anyway
     84        rts
     85FUNCTION_END(atomic_get)
     86*/
     87
     88/* int64    atomic_add64(vint64 *value, int64 addValue) */
     89//FUNCTION(atomic_add64):
     90//      movem.l %d2-%d3/%a2,-(%a7)
     91//      move.l  (4,%a7),%a2
     92//      lea.l   (4,%a2),%a1
     93//      // addValue
     94//      move.l  (12,%a7),%d3    /*LSB*/
     95//      move.l  (8,%a7),%d2     /*MSB*/
     96//miss5:    // old value
     97//      move.l  (%a1),%d1       /*LSB*/
     98//      move.l  (%a2),%d0       /*MSB*/
     99//      add.l   %d1,%d3
     100//      addx.l  %d0,%d2
     101//      cas2.l  %d0:%d1,%d2:%d3,(%a2):(%a1)
     102//      bne     miss5
     103//      // return value d0:d1
     104//      movem.l (%a7)+,%d2-%d3/%a2
     105//      rts
     106//FUNCTION_END(atomic_add64)
     107
     108/* int64    atomic_and64(vint64 *value, int64 andValue) */
     109//FUNCTION(atomic_and64):
     110//FUNCTION_END(atomic_and64)
     111
     112/* int64    atomic_or64(vint64 *value, int64 orValue) */
     113//FUNCTION(atomic_or64):
     114//FUNCTION_END(atomic_or64)
     115
     116/* int64    atomic_set64(vint64 *value, int64 newValue) */
     117//FUNCTION(atomic_set64):
     118//      movem.l %d2-%d3/%a2,-(%a7)
     119//      move.l  (4,%a7),%a2
     120//      lea.l   (4,%a2),%a1
     121//      // new value
     122//      move.l  (12,%a7),%d3    /*LSB*/
     123//      move.l  (8,%a7),%d2     /*MSB*/
     124//      // old value
     125//      move.l  (%a1),%d1       /*LSB*/
     126//      move.l  (%a2),%d0       /*MSB*/
     127//miss8:    cas2.l  %d0:%d1,%d2:%d3,(%a2):(%a1)
     128//      bne     miss8
     129//      // return value d0:d1
     130//      movem.l (%a7)+,%d2-%d3/%a2
     131//      rts
     132//FUNCTION_END(atomic_set64)
     133
     134/* int64    atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst) */
     135//FUNCTION(atomic_test_and_set64):
     136//      movem.l %d2-%d3/%a2,-(%a7)
     137//      move.l  (4,%a7),%a2
     138//      lea.l   (4,%a2),%a1
     139//      // new value
     140//      move.l  (12,%a7),%d3    /*LSB*/
     141//      move.l  (8,%a7),%d2     /*MSB*/
     142//      // test against value
     143//      move.l  (20,%a7),%d1    /*LSB*/
     144//      move.l  (16,%a7),%d0    /*MSB*/
     145//      cas2.l  %d0:%d1,%d2:%d3,(%a2):(%a1)
     146//      // return value d0:d1
     147//      movem.l (%a7)+,%d2-%d3/%a2
     148//      rts
     149//FUNCTION_END(atomic_test_and_set64)
     150
     151/* int64    atomic_get64(vint64 *value) */
     152//FUNCTION(atomic_get64):
     153//      movem.l %d2-%d3/%a2,-(%a7)
     154//      move.l  (4,%a7),%a2
     155//      lea.l   (4,%a2),%a1
     156//      move.l  (%a1),%d1   /*LSB*/
     157//      move.l  (%a2),%d0       /*MSB*/
     158//      move.l  %d1,%d3
     159//      move.l  %d0,%d2
     160//      // we must use cas... so we change to the same value if matching,
     161//      // else we get the correct one anyway
     162//      cas2.l  %d0:%d1,%d2:%d3,(%a2):(%a1)
     163//      // return value
     164//      movem.l (%a7)+,%d2-%d3/%a2
     165//      rts
     166//FUNCTION_END(atomic_get64)
  • src/system/libroot/posix/stdlib/strtod.c

     
    115115
    116116#if defined(__i386__) || defined(__ia64__) || defined(__alpha__) || \
    117117    defined(__sparc64__) || defined(__powerpc__) || defined(__POWERPC__) || \
    118     defined(__m68k__) || defined(__M68K__)
     118    defined(__m68k__) || defined(__M68K__)|| defined(__ARM__)
    119119#   include <sys/types.h>
    120120#   if BYTE_ORDER == BIG_ENDIAN
    121121#       define IEEE_BIG_ENDIAN