ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/Irix/unaligned.c
Revision: 1.6
Committed: 2005-01-30T21:42:14Z (19 years, 9 months ago) by gbeauche
Content type: text/plain
Branch: MAIN
CVS Tags: nigel-build-19, nigel-build-17, HEAD
Changes since 1.5: +1 -1 lines
Log Message:
Happy New Year!

File Contents

# User Rev Content
1 cebix 1.1 /*
2     * Irix/unaligned.c - Optimized unaligned access for Irix
3     *
4 gbeauche 1.6 * Basilisk II (C) 1997-2005 Christian Bauer
5 cebix 1.1 *
6     * This program is free software; you can redistribute it and/or modify
7     * it under the terms of the GNU General Public License as published by
8     * the Free Software Foundation; either version 2 of the License, or
9     * (at your option) any later version.
10     *
11     * This program is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     * GNU General Public License for more details.
15     *
16     * You should have received a copy of the GNU General Public License
17     * along with this program; if not, write to the Free Software
18     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19     */
20    
21     #ifdef sgi
22     #include "sysdeps.h"
23    
24     /* Tell the compiler to pack data on 1-byte boundaries
25     * (i.e. arbitrary alignment). Requires SGI MIPSPro compilers. */
26     #pragma pack(1)
27    
28     typedef struct _ual32 {
29     uae_u32 v;
30     } ual32_t;
31    
32     typedef struct _ual16 {
33     uae_u16 v;
34     } ual16_t;
35    
36     #pragma pack(0)
37    
38     /* The compiler is smart enough to inline these when you build with "-ipa" */
39     uae_u32 do_get_mem_long(uae_u32 *a) {return ((ual32_t *)a)->v;}
40     uae_u32 do_get_mem_word(uae_u16 *a) {return ((ual16_t *)a)->v;}
41     void do_put_mem_long(uae_u32 *a, uae_u32 v) {((ual32_t *)a)->v = v;}
42     void do_put_mem_word(uae_u16 *a, uae_u32 v) {((ual16_t *)a)->v = v;}
43    
44     #endif /* sgi */