1 /* EABI unaligned read/write functions.
3 Copyright (C) 2005 Free Software Foundation, Inc.
4 Contributed by CodeSourcery, LLC.
6 This file is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 In addition to the permissions in the GNU General Public License, the
12 Free Software Foundation gives you unlimited permission to link the
13 compiled version of this file into combinations with other programs,
14 and to distribute those combinations without any restriction coming
15 from the use of this file. (The General Public License restrictions
16 do apply in other respects; for example, they cover modification of
17 the file, and distribution when not linked into a combine
20 This file is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 General Public License for more details.
25 You should have received a copy of the GNU General Public License
26 along with this program; see the file COPYING. If not, write to
27 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
28 Boston, MA 02110-1301, USA. */
30 int __aeabi_uread4 (void *);
31 int __aeabi_uwrite4 (int, void *);
32 long long __aeabi_uread8 (void *);
33 long long __aeabi_uwrite8 (long long, void *);
35 struct __attribute__((packed
)) u4
{ int data
; };
36 struct __attribute__((packed
)) u8
{ long long data
; };
39 __aeabi_uread4 (void *ptr
)
41 return ((struct u4
*) ptr
)->data
;
45 __aeabi_uwrite4 (int data
, void *ptr
)
47 ((struct u4
*) ptr
)->data
= data
;
52 __aeabi_uread8 (void *ptr
)
54 return ((struct u8
*) ptr
)->data
;
58 __aeabi_uwrite8 (long long data
, void *ptr
)
60 ((struct u8
*) ptr
)->data
= data
;