diff options
author | grehan <grehan@FreeBSD.org> | 2004-04-21 23:21:13 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2004-04-21 23:21:13 +0000 |
commit | a76af532c5dc1e784116e7571732ee16000d2fc1 (patch) | |
tree | 424d360a1d9752b9b11b6336dd2e237be1c2f8ca /lib/libdisk/chunk.c | |
parent | 4173466ca4ff2e1da50f5049e8e6318eb45b1d5f (diff) | |
download | FreeBSD-src-a76af532c5dc1e784116e7571732ee16000d2fc1.zip FreeBSD-src-a76af532c5dc1e784116e7571732ee16000d2fc1.tar.gz |
PowerPC support.
submitted by: Suleiman Souhlal <refugee@segfaulted.com>
approved by: phk, jhb
Diffstat (limited to 'lib/libdisk/chunk.c')
-rw-r--r-- | lib/libdisk/chunk.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/libdisk/chunk.c b/lib/libdisk/chunk.c index 96d7338..ef63ccc 100644 --- a/lib/libdisk/chunk.c +++ b/lib/libdisk/chunk.c @@ -76,6 +76,15 @@ Find_Mother_Chunk(struct chunk *chunks, daddr_t offset, daddr_t end, return c2; } return 0; +#ifdef __powerpc__ + case apple: + for (c1 = chunks->part; c1; c1 = c1->next) { + if (c1->type == type) + if (Chunk_Inside(c1, &ct)) + return c1; + } + return 0; +#endif default: warn("Unsupported mother type in Find_Mother_Chunk"); return 0; @@ -150,7 +159,7 @@ Insert_Chunk(struct chunk *c2, daddr_t offset, daddr_t size, const char *name, return __LINE__; } - if (type == freebsd || type == extended) { + if ((type == freebsd || type == extended || type == apple)) { cs = New_Chunk(); if (cs == NULL) return __LINE__; @@ -303,6 +312,18 @@ Add_Chunk(struct disk *d, daddr_t offset, daddr_t size, const char *name, return(-1); } break; + case p_ppc: + switch (type) { + case apple: + c1 = Find_Mother_Chunk(d->chunks, offset, end, whole); + break; + case part: + c1 = Find_Mother_Chunk(d->chunks, offset, end, apple); + break; + default: + return (-1); + } + break; default: return (-1); } @@ -439,6 +460,11 @@ Delete_Chunk2(struct disk *d, struct chunk *c, int rflags) c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, whole); #endif +#ifdef __powerpc__ + if (c1 == NULL) + c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, + apple); +#endif break; default: c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, extended); |