114 lines
3.4 KiB
Text
114 lines
3.4 KiB
Text
$NetBSD: patch-ac,v 1.2 2000/08/22 15:40:12 dmcmahill Exp $
|
|
|
|
--- lib/librio500.c.orig Tue Aug 22 14:52:30 2000
|
|
+++ lib/librio500.c Tue Aug 22 14:55:42 2000
|
|
@@ -24,7 +24,7 @@
|
|
#include "libfon.h"
|
|
|
|
#ifdef WORDS_BIGENDIAN
|
|
-#include <byteswap.h>
|
|
+#include <machine/bswap.h>
|
|
#endif
|
|
|
|
void
|
|
@@ -55,9 +55,9 @@
|
|
need to byteswap to get to le */
|
|
|
|
#ifdef WORDS_BIGENDIAN
|
|
- location.offset = bswap_16(location.offset);
|
|
- location.bytes = bswap_16(location.bytes);
|
|
- location.folder_num = bswap_16(location.folder_num);
|
|
+ location.offset = bswap16(location.offset);
|
|
+ location.bytes = bswap16(location.bytes);
|
|
+ location.folder_num = bswap16(location.folder_num);
|
|
#endif
|
|
|
|
rio_ctl_msg (fd, RIO_DIR_OUT, 0x56, 0, 0,
|
|
@@ -87,13 +87,13 @@
|
|
to read correctly */
|
|
|
|
#ifdef WORDS_BIGENDIAN
|
|
- status.dunno1 = bswap_16(status.dunno1);
|
|
- status.block_size = bswap_16(status.block_size);
|
|
- status.num_blocks = bswap_16(status.num_blocks);
|
|
- status.first_free_block = bswap_16(status.first_free_block);
|
|
- status.num_unused_blocks = bswap_16(status.num_unused_blocks);
|
|
- status.dunno2 = bswap_32(status.dunno2);
|
|
- status.dunno3 = bswap_32(status.dunno3);
|
|
+ status.dunno1 = bswap16(status.dunno1);
|
|
+ status.block_size = bswap16(status.block_size);
|
|
+ status.num_blocks = bswap16(status.num_blocks);
|
|
+ status.first_free_block = bswap16(status.first_free_block);
|
|
+ status.num_unused_blocks = bswap16(status.num_unused_blocks);
|
|
+ status.dunno2 = bswap32(status.dunno2);
|
|
+ status.dunno3 = bswap32(status.dunno3);
|
|
#endif
|
|
|
|
return &status;
|
|
@@ -476,25 +476,25 @@
|
|
void
|
|
bswap_folder_entry (folder_entry *fe)
|
|
{
|
|
- fe->offset = bswap_16(fe->offset);
|
|
- fe->dunno1 = bswap_16(fe->dunno1);
|
|
- fe->fst_free_entry_off = bswap_16(fe->fst_free_entry_off);
|
|
- fe->dunno2 = bswap_16(fe->dunno2);
|
|
- fe->dunno3 = bswap_32(fe->dunno3);
|
|
- fe->dunno4 = bswap_32(fe->dunno4);
|
|
- fe->time = bswap_32(fe->time);
|
|
+ fe->offset = bswap16(fe->offset);
|
|
+ fe->dunno1 = bswap16(fe->dunno1);
|
|
+ fe->fst_free_entry_off = bswap16(fe->fst_free_entry_off);
|
|
+ fe->dunno2 = bswap16(fe->dunno2);
|
|
+ fe->dunno3 = bswap32(fe->dunno3);
|
|
+ fe->dunno4 = bswap32(fe->dunno4);
|
|
+ fe->time = bswap32(fe->time);
|
|
}
|
|
|
|
void
|
|
bswap_song_entry (song_entry *se)
|
|
{
|
|
- se->offset = bswap_16(se->offset);
|
|
- se->dunno1 = bswap_16(se->dunno1);
|
|
- se->length = bswap_32(se->length);
|
|
- se->dunno2 = bswap_16(se->dunno2);
|
|
- se->dunno3 = bswap_16(se->dunno3);
|
|
- se->mp3sig = bswap_32(se->mp3sig);
|
|
- se->time = bswap_32(se->time);
|
|
+ se->offset = bswap16(se->offset);
|
|
+ se->dunno1 = bswap16(se->dunno1);
|
|
+ se->length = bswap32(se->length);
|
|
+ se->dunno2 = bswap16(se->dunno2);
|
|
+ se->dunno3 = bswap16(se->dunno3);
|
|
+ se->mp3sig = bswap32(se->mp3sig);
|
|
+ se->time = bswap32(se->time);
|
|
}
|
|
|
|
|
|
@@ -662,7 +662,7 @@
|
|
rio_ctl_msg (fd, RIO_DIR_IN, req, val, idx, 4, (BYTE*)&status);
|
|
|
|
#ifdef WORDS_BIGENDIAN
|
|
- status = bswap_32 (status);
|
|
+ status = bswap32 (status);
|
|
#endif
|
|
|
|
return status;
|
|
@@ -740,7 +740,7 @@
|
|
/* on big_endian platforms, need to byteswap num_blocks to write to le rio */
|
|
|
|
#ifdef WORDS_BIGENDIAN
|
|
- new_smiley->num_blocks = bswap_16(new_smiley->num_blocks);
|
|
+ new_smiley->num_blocks = bswap16(new_smiley->num_blocks);
|
|
#endif
|
|
|
|
return new_smiley;
|
|
@@ -802,7 +802,7 @@
|
|
transfer to rio */
|
|
|
|
#ifdef WORDS_BIGENDIAN
|
|
- new_bitmap->num_blocks = bswap_16(new_bitmap->num_blocks);
|
|
+ new_bitmap->num_blocks = bswap16(new_bitmap->num_blocks);
|
|
#endif
|
|
|
|
return new_bitmap;
|