From d296c4e1f9298c536291136ac1847fa8897819b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sat, 19 Jan 2008 02:11:46 +0000 Subject: [PATCH] Fixed swapping functions. BFS now validates the superblock and the boot menu now lists the image if I force checking for kernel_x86. \o/ git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23626 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/os/arch/m68k/byteorder.S | 36 +++++++++++---------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/system/libroot/os/arch/m68k/byteorder.S b/src/system/libroot/os/arch/m68k/byteorder.S index fa0d6af5be..5feb579572 100644 --- a/src/system/libroot/os/arch/m68k/byteorder.S +++ b/src/system/libroot/os/arch/m68k/byteorder.S @@ -11,9 +11,12 @@ */ FUNCTION(__swap_int16): moveq.l #0,%d0 - move.b (5,%a7),%d0 + /* 32-bit aligned stack! */ + move.l (4,%a7),%d1 + move.b %d1,%d0 + lsr.w #8,%d1 lsl.w #8,%d0 - move.b (4,%a7),%d0 + move.b %d1,%d0 rts @@ -22,11 +25,11 @@ FUNCTION(__swap_int16): FUNCTION(__swap_int32): /* moveq.l #0,%d0*/ move.b (7,%a7),%d0 - lsl.w #8,%d0 + lsl.l #8,%d0 move.b (6,%a7),%d0 - lsl.w #8,%d0 + lsl.l #8,%d0 move.b (5,%a7),%d0 - lsl.w #8,%d0 + lsl.l #8,%d0 move.b (4,%a7),%d0 rts @@ -35,22 +38,21 @@ FUNCTION(__swap_int32): */ FUNCTION(__swap_int64): /* moveq.l #0,%d0*/ - move.b (7,%a7),%d0 - lsl.w #8,%d0 - move.b (6,%a7),%d0 - lsl.w #8,%d0 - move.b (5,%a7),%d0 - lsl.w #8,%d0 - move.b (4,%a7),%d0 - move.l %d0,(%a0) + move.b (7,%a7),%d1 + lsl.l #8,%d1 + move.b (6,%a7),%d1 + lsl.l #8,%d1 + move.b (5,%a7),%d1 + lsl.l #8,%d1 + move.b (4,%a7),%d1 + /**/ move.b (11,%a7),%d0 - lsl.w #8,%d0 + lsl.l #8,%d0 move.b (10,%a7),%d0 - lsl.w #8,%d0 + lsl.l #8,%d0 move.b (9,%a7),%d0 - lsl.w #8,%d0 + lsl.l #8,%d0 move.b (8,%a7),%d0 - move.l %d0,(4,%a0) rts