X-Git-Url: http://git.ozlabs.org/?p=yaboot.git;a=blobdiff_plain;f=second%2Fpartition.c;h=0cb8ae85f1768bb7aef755c6ef37f64b64f5f168;hp=12942a94cf6b4aacf1b240f3d55d58c4d1de643a;hb=1bea6140c2894b1259fd07f323b25fd846bd5acf;hpb=a2b7bb030d78c61ef150f8c9f6926c9558a6f1b5 diff --git a/second/partition.c b/second/partition.c index 12942a9..0cb8ae8 100644 --- a/second/partition.c +++ b/second/partition.c @@ -40,6 +40,7 @@ #include "linux/iso_fs.h" #include "debug.h" #include "errors.h" +#include "byteorder.h" /* We currently don't check the partition type, some users * are putting crap there and still expect it to work... @@ -58,9 +59,6 @@ static const char *valid_mac_partition_types[] = { #endif -/* Local functions */ -static unsigned long swab32(unsigned long value); - #define MAX_BLOCK_SIZE 2048 static unsigned char block_buffer[MAX_BLOCK_SIZE]; @@ -177,8 +175,8 @@ partition_fdisk_lookup( const char *dev_name, prom_handle disk, partition, "Linux", /* type */ '\0', /* name */ - swab32(*(unsigned int *)(part->start4)), - swab32(*(unsigned int *)(part->size4)), + le32_to_cpu(*(unsigned int *)part->start4), + le32_to_cpu(*(unsigned int *)part->size4), 512 /*blksize*/, part->sys_ind /* partition type */ ); } @@ -434,18 +432,6 @@ partitions_free(struct partition_t* list) list = next; } } -unsigned long -swab32(unsigned long value) -{ - __u32 result; - - __asm__("rlwimi %0,%1,24,16,23\n\t" - "rlwimi %0,%1,8,8,15\n\t" - "rlwimi %0,%1,24,0,7" - : "=r" (result) - : "r" (value), "0" (value >> 24)); - return result; -} /*