NetBSD/sys/arch/evbmips
dyoung 1ee8f4a418 Extract common code from i386, xen, and sparc64, creating
config_handle_wedges() and read_disk_sectors().  On x86, handle_wedges()
is a thin wrapper for config_handle_wedges().  Share opendisk()
across architectures.

Add kernel code in support of specifying a root partition by wedge
name.  E.g., root specifications "wedge:wd0a", "wedge:David's Root
Volume" are possible.  (Patches for config(1) coming soon.)

In support of moving disks between architectures (esp. i386 <->
evbmips), I've written a routine convertdisklabel() that ensures
that the raw partition is at RAW_DISK by following these steps:

        0 If we have read a disklabel that has a RAW_PART with
          p_offset == 0 and p_size != 0, then use that raw partition.

        1 If we have read a disklabel that has both partitions 'c'
          and 'd', and RAW_PART has p_offset != 0 or p_size == 0,
          but the other partition is suitable for a raw partition
          (p_offset == 0, p_size != 0), then swap the two partitions
          and use the new raw partition.

        2 If the architecture's raw partition is 'd', and if there
          is no partition 'd', but there is a partition 'c' that
          is suitable for a raw partition, then copy partition 'c'
          to partition 'd'.

        3 Determine the drive's last sector, using either the
          d_secperunit the drive reported, or by guessing (0x1fffffff).
          If we cannot read the drive's last sector, then fail.

        4 If we have read a disklabel that has no partition slot
          RAW_PART, then create a partition RAW_PART.  Make it span
          the whole drive.

        5 If there are fewer than MAXPARTITIONS partitions,
          then "slide" the unsuitable raw partition RAW_PART, and
          subsequent partitions, into partition slots RAW_PART+1
          and subsequent slots.  Create a raw partition at RAW_PART.
          Make it span the whole drive.

The convertdisklabel() procedure can probably stand to be simplified,
but it ought to deal with all but an extraordinarily broken disklabel,
now.

i386: compiled and tested, sparc64: compiled, evbmips: compiled.
2007-06-24 01:43:34 +00:00
..
adm5120 merge yamt-idlelwp branch. asked by core@. some ports still needs work. 2007-05-17 14:51:11 +00:00
alchemy Now that curcpu() is defined in terms of curlwp() for mips, we need to 2007-05-20 17:06:25 +00:00
atheros merge yamt-idlelwp branch. asked by core@. some ports still needs work. 2007-05-17 14:51:11 +00:00
compile
conf Make ADM5120 boards use the "common" disk subroutines, such as 2007-06-05 21:53:10 +00:00
evbmips Extract common code from i386, xen, and sparc64, creating 2007-06-24 01:43:34 +00:00
include Move declaretions of _spl*() and _{clr,set}softintr() functions 2007-06-17 06:04:27 +00:00
isa Fix some caddr_t rototill fallout. 2007-03-06 00:48:07 +00:00
malta merge yamt-idlelwp branch. asked by core@. some ports still needs work. 2007-05-17 14:51:11 +00:00
Makefile In sys/kern/Make.tags.inc, create an intermediate variable FINDCOMM. 2007-06-24 01:03:35 +00:00