Teach libdisk that AMD64 works just like i386

This commit is contained in:
Peter Wemm 2003-04-30 21:03:16 +00:00
parent 20a83c49ba
commit 2512cd4e8f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=114329
5 changed files with 14 additions and 8 deletions

View file

@ -239,6 +239,7 @@ Add_Chunk(struct disk *d, long offset, u_long size, const char *name,
/* PLATFORM POLICY BEGIN ------------------------------------- */
switch(platform) {
case p_i386:
case p_amd64:
switch (type) {
case fat:
case mbr:
@ -317,7 +318,8 @@ Add_Chunk(struct disk *d, long offset, u_long size, const char *name,
if (platform == p_sparc64) {
offset = Prev_Cyl_Aligned(d, offset);
size = Next_Cyl_Aligned(d, size);
} else if (platform == p_i386 || platform == p_pc98) {
} else if (platform == p_i386 || platform == p_pc98 ||
platform == p_amd64) {
if (type != freebsd)
break;
if (!(flags & CHUNK_ALIGN))

View file

@ -138,7 +138,7 @@ int
Fixup_Names(struct disk *d)
{
struct chunk *c1, *c2;
#if defined(__i386__) || defined(__ia64__)
#if defined(__i386__) || defined(__ia64__) || defined(__amd64__)
struct chunk *c3;
int j;
#endif
@ -149,7 +149,7 @@ Fixup_Names(struct disk *d)
continue;
if (strcmp(c2->name, "X"))
continue;
#if defined(__i386__) || defined(__ia64__)
#if defined(__i386__) || defined(__ia64__) || defined(__amd64__)
c2->oname = malloc(12);
if (!c2->oname)
return -1;

View file

@ -56,6 +56,8 @@ const enum platform platform =
p_ia64
#elif defined(__ppc__)
p_ppc
#elif defined(__amd64__)
p_amd64
#else
IHAVENOIDEA
#endif
@ -391,7 +393,7 @@ Debug_Disk(struct disk *d)
#if defined(PC98)
printf(" boot1=%p, boot2=%p, bootipl=%p, bootmenu=%p\n",
d->boot1, d->boot2, d->bootipl, d->bootmenu);
#elif defined(__i386__)
#elif defined(__i386__) || defined(__amd64__)
printf(" boot1=%p, boot2=%p, bootmgr=%p\n",
d->boot1, d->boot2, d->bootmgr);
#elif defined(__alpha__)
@ -427,7 +429,7 @@ Free_Disk(struct disk *d)
if (d->boot1)
free(d->boot1);
#endif
#if defined(__i386__)
#if defined(__i386__) || defined(__amd64__)
if (d->boot2)
free(d->boot2);
#endif
@ -556,7 +558,7 @@ Set_Boot_Mgr(struct disk *d, const u_char *b, const size_t s)
int
Set_Boot_Blocks(struct disk *d, const u_char *b1, const u_char *b2)
{
#if defined(__i386__)
#if defined(__i386__) || defined(__amd64__)
if (d->boot1)
free(d->boot1);
d->boot1 = malloc(512);

View file

@ -27,7 +27,8 @@ enum platform {
p_pc98,
p_sparc64,
p_ia64,
p_ppc
p_ppc,
p_amd64
};
extern const enum platform platform;
@ -69,7 +70,7 @@ struct disk {
#if !defined(__ia64__)
u_char *boot1;
#endif
#if defined(__i386__) /* the i386 needs extra help... */
#if defined(__i386__) || defined(__amd64__) /* the i386 needs extra help... */
u_char *boot2;
#endif
struct chunk *chunks;

View file

@ -242,6 +242,7 @@ Check_Chunk(const struct disk *d, const struct chunk *c, char *msg)
switch (platform) {
case p_i386:
case p_amd64:
Rule_000(d, c, msg);
Rule_001(d, c, msg);
Rule_002(d, c, msg);