X-Git-Url: https://git.ozlabs.org/?p=yaboot.git;a=blobdiff_plain;f=second%2Fpartition.c;h=e3ab4c58855d7adfbfc48fe17366dc063fbe667f;hp=399076706ddba7bdd3a77be6cc8d089b670078a8;hb=70ca99a5e21616ae261f6c49c8955b516b4219d6;hpb=2ad0d7649e5042cad43a16b4a03bf53f39948316 diff --git a/second/partition.c b/second/partition.c index 3990767..e3ab4c5 100644 --- a/second/partition.c +++ b/second/partition.c @@ -1,7 +1,9 @@ /* * partition.c - partition table support * - * Copyright (C) 2001 Ethan Benson + * Copyright (C) 2004 Sven Luther + * + * Copyright (C) 2001, 2002 Ethan Benson * * Copyright (C) 1999 Benjamin Herrenschmidt * @@ -31,6 +33,7 @@ #include "stdlib.h" #include "mac-part.h" #include "fdisk-part.h" +#include "amiga-part.h" #include "partition.h" #include "prom.h" #include "string.h" @@ -213,6 +216,110 @@ identify_iso_fs(ihandle device, unsigned int *iso_root_block) return 0; } +/* + * Detects and read amiga partition tables. + */ + +static int +_amiga_checksum (unsigned int blk_size) +{ + unsigned int sum; + int i, end; + unsigned int *amiga_block = (unsigned int *) block_buffer; + + sum = amiga_block[0]; + end = amiga_block[AMIGA_LENGTH]; + + if (end > blk_size) end = blk_size; + + for (i = 1; i < end; i++) sum += amiga_block[i]; + + return sum; +} + +static int +_amiga_find_rdb (const char *dev_name, prom_handle disk, unsigned int prom_blksize) +{ + int i; + unsigned int *amiga_block = (unsigned int *) block_buffer; + + for (i = 0; i