From 934f2f338c60d98c03226895e34297d7e0b3f89f Mon Sep 17 00:00:00 2001 From: Rui Paulo Date: Sat, 21 Aug 2010 15:01:59 +0000 Subject: Make sure the boot2 stage is compiled with gcc, as clang has no problems compiling it, but it just gets too big at the moment, even with -Os. This is not applicable to gptboot, though. Submitted by: Dimitry Andric --- sys/boot/i386/boot2/Makefile | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/boot') diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile index ab5a69a8ba46..84a63c1ad4b9 100644 --- a/sys/boot/i386/boot2/Makefile +++ b/sys/boot/i386/boot2/Makefile @@ -1,5 +1,10 @@ # $FreeBSD$ +.include + +# XXX: clang can compile the boot code just fine, but boot2 gets too big +CC:=${CC:C/^cc|^clang/gcc/} + FILES= boot boot1 boot2 NM?= nm -- cgit v1.3 From ee0b65d9d025d835dc6a96424884e58be0a7eabc Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 23 Aug 2010 01:33:27 +0000 Subject: MF tbemd: differentiate between arm and armeb --- sys/boot/arm/uboot/Makefile | 2 +- sys/boot/arm/uboot/ldscript.armeb | 134 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 sys/boot/arm/uboot/ldscript.armeb (limited to 'sys/boot') diff --git a/sys/boot/arm/uboot/Makefile b/sys/boot/arm/uboot/Makefile index 573f9489f353..e8ac403247a2 100644 --- a/sys/boot/arm/uboot/Makefile +++ b/sys/boot/arm/uboot/Makefile @@ -77,7 +77,7 @@ CLEANFILES+= vers.c loader.help CFLAGS+= -ffreestanding -LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.arm +LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_ARCH} # Pull in common loader code .PATH: ${.CURDIR}/../../uboot/common diff --git a/sys/boot/arm/uboot/ldscript.armeb b/sys/boot/arm/uboot/ldscript.armeb new file mode 100644 index 000000000000..17a02caa50c8 --- /dev/null +++ b/sys/boot/arm/uboot/ldscript.armeb @@ -0,0 +1,134 @@ +/* $FreeBSD$ */ + +OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = 0x1000000 + SIZEOF_HEADERS; + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rela.text : + { *(.rela.text) *(.rela.gnu.linkonce.t*) } + .rela.data : + { *(.rela.data) *(.rela.gnu.linkonce.d*) } + .rela.rodata : + { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } + .rela.got : { *(.rela.got) } + .rela.got1 : { *(.rela.got1) } + .rela.got2 : { *(.rela.got2) } + .rela.ctors : { *(.rela.ctors) } + .rela.dtors : { *(.rela.dtors) } + .rela.init : { *(.rela.init) } + .rela.fini : { *(.rela.fini) } + .rela.bss : { *(.rela.bss) } + .rela.plt : { *(.rela.plt) } + .rela.sdata : { *(.rela.sdata) } + .rela.sbss : { *(.rela.sbss) } + .rela.sdata2 : { *(.rela.sdata2) } + .rela.sbss2 : { *(.rela.sbss2) } + .text : + { + *(.text) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + } =0 + _etext = .; + PROVIDE (etext = .); + .init : { *(.init) } =0 + .fini : { *(.fini) } =0 + .rodata : { *(.rodata) *(.gnu.linkonce.r*) } + .rodata1 : { *(.rodata1) } + .sdata2 : { *(.sdata2) } + .sbss2 : { *(.sbss2) } + /* Adjust the address for the data segment to the next page up. */ + . = ((. + 0x1000) & ~(0x1000 - 1)); + .data : + { + *(.data) + *(.gnu.linkonce.d*) + CONSTRUCTORS + } + .data1 : { *(.data1) } + .got1 : { *(.got1) } + .dynamic : { *(.dynamic) } + /* Put .ctors and .dtors next to the .got2 section, so that the pointers + get relocated with -mrelocatable. Also put in the .fixup pointers. + The current compiler no longer needs this, but keep it around for 2.7.2 */ + PROVIDE (_GOT2_START_ = .); + .got2 : { *(.got2) } + PROVIDE (__CTOR_LIST__ = .); + .ctors : { *(.ctors) } + PROVIDE (__CTOR_END__ = .); + PROVIDE (__DTOR_LIST__ = .); + .dtors : { *(.dtors) } + PROVIDE (__DTOR_END__ = .); + PROVIDE (_FIXUP_START_ = .); + .fixup : { *(.fixup) } + PROVIDE (_FIXUP_END_ = .); + PROVIDE (_GOT2_END_ = .); + PROVIDE (_GOT_START_ = .); + .got : { *(.got) } + .got.plt : { *(.got.plt) } + PROVIDE (_GOT_END_ = .); + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : { *(.sdata) } + _edata = .; + PROVIDE (edata = .); + .sbss : + { + PROVIDE (__sbss_start = .); + *(.sbss) + *(.scommon) + *(.dynsbss) + PROVIDE (__sbss_end = .); + } + .plt : { *(.plt) } + .bss : + { + PROVIDE (__bss_start = .); + *(.dynbss) + *(.bss) + *(COMMON) + } + _end = . ; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* These must appear regardless of . */ +} -- cgit v1.3 From e8120f3d4ed9ca53904a11403a5fe92d38e824a6 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 23 Aug 2010 01:37:55 +0000 Subject: It turns out that the OUTPUT_FORMAT should do the right thing for both endians... --- sys/boot/arm/uboot/Makefile | 2 +- sys/boot/arm/uboot/ldscript.armeb | 134 -------------------------------------- 2 files changed, 1 insertion(+), 135 deletions(-) delete mode 100644 sys/boot/arm/uboot/ldscript.armeb (limited to 'sys/boot') diff --git a/sys/boot/arm/uboot/Makefile b/sys/boot/arm/uboot/Makefile index e8ac403247a2..906fc871a887 100644 --- a/sys/boot/arm/uboot/Makefile +++ b/sys/boot/arm/uboot/Makefile @@ -77,7 +77,7 @@ CLEANFILES+= vers.c loader.help CFLAGS+= -ffreestanding -LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_ARCH} +LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} # Pull in common loader code .PATH: ${.CURDIR}/../../uboot/common diff --git a/sys/boot/arm/uboot/ldscript.armeb b/sys/boot/arm/uboot/ldscript.armeb deleted file mode 100644 index 17a02caa50c8..000000000000 --- a/sys/boot/arm/uboot/ldscript.armeb +++ /dev/null @@ -1,134 +0,0 @@ -/* $FreeBSD$ */ - -OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(_start) -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - . = 0x1000000 + SIZEOF_HEADERS; - .interp : { *(.interp) } - .hash : { *(.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .gnu.version : { *(.gnu.version) } - .gnu.version_d : { *(.gnu.version_d) } - .gnu.version_r : { *(.gnu.version_r) } - .rela.text : - { *(.rela.text) *(.rela.gnu.linkonce.t*) } - .rela.data : - { *(.rela.data) *(.rela.gnu.linkonce.d*) } - .rela.rodata : - { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } - .rela.got : { *(.rela.got) } - .rela.got1 : { *(.rela.got1) } - .rela.got2 : { *(.rela.got2) } - .rela.ctors : { *(.rela.ctors) } - .rela.dtors : { *(.rela.dtors) } - .rela.init : { *(.rela.init) } - .rela.fini : { *(.rela.fini) } - .rela.bss : { *(.rela.bss) } - .rela.plt : { *(.rela.plt) } - .rela.sdata : { *(.rela.sdata) } - .rela.sbss : { *(.rela.sbss) } - .rela.sdata2 : { *(.rela.sdata2) } - .rela.sbss2 : { *(.rela.sbss2) } - .text : - { - *(.text) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t*) - } =0 - _etext = .; - PROVIDE (etext = .); - .init : { *(.init) } =0 - .fini : { *(.fini) } =0 - .rodata : { *(.rodata) *(.gnu.linkonce.r*) } - .rodata1 : { *(.rodata1) } - .sdata2 : { *(.sdata2) } - .sbss2 : { *(.sbss2) } - /* Adjust the address for the data segment to the next page up. */ - . = ((. + 0x1000) & ~(0x1000 - 1)); - .data : - { - *(.data) - *(.gnu.linkonce.d*) - CONSTRUCTORS - } - .data1 : { *(.data1) } - .got1 : { *(.got1) } - .dynamic : { *(.dynamic) } - /* Put .ctors and .dtors next to the .got2 section, so that the pointers - get relocated with -mrelocatable. Also put in the .fixup pointers. - The current compiler no longer needs this, but keep it around for 2.7.2 */ - PROVIDE (_GOT2_START_ = .); - .got2 : { *(.got2) } - PROVIDE (__CTOR_LIST__ = .); - .ctors : { *(.ctors) } - PROVIDE (__CTOR_END__ = .); - PROVIDE (__DTOR_LIST__ = .); - .dtors : { *(.dtors) } - PROVIDE (__DTOR_END__ = .); - PROVIDE (_FIXUP_START_ = .); - .fixup : { *(.fixup) } - PROVIDE (_FIXUP_END_ = .); - PROVIDE (_GOT2_END_ = .); - PROVIDE (_GOT_START_ = .); - .got : { *(.got) } - .got.plt : { *(.got.plt) } - PROVIDE (_GOT_END_ = .); - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - .sdata : { *(.sdata) } - _edata = .; - PROVIDE (edata = .); - .sbss : - { - PROVIDE (__sbss_start = .); - *(.sbss) - *(.scommon) - *(.dynsbss) - PROVIDE (__sbss_end = .); - } - .plt : { *(.plt) } - .bss : - { - PROVIDE (__bss_start = .); - *(.dynbss) - *(.bss) - *(COMMON) - } - _end = . ; - PROVIDE (end = .); - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - /* These must appear regardless of . */ -} -- cgit v1.3 From 5aae6977bc729a2a3981f363c81995fcbd474bbf Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 23 Aug 2010 01:42:09 +0000 Subject: MF tbemd: Minor tweaks, prefer MACHINE_CPUARCH generally to MACHINE_ARCH --- sys/boot/i386/Makefile.inc | 2 +- sys/boot/i386/boot2/Makefile | 2 +- sys/boot/i386/gptboot/Makefile | 2 +- sys/boot/i386/gptzfsboot/Makefile | 2 +- sys/boot/i386/libfirewire/Makefile | 4 ++-- sys/boot/i386/libi386/Makefile | 4 ++-- sys/boot/i386/loader/Makefile | 2 +- sys/boot/i386/zfsboot/Makefile | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/i386/Makefile.inc b/sys/boot/i386/Makefile.inc index 72c6395acf0f..a25684012c90 100644 --- a/sys/boot/i386/Makefile.inc +++ b/sys/boot/i386/Makefile.inc @@ -9,7 +9,7 @@ CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 LDFLAGS+= -nostdlib -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 -march=i386 LDFLAGS+= -m elf_i386_fbsd AFLAGS+= --32 diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile index 84a63c1ad4b9..bff4647668a4 100644 --- a/sys/boot/i386/boot2/Makefile +++ b/sys/boot/i386/boot2/Makefile @@ -99,7 +99,7 @@ boot2.h: boot1.out ORG1=`printf "%d" ${ORG1}` \ REL1=`printf "%d" ${REL1}` > ${.TARGET} -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend boot2.s: machine CLEANFILES+= machine machine: diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile index cc71b3575e83..f76fb4e70afe 100644 --- a/sys/boot/i386/gptboot/Makefile +++ b/sys/boot/i386/gptboot/Makefile @@ -67,7 +67,7 @@ gptboot.out: ${BTXCRT} gptboot.o sio.o gptboot.o: ${.CURDIR}/../../common/ufsread.c -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend gptboot.o: machine CLEANFILES+= machine machine: diff --git a/sys/boot/i386/gptzfsboot/Makefile b/sys/boot/i386/gptzfsboot/Makefile index 467d3123aec0..cf7ff35b6427 100644 --- a/sys/boot/i386/gptzfsboot/Makefile +++ b/sys/boot/i386/gptzfsboot/Makefile @@ -64,7 +64,7 @@ gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend zfsboot.o: machine CLEANFILES+= machine machine: diff --git a/sys/boot/i386/libfirewire/Makefile b/sys/boot/i386/libfirewire/Makefile index 28f76307d8a0..191b95479e25 100644 --- a/sys/boot/i386/libfirewire/Makefile +++ b/sys/boot/i386/libfirewire/Makefile @@ -16,7 +16,7 @@ CFLAGS+= -I${.CURDIR}/../libi386 CFLAGS+= -Wformat -Wall -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine machine: ln -sf ${.CURDIR}/../../../i386/include machine @@ -24,7 +24,7 @@ machine: .include -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend ${OBJS}: machine .endif diff --git a/sys/boot/i386/libi386/Makefile b/sys/boot/i386/libi386/Makefile index f1a461a88c4e..3b897847ea8b 100644 --- a/sys/boot/i386/libi386/Makefile +++ b/sys/boot/i386/libi386/Makefile @@ -53,7 +53,7 @@ CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ # the location of libstand CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine machine: ln -sf ${.CURDIR}/../../../i386/include machine @@ -61,6 +61,6 @@ machine: .include -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend ${OBJS}: machine .endif diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile index 71307c04606d..a6f0d97919a3 100644 --- a/sys/boot/i386/loader/Makefile +++ b/sys/boot/i386/loader/Makefile @@ -119,7 +119,7 @@ LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFS} ${LIBI386} ${LIBSTAND} .include -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend ${OBJS}: machine CLEANFILES+= machine machine: diff --git a/sys/boot/i386/zfsboot/Makefile b/sys/boot/i386/zfsboot/Makefile index 1653534a3257..7e5cb567e0e9 100644 --- a/sys/boot/i386/zfsboot/Makefile +++ b/sys/boot/i386/zfsboot/Makefile @@ -98,7 +98,7 @@ zfsboot.h: zfsldr.out ORG1=`printf "%d" ${ORG1}` \ REL1=`printf "%d" ${REL1}` > ${.TARGET} -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend zfsboot.s: machine CLEANFILES+= machine machine: -- cgit v1.3 From 343bc19749e3f1863a23468d307dad671ca3c278 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 23 Aug 2010 01:43:47 +0000 Subject: MF tbemd: Minor tweaks, prefer MACHINE_CPUARCH generally to MACHINE_ARCH (which simplifies some powerpc/powerpc64 ifs) --- sys/boot/common/Makefile.inc | 8 ++++---- sys/boot/ficl/Makefile | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/common/Makefile.inc b/sys/boot/common/Makefile.inc index 6b4c769ce84b..ff3ec3912b79 100644 --- a/sys/boot/common/Makefile.inc +++ b/sys/boot/common/Makefile.inc @@ -4,17 +4,17 @@ SRCS+= boot.c commands.c console.c devopen.c interp.c SRCS+= interp_backslash.c interp_parse.c ls.c misc.c SRCS+= module.c panic.c -.if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c .elif ${MACHINE} == "pc98" SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c -.elif ${MACHINE_ARCH} == "arm" +.elif ${MACHINE_ARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" SRCS+= load_elf32.c reloc_elf32.c -.elif ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +.elif ${MACHINE_CPUARCH} == "powerpc" SRCS+= load_elf32.c reloc_elf32.c SRCS+= load_elf64.c reloc_elf64.c -.elif ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "ia64" +.elif ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "ia64" SRCS+= load_elf64.c reloc_elf64.c .endif diff --git a/sys/boot/ficl/Makefile b/sys/boot/ficl/Makefile index cdc8f7eddeed..61760d003280 100644 --- a/sys/boot/ficl/Makefile +++ b/sys/boot/ficl/Makefile @@ -1,20 +1,20 @@ # $FreeBSD$ # -.PATH: ${.CURDIR}/${MACHINE_ARCH:S/amd64/i386/:S/powerpc64/powerpc/} +.PATH: ${.CURDIR}/${MACHINE_CPUARCH:S/amd64/i386/} BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \ prefix.c search.c stack.c tools.c vm.c words.c SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o CFLAGS+= -ffreestanding -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 .endif -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" CFLAGS+= -mno-sse3 .endif -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "arm" +.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" CFLAGS+= -msoft-float .endif .if ${MACHINE} == "pc98" @@ -41,7 +41,7 @@ SOFTWORDS= softcore.fr jhlocal.fr marker.fr freebsd.fr ficllocal.fr \ # Optional OO extension softwords #SOFTWORDS+= oo.fr classes.fr -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 -march=i386 -I. .endif @@ -49,14 +49,14 @@ CFLAGS+= -m32 -march=i386 -I. CFLAGS+= -m32 -mcpu=powerpc -I. .endif -CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${MACHINE_ARCH:S/amd64/i386/:S/powerpc64/powerpc/} \ +CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${MACHINE_CPUARCH:S/amd64/i386/} \ -I${.CURDIR}/../common softcore.c: ${SOFTWORDS} softcore.awk (cd ${.CURDIR}/softwords; cat ${SOFTWORDS} \ | awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET} -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" ${SRCS:M*.c:R:S/$/.o/g}: machine beforedepend ${OBJS}: machine -- cgit v1.3 From 99a4fb6cbc891bcee2267da411334d4b3a7720f7 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 23 Aug 2010 01:48:07 +0000 Subject: MF tbemd: move to using specific architecture makefiles --- sys/boot/Makefile | 20 +------------------- sys/boot/Makefile.amd64 | 4 ++++ sys/boot/Makefile.arm | 3 +++ sys/boot/Makefile.i386 | 4 ++++ sys/boot/Makefile.ia64 | 3 +++ sys/boot/Makefile.pc98 | 4 ++++ sys/boot/Makefile.powerpc | 4 ++++ sys/boot/Makefile.sparc64 | 3 +++ sys/boot/efi/libefi/Makefile | 2 +- 9 files changed, 27 insertions(+), 20 deletions(-) create mode 100644 sys/boot/Makefile.amd64 create mode 100644 sys/boot/Makefile.arm create mode 100644 sys/boot/Makefile.i386 create mode 100644 sys/boot/Makefile.ia64 create mode 100644 sys/boot/Makefile.pc98 create mode 100644 sys/boot/Makefile.powerpc create mode 100644 sys/boot/Makefile.sparc64 (limited to 'sys/boot') diff --git a/sys/boot/Makefile b/sys/boot/Makefile index b2eeb9554703..6c879972f928 100644 --- a/sys/boot/Makefile +++ b/sys/boot/Makefile @@ -1,31 +1,13 @@ # $FreeBSD$ .include +.include .if ${MK_FORTH} != "no" # Build the add-in FORTH interpreter. SUBDIR+= ficl .endif -# Build EFI library. -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" || ${MACHINE_ARCH} == "ia64" -SUBDIR+= efi -.endif - -# Build Open Firmware library. -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "sparc64" -SUBDIR+= ofw -.endif - -# Build U-Boot library. -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "arm" -SUBDIR+= uboot -.endif - -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" -SUBDIR+= zfs -.endif - .if ${MK_FDT} != "no" SUBDIR+= fdt .endif diff --git a/sys/boot/Makefile.amd64 b/sys/boot/Makefile.amd64 new file mode 100644 index 000000000000..256201d4f940 --- /dev/null +++ b/sys/boot/Makefile.amd64 @@ -0,0 +1,4 @@ +# $FreeBSD$ + +SUBDIR+= efi +SUBDIR+= zfs diff --git a/sys/boot/Makefile.arm b/sys/boot/Makefile.arm new file mode 100644 index 000000000000..f96104db47c5 --- /dev/null +++ b/sys/boot/Makefile.arm @@ -0,0 +1,3 @@ +# $FreeBSD$ + +SUBDIR+= uboot diff --git a/sys/boot/Makefile.i386 b/sys/boot/Makefile.i386 new file mode 100644 index 000000000000..256201d4f940 --- /dev/null +++ b/sys/boot/Makefile.i386 @@ -0,0 +1,4 @@ +# $FreeBSD$ + +SUBDIR+= efi +SUBDIR+= zfs diff --git a/sys/boot/Makefile.ia64 b/sys/boot/Makefile.ia64 new file mode 100644 index 000000000000..921f2930d300 --- /dev/null +++ b/sys/boot/Makefile.ia64 @@ -0,0 +1,3 @@ +# $FreeBSD$ + +SUBDIR+= efi diff --git a/sys/boot/Makefile.pc98 b/sys/boot/Makefile.pc98 new file mode 100644 index 000000000000..aa989e1784bd --- /dev/null +++ b/sys/boot/Makefile.pc98 @@ -0,0 +1,4 @@ +# $FreeBSD$ + +# Blank, to override Makefile.i386 since Makefile.$MACHINE is included before +# Makefile.$MACHINE_ARCH diff --git a/sys/boot/Makefile.powerpc b/sys/boot/Makefile.powerpc new file mode 100644 index 000000000000..ca8c33139b11 --- /dev/null +++ b/sys/boot/Makefile.powerpc @@ -0,0 +1,4 @@ +# $FreeBSD$ + +SUBDIR+= ofw +SUBDIR+= uboot diff --git a/sys/boot/Makefile.sparc64 b/sys/boot/Makefile.sparc64 new file mode 100644 index 000000000000..5723629ba475 --- /dev/null +++ b/sys/boot/Makefile.sparc64 @@ -0,0 +1,3 @@ +# $FreeBSD$ + +SUBDIR+= ofw diff --git a/sys/boot/efi/libefi/Makefile b/sys/boot/efi/libefi/Makefile index 55053e1042f7..beb9269d0a25 100644 --- a/sys/boot/efi/libefi/Makefile +++ b/sys/boot/efi/libefi/Makefile @@ -7,7 +7,7 @@ SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ libefi.c time.c CFLAGS+= -I${.CURDIR}/../include -CFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH:S/amd64/i386/} +CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH:S/amd64/i386/} CFLAGS+= -I${.CURDIR}/../../../../lib/libstand # Pick up the bootstrap header for some interface items -- cgit v1.3 From f0e82e0b0134580c9ae463da8946142ff4641fd8 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 23 Aug 2010 01:50:34 +0000 Subject: MF tbemd: Minor tweaks, prefer MACHINE_CPUARCH generally to MACHINE_ARCH (which simplifies some powerpc/powerpc64 ifs) --- sys/boot/ia64/common/Makefile | 4 ++-- sys/boot/ia64/efi/Makefile | 10 +++++----- sys/boot/ia64/ski/Makefile | 4 ++-- sys/boot/ofw/libofw/Makefile | 4 ++-- sys/boot/uboot/lib/Makefile | 2 +- sys/boot/zfs/Makefile | 12 ++++++------ 6 files changed, 18 insertions(+), 18 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/ia64/common/Makefile b/sys/boot/ia64/common/Makefile index 8261c25539cc..3204edcd6c4f 100644 --- a/sys/boot/ia64/common/Makefile +++ b/sys/boot/ia64/common/Makefile @@ -9,7 +9,7 @@ INTERNALLIB= SRCS= autoload.c bootinfo.c copy.c devicename.c exec.c CFLAGS+= -I${.CURDIR}/../../efi/include -CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_ARCH} +CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_CPUARCH} CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I${.CURDIR}/../../../../lib/libstand @@ -17,7 +17,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH CFLAGS+= -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE_ARCH} +CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE_CPUARCH} .endif .PATH: ${.CURDIR}/../../common diff --git a/sys/boot/ia64/efi/Makefile b/sys/boot/ia64/efi/Makefile index 5682ac85ea61..27e81b996ab5 100644 --- a/sys/boot/ia64/efi/Makefile +++ b/sys/boot/ia64/efi/Makefile @@ -9,21 +9,21 @@ PROG= loader.sym INTERNALPROG= SRCS= conf.c efimd.c main.c pal.S start.S vers.c -.PATH: ${.CURDIR}/../../../${MACHINE_ARCH}/${MACHINE_ARCH} +.PATH: ${.CURDIR}/../../../${MACHINE_CPUARCH}/${MACHINE_CPUARCH} CFLAGS+= -I${.CURDIR}/../common CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../efi/include -CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_ARCH} +CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_CPUARCH} CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I${.CURDIR}/../../../../lib/libstand -LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_ARCH} +LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_CPUARCH} LDFLAGS= -Wl,-T${LDSCRIPT} -shared -symbolic ${PROG}: ${LDSCRIPT} -NEWVERSWHAT= "EFI boot" ${MACHINE_ARCH} +NEWVERSWHAT= "EFI boot" ${MACHINE_CPUARCH} vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} @@ -42,7 +42,7 @@ loader.efi: loader.sym fi ${OBJCOPY} -j .data -j .dynamic -j .dynstr -j .dynsym -j .hash \ -j .rela.dyn -j .reloc -j .sdata -j .text \ - --target=efi-app-${MACHINE_ARCH} ${.ALLSRC} ${.TARGET} + --target=efi-app-${MACHINE_CPUARCH} ${.ALLSRC} ${.TARGET} CLEANFILES= vers.c loader.efi diff --git a/sys/boot/ia64/ski/Makefile b/sys/boot/ia64/ski/Makefile index 081fd72e8e77..5151435b94c0 100644 --- a/sys/boot/ia64/ski/Makefile +++ b/sys/boot/ia64/ski/Makefile @@ -17,10 +17,10 @@ CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I${.CURDIR}/../../../../lib/libstand -LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_ARCH} +LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_CPUARCH} LDFLAGS= -Wl,-T${LDSCRIPT} -NEWVERSWHAT= "SKI boot" ${MACHINE_ARCH} +NEWVERSWHAT= "SKI boot" ${MACHINE_CPUARCH} vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} diff --git a/sys/boot/ofw/libofw/Makefile b/sys/boot/ofw/libofw/Makefile index 5ea0de972af3..945d6508988a 100644 --- a/sys/boot/ofw/libofw/Makefile +++ b/sys/boot/ofw/libofw/Makefile @@ -13,7 +13,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. CFLAGS+= -ffreestanding -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_CPUARCH} == "powerpc" CFLAGS+= -msoft-float SRCS+= ppc64_elf_freebsd.c .endif @@ -24,7 +24,7 @@ CFLAGS+= -DDISK_DEBUG .endif machine: - ln -sf ${.CURDIR}/../../../${MACHINE_ARCH}/include machine + ln -sf ${.CURDIR}/../../../${MACHINE_CPUARCH}/include machine CLEANFILES+= machine diff --git a/sys/boot/uboot/lib/Makefile b/sys/boot/uboot/lib/Makefile index 11088f133f2d..039a282553ce 100644 --- a/sys/boot/uboot/lib/Makefile +++ b/sys/boot/uboot/lib/Makefile @@ -23,7 +23,7 @@ CFLAGS+= -DDISK_DEBUG .endif machine: - ln -sf ${.CURDIR}/../../../${MACHINE_ARCH}/include machine + ln -sf ${.CURDIR}/../../../${MACHINE_CPUARCH}/include machine CLEANFILES+= machine diff --git a/sys/boot/zfs/Makefile b/sys/boot/zfs/Makefile index b48804bc37aa..beba733581cd 100644 --- a/sys/boot/zfs/Makefile +++ b/sys/boot/zfs/Makefile @@ -10,23 +10,23 @@ CFLAGS+= -I${.CURDIR}/../../../lib/libstand CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs CFLAGS+= -ffreestanding -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 .endif -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" CFLAGS+= -mno-sse3 .endif -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "arm" +.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" CFLAGS+= -msoft-float .endif -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 -march=i386 .endif CFLAGS+= -Wformat -Wall -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine machine: ln -sf ${.CURDIR}/../../i386/include machine @@ -34,6 +34,6 @@ machine: .include -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend ${OBJS}: machine .endif -- cgit v1.3 From 25faff346c8453b8248f99c7cff71708262faa37 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 23 Aug 2010 22:24:11 +0000 Subject: MFtbemd: Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want to test of all the CPUs of a given family conform. --- Makefile.inc1 | 4 ++-- cddl/lib/libdtrace/Makefile | 4 ++-- cddl/lib/libzpool/Makefile | 2 +- gnu/lib/csu/Makefile | 6 +++--- gnu/lib/libgomp/Makefile | 7 ++++--- gnu/lib/libstdc++/Makefile | 12 ++++++------ gnu/usr.bin/binutils/gdb/Makefile | 19 +++++-------------- gnu/usr.bin/gdb/Makefile | 3 +-- gnu/usr.bin/gdb/gdbserver/Makefile | 5 ++--- include/Makefile | 4 ++-- lib/Makefile | 20 +++++++++++++------- lib/libc/Makefile | 20 ++++++++++---------- lib/libc/compat-43/Makefile.inc | 2 +- lib/libc/gen/Makefile.inc | 6 +++--- lib/libc/locale/Makefile.inc | 2 +- lib/libc/quad/Makefile.inc | 4 ++-- lib/libc/softfloat/Makefile.inc | 4 ++-- lib/libc/stdlib/Makefile.inc | 4 ++-- lib/libc/string/Makefile.inc | 6 +++--- lib/libc/sys/Makefile.inc | 6 +++--- lib/libc_r/sys/Makefile.inc | 2 +- lib/libdisk/Makefile | 2 +- lib/libkvm/Makefile | 7 ++++--- lib/libpmc/Makefile | 4 ++-- lib/libstand/Makefile | 26 +++++++++++++------------- lib/libthread_db/Makefile | 2 +- lib/msun/Makefile | 2 +- libexec/rtld-elf/Makefile | 14 +++++++------- libexec/rtld-elf/amd64/Makefile.inc | 4 +++- libexec/rtld-elf/i386/Makefile.inc | 4 +++- rescue/rescue/Makefile | 8 ++++---- sbin/atm/atmconfig/Makefile | 3 ++- sbin/bsdlabel/Makefile | 2 +- sbin/camcontrol/Makefile | 3 ++- sbin/gbde/Makefile | 2 +- sbin/newfs_msdos/Makefile | 3 ++- sbin/sunlabel/Makefile | 2 +- secure/lib/libcrypto/Makefile | 30 +++++++++++++++--------------- share/man/man4/Makefile | 4 ++-- share/man/man5/Makefile | 2 +- share/mk/bsd.lib.mk | 2 +- share/mk/bsd.sys.mk | 5 +++-- sys/boot/arm/ixp425/boot2/Makefile | 2 +- sys/conf/kern.post.mk | 4 ++-- sys/conf/kern.pre.mk | 2 +- usr.bin/ldd/Makefile | 2 +- usr.bin/truss/Makefile | 6 +++--- usr.sbin/ac/Makefile | 2 +- usr.sbin/amd/Makefile.inc | 2 +- usr.sbin/apm/Makefile | 2 +- usr.sbin/kldxref/Makefile | 4 ++-- usr.sbin/sade/Makefile | 2 +- usr.sbin/sysinstall/Makefile | 2 +- usr.sbin/tcpdump/tcpdump/Makefile | 2 +- 54 files changed, 155 insertions(+), 150 deletions(-) (limited to 'sys/boot') diff --git a/Makefile.inc1 b/Makefile.inc1 index 28144a6d064b..36c1a34ba2de 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1131,8 +1131,8 @@ _prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc # all shared libraries for ELF. # _startup_libs= gnu/lib/csu -.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf) -_startup_libs+= lib/csu/${MACHINE_ARCH}-elf +.if exists(${.CURDIR}/lib/csu/${MACHINE_CPUARCH}-elf) +_startup_libs+= lib/csu/${MACHINE_CPUARCH}-elf .elif exists(${.CURDIR}/lib/csu/${MACHINE_CPUARCH}-elf) _startup_libs+= lib/csu/${MACHINE_CPUARCH}-elf .elif exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}) diff --git a/cddl/lib/libdtrace/Makefile b/cddl/lib/libdtrace/Makefile index 2cc9564f6b3b..9a107439c20b 100644 --- a/cddl/lib/libdtrace/Makefile +++ b/cddl/lib/libdtrace/Makefile @@ -63,11 +63,11 @@ CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \ #CFLAGS+= -DYYDEBUG -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel -DDIS_MEM .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/i386 .PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/${MACHINE_ARCH} -.elif ${MACHINE_ARCH} == "sparc64" +.elif ${MACHINE_CPUARCH} == "sparc64" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/sparc .else diff --git a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile index 2199a014ae1b..7a0ce3cb98ee 100644 --- a/cddl/lib/libzpool/Makefile +++ b/cddl/lib/libzpool/Makefile @@ -51,7 +51,7 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair CFLAGS+= -DWANTS_MUTEX_OWNED CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/thread CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/sys -CFLAGS+= -I${.CURDIR}/../../../lib/libthr/arch/${MACHINE_ARCH}/include +CFLAGS+= -I${.CURDIR}/../../../lib/libthr/arch/${MACHINE_CPUARCH}/include DPADD= ${LIBPTHREAD} ${LIBZ} LDADD= -lpthread -lz diff --git a/gnu/lib/csu/Makefile b/gnu/lib/csu/Makefile index b7dcb6000820..4999d06a578f 100644 --- a/gnu/lib/csu/Makefile +++ b/gnu/lib/csu/Makefile @@ -24,18 +24,18 @@ CFLAGS+= -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. \ CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG} MKDEP= -DCRT_BEGIN -.if ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_CPUARCH} == "ia64" BEGINSRC= crtbegin.asm ENDSRC= crtend.asm CFLAGS+= -x assembler-with-cpp # Ugly hack CFLAGS+= -include osreldate.h .undef SRCS # hack for 'make depend' .endif -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_CPUARCH} == "powerpc" TGTOBJS= crtsavres.o SRCS+= crtsavres.asm .endif -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" TGTOBJS= crtfastmath.o SRCS+= crtfastmath.c .endif diff --git a/gnu/lib/libgomp/Makefile b/gnu/lib/libgomp/Makefile index 097451673b12..da28f8999fd6 100644 --- a/gnu/lib/libgomp/Makefile +++ b/gnu/lib/libgomp/Makefile @@ -23,9 +23,10 @@ CFLAGS+= -I${.CURDIR} -I. -I${SRCDIR} -I${SRCDIR}/config/posix VERSION_MAP= ${SRCDIR}/libgomp.map # Target-specific OpenMP configuration -.if ${MACHINE_ARCH} == arm || ${MACHINE_ARCH} == i386 || \ - ${MACHINE_ARCH} == powerpc || \ - (${MACHINE_ARCH} == mips && (!defined(TARGET_ABI) || ${TARGET_ABI} != "n64")) +.if ${MACHINE_CPUARCH} == arm || ${MACHINE_CPUARCH} == i386 || \ + ${MACHINE_CPUARCH} == powerpc || \ + (${MACHINE_CPUARCH} == mips && \ + (!defined(TARGET_ABI) || ${TARGET_ABI} != "n64")) OMP_LOCK_ALIGN = 4 OMP_LOCK_KIND= 4 OMP_LOCK_SIZE= 4 diff --git a/gnu/lib/libstdc++/Makefile b/gnu/lib/libstdc++/Makefile index 9fcc5e9edf6d..e0a7bb214ed5 100644 --- a/gnu/lib/libstdc++/Makefile +++ b/gnu/lib/libstdc++/Makefile @@ -14,7 +14,7 @@ LIB= stdc++ SHLIB_MAJOR= 6 CFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H -.if ${MACHINE_ARCH} == "arm" +.if ${MACHINE_CPUARCH} == "arm" CFLAGS+= -D_GLIBCXX_SJLJ_EXCEPTIONS=1 .endif CFLAGS+= -I${.CURDIR} -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include @@ -67,14 +67,14 @@ SRCS+= del_op.cc del_opnt.cc del_opv.cc del_opvnt.cc eh_alloc.cc eh_arm.cc \ SRCS+= cp-demangle.c # MD headers location -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" MARCHDIR= sparc -.elif ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU} != 'i386' +.elif ${MACHINE_CPUARCH} == "i386" && ${MACHINE_CPU} != 'i386' MARCHDIR= i486 -.elif ${MACHINE_ARCH} == "amd64" +.elif ${MACHINE_CPUARCH} == "amd64" MARCHDIR= i486 .else -MARCHDIR= ${MACHINE_ARCH} +MARCHDIR= ${MACHINE_CPUARCH} .endif .if exists(${SRCDIR}/config/cpu/${MARCHDIR}/atomicity.h) @@ -83,7 +83,7 @@ ATOMICITY_H= ${SRCDIR}/config/cpu/${MARCHDIR}/atomicity.h ATOMICITY_H= ${SRCDIR}/config/cpu/generic/atomicity_mutex/atomicity.h .endif -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" .if exists(${SRCDIR}/config/cpu/generic/atomicity_builtins/atomicity.h) ATOMICITY_H= ${SRCDIR}/config/cpu/generic/atomicity_builtins/atomicity.h .endif diff --git a/gnu/usr.bin/binutils/gdb/Makefile b/gnu/usr.bin/binutils/gdb/Makefile index 6e52616ad309..f51d9e357045 100644 --- a/gnu/usr.bin/binutils/gdb/Makefile +++ b/gnu/usr.bin/binutils/gdb/Makefile @@ -8,16 +8,7 @@ GDBDIR= ${.CURDIR}/../../../../contrib/gdb .PATH: ${SRCDIR}/opcodes ${SRCDIR}/binutils # For FSF GDB files, use their CPU (arch) name; for our files use ours. -.if ${TARGET_ARCH} == "sparc64" -GDB_CPU= sparc -.elif ${TARGET_ARCH} == "amd64" -GDB_CPU= i386 -.elif ${TARGET_ARCH} == "powerpc64" -GDB_CPU= powerpc -.else -GDB_CPU= ${TARGET_ARCH} -.endif - +GDB_CPU=${TARGET_CPUARCH:C/amd64/i386/:C/powerpc.*/rs6000/:C/sparc64/sparc/} NO_SHARED?=yes PROG= gdb XSRCS= annotate.c arch-utils.c ax-general.c ax-gdb.c bcache.c \ @@ -57,7 +48,7 @@ WARNS?= 0 CFLAGS+= -DCROSS_COMPILE=1 .endif CFLAGS+= -DDEFAULT_BFD_ARCH=bfd_${GDB_CPU}_arch -CFLAGS+= -I${.CURDIR}/${TARGET_ARCH} +CFLAGS+= -I${.CURDIR}/${TARGET_CPUARCH} CFLAGS+= -I${SRCDIR}/binutils -I${SRCDIR}/bfd CFLAGS+= -I${GDBDIR}/gdb -I${GDBDIR}/gdb/config CFLAGS+= -I$(.CURDIR) @@ -123,8 +114,8 @@ init.c: ${XSRCS} tm.h: echo '#include "${GDB_CPU}/tm-fbsd.h"' > ${.TARGET} -.if exists(${.CURDIR}/fbsd-kgdb-${TARGET_ARCH}.h) - echo '#include "fbsd-kgdb-${TARGET_ARCH}.h"' >> ${.TARGET} +.if exists(${.CURDIR}/fbsd-kgdb-${TARGET_CPUARCH}.h) + echo '#include "fbsd-kgdb-${TARGET_CPUARCH}.h"' >> ${.TARGET} .endif .for H in nm-fbsd xm-${GDB_CPU} @@ -133,7 +124,7 @@ ${H:C/-.*$//}.h: .endfor kvm-fbsd-machine.h: - ln -sf ${.CURDIR}/kvm-fbsd-${TARGET_ARCH}.h ${.TARGET} + ln -sf ${.CURDIR}/kvm-fbsd-${TARGET_CPUARCH}.h ${.TARGET} GDB_VERSION= "5.2.1 (FreeBSD)" gdbversion.c: Makefile diff --git a/gnu/usr.bin/gdb/Makefile b/gnu/usr.bin/gdb/Makefile index db21e5615e58..33f81cb187b3 100644 --- a/gnu/usr.bin/gdb/Makefile +++ b/gnu/usr.bin/gdb/Makefile @@ -2,8 +2,7 @@ SUBDIR= doc libgdb gdb gdbtui kgdb -TARGET_ARCH?= ${MACHINE_ARCH} -.if exists(${.CURDIR}/gdbserver/reg-${TARGET_ARCH}.c) +.if exists(${.CURDIR}/gdbserver/reg-${MACHINE_CPUARCH}.c) SUBDIR+=gdbserver .endif diff --git a/gnu/usr.bin/gdb/gdbserver/Makefile b/gnu/usr.bin/gdb/gdbserver/Makefile index 08f25ae61a55..f5cfd4c49f62 100644 --- a/gnu/usr.bin/gdb/gdbserver/Makefile +++ b/gnu/usr.bin/gdb/gdbserver/Makefile @@ -14,11 +14,10 @@ SRCS= inferiors.c mem-break.c regcache.c remote-utils.c \ server.c signals.c target.c utils.c SRCS+= fbsd-low.c -SRCS+= fbsd-${MACHINE_ARCH}-low.c reg-${MACHINE_ARCH}.c -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +SRCS+= fbsd-${MACHINE_CPUARCH}-low.c reg-${MACHINE_CPUARCH}.c +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= i387-fp.c .endif - #CFLAGS+= -I${.CURDIR}/../arch/${MACHINE_ARCH} CFLAGS+= -I${GDBDIR}/gdb/gdbserver CFLAGS+= -I${GDBDIR}/gdb/regformats diff --git a/include/Makefile b/include/Makefile index 0ba8b17d54ba..4e7fd935ae5f 100644 --- a/include/Makefile +++ b/include/Makefile @@ -115,8 +115,8 @@ INCSLINKS+= machine/$i ${INCLUDEDIR}/$i INCSLINKS+= sys/$i ${INCLUDEDIR}/$i .endfor -.if ${MACHINE} != ${MACHINE_ARCH} -_MARCH=${MACHINE_ARCH} +.if ${MACHINE} != ${MACHINE_CPUARCH} +_MARCH=${MACHINE_CPUARCH} .endif .include diff --git a/lib/Makefile b/lib/Makefile index 1f41df4b5aeb..6f158a4596b7 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -112,10 +112,10 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_bind} \ ${_clang} -.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) -_csu=csu/${MACHINE_ARCH}-elf -.elif exists(${.CURDIR}/csu/${MACHINE_ARCH}/Makefile) -_csu=csu/${MACHINE_ARCH} +.if exists(${.CURDIR}/csu/${MACHINE_CPUARCH}-elf) +_csu=csu/${MACHINE_CPUARCH}-elf +.elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}/Makefile) +_csu=csu/${MACHINE_CPUARCH} .else _csu=csu .endif @@ -168,7 +168,7 @@ _libnetgraph= libnetgraph _libypclnt= libypclnt .endif -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" .if ${MK_NCP} != "no" _libncp= libncp .endif @@ -178,16 +178,22 @@ _libproc= libproc _librtld_db= librtld_db .endif -.if ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_CPUARCH} == "ia64" _libefi= libefi _libsmb= libsmb .endif +.if ${MACHINE_CPUARCH} == "amd64" +.if ${MK_NCP} != "no" +_libncp= libncp +.endif +.endif + .if ${MACHINE_CPUARCH} == "powerpc" _libsmb= libsmb .endif -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" _libsmb= libsmb .endif diff --git a/lib/libc/Makefile b/lib/libc/Makefile index ad4e5bd16290..8aed00f8ad73 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -15,7 +15,7 @@ LIB=c SHLIB_MAJOR= 7 WARNS?= 2 CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include -CFLAGS+=-I${.CURDIR}/${MACHINE_ARCH} +CFLAGS+=-I${.CURDIR}/${MACHINE_CPUARCH} CFLAGS+=-DNLS CLEANFILES+=tags INSTALL_PIC_ARCHIVE= @@ -36,7 +36,7 @@ MDASM= MIASM= NOASM= -.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc" +.include "${.CURDIR}/${MACHINE_CPUARCH}/Makefile.inc" .include "${.CURDIR}/db/Makefile.inc" .include "${.CURDIR}/compat-43/Makefile.inc" .include "${.CURDIR}/gdtoa/Makefile.inc" @@ -49,11 +49,11 @@ NOASM= .include "${.CURDIR}/net/Makefile.inc" .include "${.CURDIR}/nls/Makefile.inc" .include "${.CURDIR}/posix1e/Makefile.inc" -.if ${MACHINE_ARCH} != "amd64" && \ - ${MACHINE_ARCH} != "ia64" && \ +.if ${MACHINE_CPUARCH} != "amd64" && \ + ${MACHINE_CPUARCH} != "ia64" && \ ${MACHINE_ARCH} != "powerpc64" && \ - ${MACHINE_ARCH} != "sparc64" && \ - ${MACHINE_ARCH} != "mips" + ${MACHINE_CPUARCH} != "sparc64" && \ + ${MACHINE_CPUARCH} != "mips" .include "${.CURDIR}/quad/Makefile.inc" .endif .if ${MACHINE_ARCH} == "mips" && \ @@ -70,7 +70,7 @@ NOASM= .include "${.CURDIR}/rpc/Makefile.inc" .include "${.CURDIR}/uuid/Makefile.inc" .include "${.CURDIR}/xdr/Makefile.inc" -.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "mips" +.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" .include "${.CURDIR}/softfloat/Makefile.inc" .endif .if ${MK_NIS} != "no" @@ -115,14 +115,14 @@ KQSRCS= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \ KSRCS= bcmp.c ffs.c ffsl.c fls.c flsl.c index.c mcount.c rindex.c \ strcat.c strcmp.c strcpy.c strlen.c strncpy.c -libkern: libkern.gen libkern.${MACHINE_ARCH} +libkern: libkern.gen libkern.${MACHINE_CPUARCH} libkern.gen: ${KQSRCS} ${KSRCS} cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern -libkern.${MACHINE_ARCH}:: ${KMSRCS} +libkern.${MACHINE_CPUARCH}:: ${KMSRCS} .if defined(KMSRCS) && !empty(KMSRCS) - cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH} + cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_CPUARCH} .endif .include diff --git a/lib/libc/compat-43/Makefile.inc b/lib/libc/compat-43/Makefile.inc index 8505ff227873..e8ec364a2cfa 100644 --- a/lib/libc/compat-43/Makefile.inc +++ b/lib/libc/compat-43/Makefile.inc @@ -2,7 +2,7 @@ # $FreeBSD$ # compat-43 sources -.PATH: ${.CURDIR}/${MACHINE_ARCH}/compat-43 ${.CURDIR}/compat-43 +.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/compat-43 ${.CURDIR}/compat-43 SRCS+= creat.c gethostid.c getwd.c killpg.c sethostid.c setpgrp.c \ setrgid.c setruid.c sigcompat.c diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 5056392ccd2b..204541e594f3 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -2,7 +2,7 @@ # $FreeBSD$ # machine-independent gen sources -.PATH: ${.CURDIR}/${MACHINE_ARCH}/gen ${.CURDIR}/gen +.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/gen ${.CURDIR}/gen SRCS+= __getosreldate.c __xuname.c \ _once_stub.c _pthread_stubs.c _rand48.c _spinlock_stub.c \ @@ -38,8 +38,8 @@ SRCS+= __getosreldate.c __xuname.c \ SYM_MAPS+=${.CURDIR}/gen/Symbol.map # machine-dependent gen sources -.if exists(${.CURDIR}/${MACHINE_ARCH}/gen/Makefile.inc) -.include "${.CURDIR}/${MACHINE_ARCH}/gen/Makefile.inc" +.if exists(${.CURDIR}/${MACHINE_CPUARCH}/gen/Makefile.inc) +.include "${.CURDIR}/${MACHINE_CPUARCH}/gen/Makefile.inc" .endif MAN+= alarm.3 arc4random.3 \ diff --git a/lib/libc/locale/Makefile.inc b/lib/libc/locale/Makefile.inc index 074c4d9ded27..8cf5bebd5d71 100644 --- a/lib/libc/locale/Makefile.inc +++ b/lib/libc/locale/Makefile.inc @@ -2,7 +2,7 @@ # $FreeBSD$ # locale sources -.PATH: ${.CURDIR}/${MACHINE_ARCH}/locale ${.CURDIR}/locale +.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/locale ${.CURDIR}/locale SRCS+= ascii.c big5.c btowc.c collate.c collcmp.c euc.c fix_grouping.c \ gb18030.c gb2312.c gbk.c isctype.c iswctype.c \ diff --git a/lib/libc/quad/Makefile.inc b/lib/libc/quad/Makefile.inc index 14a5b1f50d13..84723a73658c 100644 --- a/lib/libc/quad/Makefile.inc +++ b/lib/libc/quad/Makefile.inc @@ -2,9 +2,9 @@ # $FreeBSD$ # Quad support, if needed -.PATH: ${.CURDIR}/${MACHINE_ARCH}/quad ${.CURDIR}/quad +.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/quad ${.CURDIR}/quad -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= cmpdi2.c divdi3.c moddi3.c qdivrem.c ucmpdi2.c udivdi3.c umoddi3.c diff --git a/lib/libc/softfloat/Makefile.inc b/lib/libc/softfloat/Makefile.inc index c78676182657..c3df0ae69ec8 100644 --- a/lib/libc/softfloat/Makefile.inc +++ b/lib/libc/softfloat/Makefile.inc @@ -2,10 +2,10 @@ # $FreeBSD$ SOFTFLOAT_BITS?=64 -.PATH: ${MACHINE_ARCH}/softfloat \ +.PATH: ${MACHINE_CPUARCH}/softfloat \ ${.CURDIR}/softfloat/bits${SOFTFLOAT_BITS} ${.CURDIR}/softfloat -CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH}/softfloat -I${.CURDIR}/softfloat +CFLAGS+= -I${.CURDIR}/${MACHINE_CPUARCH}/softfloat -I${.CURDIR}/softfloat CFLAGS+= -DSOFTFLOAT_FOR_GCC SRCS+= softfloat.c diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.inc index 1d06dd390c50..d26f66a09ae7 100644 --- a/lib/libc/stdlib/Makefile.inc +++ b/lib/libc/stdlib/Makefile.inc @@ -2,7 +2,7 @@ # $FreeBSD$ # machine-independent stdlib sources -.PATH: ${.CURDIR}/${MACHINE_ARCH}/stdlib ${.CURDIR}/stdlib +.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/stdlib ${.CURDIR}/stdlib MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \ bsearch.c div.c exit.c getenv.c getopt.c getopt_long.c \ @@ -16,7 +16,7 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \ SYM_MAPS+= ${.CURDIR}/stdlib/Symbol.map # machine-dependent stdlib sources -.sinclude "${.CURDIR}/${MACHINE_ARCH}/stdlib/Makefile.inc" +.sinclude "${.CURDIR}/${MACHINE_CPUARCH}/stdlib/Makefile.inc" MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 bsearch.3 \ div.3 exit.3 getenv.3 getopt.3 getopt_long.3 getsubopt.3 \ diff --git a/lib/libc/string/Makefile.inc b/lib/libc/string/Makefile.inc index b0a1899009db..96759d5bd7d8 100644 --- a/lib/libc/string/Makefile.inc +++ b/lib/libc/string/Makefile.inc @@ -1,7 +1,7 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -.PATH: ${.CURDIR}/${MACHINE_ARCH}/string ${.CURDIR}/string +.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/string ${.CURDIR}/string CFLAGS+= -I${.CURDIR}/locale @@ -26,8 +26,8 @@ SYM_MAPS+= ${.CURDIR}/string/Symbol.map # machine-dependent string sources -.if exists(${.CURDIR}/${MACHINE_ARCH}/string/Makefile.inc) -.include "${.CURDIR}/${MACHINE_ARCH}/string/Makefile.inc" +.if exists(${.CURDIR}/${MACHINE_CPUARCH}/string/Makefile.inc) +.include "${.CURDIR}/${MACHINE_CPUARCH}/string/Makefile.inc" .endif MAN+= bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \ diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 1915c550ebaf..05c3e173d109 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -2,7 +2,7 @@ # $FreeBSD$ # sys sources -.PATH: ${.CURDIR}/${MACHINE_ARCH}/sys ${.CURDIR}/sys +.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/sys ${.CURDIR}/sys # Include the generated makefile containing the *complete* list # of syscall names in MIASM. @@ -13,8 +13,8 @@ # MDASM names override the default syscall names in MIASM. # NOASM will prevent the default syscall code from being generated. # -.if exists(${.CURDIR}/${MACHINE_ARCH}/sys/Makefile.inc) -.include "${.CURDIR}/${MACHINE_ARCH}/sys/Makefile.inc" +.if exists(${.CURDIR}/${MACHINE_CPUARCH}/sys/Makefile.inc) +.include "${.CURDIR}/${MACHINE_CPUARCH}/sys/Makefile.inc" .endif # Sources common to both syscall interfaces: diff --git a/lib/libc_r/sys/Makefile.inc b/lib/libc_r/sys/Makefile.inc index e608afa69909..ab6db1f4f15e 100644 --- a/lib/libc_r/sys/Makefile.inc +++ b/lib/libc_r/sys/Makefile.inc @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/sys ${.CURDIR}/arch/${MACHINE_ARCH} +.PATH: ${.CURDIR}/sys ${.CURDIR}/arch/${MACHINE_CPUARCH} SRCS+= uthread_error.c _atomic_lock.S diff --git a/lib/libdisk/Makefile b/lib/libdisk/Makefile index 763170d4852c..47cf372e70e9 100644 --- a/lib/libdisk/Makefile +++ b/lib/libdisk/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.if ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_CPUARCH} == "ia64" _open_disk= open_ia64_disk.c .else _change = change.c diff --git a/lib/libkvm/Makefile b/lib/libkvm/Makefile index e62d7cae2913..bf464eddc4fa 100644 --- a/lib/libkvm/Makefile +++ b/lib/libkvm/Makefile @@ -11,10 +11,11 @@ CFLAGS+=-DSUN4V WARNS?= 0 -SRCS= kvm.c kvm_${MACHINE_ARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \ +SRCS= kvm.c kvm_${MACHINE_CPUARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \ kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c kvm_vnet.c -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "arm" -SRCS+= kvm_minidump_${MACHINE_ARCH}.c +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "arm" +SRCS+= kvm_minidump_${MACHINE_CPUARCH}.c .endif INCS= kvm.h diff --git a/lib/libpmc/Makefile b/lib/libpmc/Makefile index fd35fd5acb2d..85ddf0f45a14 100644 --- a/lib/libpmc/Makefile +++ b/lib/libpmc/Makefile @@ -22,7 +22,7 @@ MAN+= pmc_start.3 MAN+= pmclog.3 # PMC-dependent manual pages -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" MAN+= pmc.atom.3 MAN+= pmc.core.3 MAN+= pmc.core2.3 @@ -38,7 +38,7 @@ MAN+= pmc.corei7uc.3 MAN+= pmc.westmere.3 MAN+= pmc.westmereuc.3 MAN+= pmc.tsc.3 -.elif ${MACHINE_ARCH} == "arm" && ${CPUTYPE} == "xscale" +.elif ${MACHINE_CPUARCH} == "arm" && ${CPUTYPE} == "xscale" MAN+= pmc.xscale.3 .endif diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile index f44d60dd2556..90b47e780213 100644 --- a/lib/libstand/Makefile +++ b/lib/libstand/Makefile @@ -20,23 +20,23 @@ WARNS?= 0 CFLAGS+= -ffreestanding -Wformat CFLAGS+= -I${.CURDIR} -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 .endif -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" CFLAGS+= -mno-sse3 .endif .if ${MACHINE} == "pc98" CFLAGS+= -Os .endif -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_CPUARCH} == "powerpc" CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG .endif .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -m32 -I. .endif -.if ${MACHINE_ARCH} == "arm" +.if ${MACHINE_CPUARCH} == "arm" CFLAGS+= -msoft-float -D_STANDALONE .endif @@ -54,19 +54,19 @@ SRCS+= ntoh.c # string functions from libc .PATH: ${.CURDIR}/../libc/string -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \ - ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "sparc64" || \ - ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "arm" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" || \ + ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "arm" SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \ memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \ strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \ strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .endif -.if ${MACHINE_ARCH} == "arm" +.if ${MACHINE_CPUARCH} == "arm" .PATH: ${.CURDIR}/../libc/arm/gen SRCS+= divsi3.S .endif -.if ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_CPUARCH} == "ia64" .PATH: ${.CURDIR}/../libc/ia64/string SRCS+= bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \ memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \ @@ -78,7 +78,7 @@ SRCS+= bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \ SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S .endif -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_CPUARCH} == "powerpc" .PATH: ${.CURDIR}/../libc/quad SRCS+= ashldi3.c ashrdi3.c .PATH: ${.CURDIR}/../libc/powerpc/gen @@ -90,12 +90,12 @@ SRCS+= syncicache.c SRCS+= uuid_equal.c uuid_is_nil.c # _setjmp/_longjmp -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" .PATH: ${.CURDIR}/i386 .elif ${MACHINE_ARCH} == "powerpc64" .PATH: ${.CURDIR}/powerpc .else -.PATH: ${.CURDIR}/${MACHINE_ARCH} +.PATH: ${.CURDIR}/${MACHINE_CPUARCH} .endif SRCS+= _setjmp.S @@ -157,7 +157,7 @@ SRCS+= splitfs.c .include -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" beforedepend ${OBJS}: machine cleandepend: cleanmachine cleanmachine: diff --git a/lib/libthread_db/Makefile b/lib/libthread_db/Makefile index 7aaefd7cfd46..047bbe668081 100644 --- a/lib/libthread_db/Makefile +++ b/lib/libthread_db/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/arch/${MACHINE_ARCH} +.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH} LIB= thread_db SHLIB_MAJOR= 3 diff --git a/lib/msun/Makefile b/lib/msun/Makefile index 35077a38dbb7..38ce172cb3dc 100644 --- a/lib/msun/Makefile +++ b/lib/msun/Makefile @@ -76,7 +76,7 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c \ # Location of fpmath.h and _fpmath.h LIBCDIR= ${.CURDIR}/../libc CFLAGS+= -I${.CURDIR}/src -I${LIBCDIR}/include \ - -I${LIBCDIR}/${MACHINE_ARCH} + -I${LIBCDIR}/${MACHINE_CPUARCH} SYM_MAPS+= ${.CURDIR}/Symbol.map VERSION_DEF= ${LIBCDIR}/Versions.def diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index 2f5d574ada60..6cf09bed281e 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -10,7 +10,7 @@ SRCS= rtld_start.S \ MAN= rtld.1 CSTD?= gnu99 CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR} +CFLAGS+= -I${.CURDIR}/${MACHINE_CPUARCH} -I${.CURDIR} .if ${MACHINE_ARCH} == "powerpc64" LDFLAGS+= -nostdlib -e _rtld_start .else @@ -29,7 +29,7 @@ LDFLAGS+= -shared -Wl,-Bsymbolic DPADD= ${LIBC_PIC} LDADD= -lc_pic -lssp_nonshared -.if ${MACHINE_ARCH} != "ia64" +.if ${MACHINE_CPUARCH} != "ia64" .if ${MK_SYMVER} == "yes" LIBCDIR= ${.CURDIR}/../../lib/libc VERSION_DEF= ${LIBCDIR}/Versions.def @@ -39,14 +39,14 @@ LDFLAGS+= -Wl,--version-script=${VERSION_MAP} ${PROG}: ${VERSION_MAP} -.if exists(${.CURDIR}/${MACHINE_ARCH}/Symbol.map) -SYMBOL_MAPS+= ${.CURDIR}/${MACHINE_ARCH}/Symbol.map +.if exists(${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map) +SYMBOL_MAPS+= ${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map .endif .endif .endif -.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc) -.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc" +.if exists(${.CURDIR}/${MACHINE_CPUARCH}/Makefile.inc) +.include "${.CURDIR}/${MACHINE_CPUARCH}/Makefile.inc" .endif # Since moving rtld-elf to /libexec, we need to create a symlink. @@ -56,7 +56,7 @@ beforeinstall: -chflags noschg ${DESTDIR}/usr/libexec/${PROG} .endif -.PATH: ${.CURDIR}/${MACHINE_ARCH} +.PATH: ${.CURDIR}/${MACHINE_CPUARCH} .include .include diff --git a/libexec/rtld-elf/amd64/Makefile.inc b/libexec/rtld-elf/amd64/Makefile.inc index ba39193cf89a..b265a9d76778 100644 --- a/libexec/rtld-elf/amd64/Makefile.inc +++ b/libexec/rtld-elf/amd64/Makefile.inc @@ -1,5 +1,7 @@ +# $FreeBSD$ + CFLAGS+= -elf LDFLAGS+= -elf # Uncomment this to build the dynamic linker as an executable instead # of a shared library: -#LDSCRIPT= ${.CURDIR}/${MACHINE_ARCH}/elf_rtld.x +#LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x diff --git a/libexec/rtld-elf/i386/Makefile.inc b/libexec/rtld-elf/i386/Makefile.inc index ba39193cf89a..b265a9d76778 100644 --- a/libexec/rtld-elf/i386/Makefile.inc +++ b/libexec/rtld-elf/i386/Makefile.inc @@ -1,5 +1,7 @@ +# $FreeBSD$ + CFLAGS+= -elf LDFLAGS+= -elf # Uncomment this to build the dynamic linker as an executable instead # of a shared library: -#LDSCRIPT= ${.CURDIR}/${MACHINE_ARCH}/elf_rtld.x +#LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x diff --git a/rescue/rescue/Makefile b/rescue/rescue/Makefile index d62b6f45cec7..54caad6ff1ed 100644 --- a/rescue/rescue/Makefile +++ b/rescue/rescue/Makefile @@ -145,7 +145,7 @@ CRUNCH_LIBS+= -lzfs -lnvpair -luutil -lavl .endif CRUNCH_LIBS+= -lgeom -lbsdxml -ljail -lkiconv -lmd -lreadline -lsbuf -lufs -lz -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk CRUNCH_ALIAS_bsdlabel= disklabel #.if ${MK_NCP} != "no" @@ -161,15 +161,15 @@ CRUNCH_PROGS_sbin+= bsdlabel CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98 .endif -.if ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_CPUARCH} == "ia64" CRUNCH_PROGS_sbin+= mca .endif -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" CRUNCH_PROGS_sbin+= bsdlabel sunlabel .endif -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CRUNCH_PROGS_sbin+= bsdlabel fdisk CRUNCH_ALIAS_bsdlabel= disklabel .endif diff --git a/sbin/atm/atmconfig/Makefile b/sbin/atm/atmconfig/Makefile index 8564d355efbb..cbf5a9a87d4c 100644 --- a/sbin/atm/atmconfig/Makefile +++ b/sbin/atm/atmconfig/Makefile @@ -27,7 +27,8 @@ LDADD= -lbsnmp CLEANFILES+= oid.h .endif -.if ${MACHINE_ARCH} == "arm" +# XXX - this is verboten +.if ${MACHINE_CPUARCH} == "arm" WARNS?= 3 .endif diff --git a/sbin/bsdlabel/Makefile b/sbin/bsdlabel/Makefile index b60bbd03addb..f91f1601fc72 100644 --- a/sbin/bsdlabel/Makefile +++ b/sbin/bsdlabel/Makefile @@ -8,7 +8,7 @@ SRCS= bsdlabel.c geom_bsd_enc.c #MAN= bsdlabel.5 MAN+= bsdlabel.8 -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" LINKS= ${BINDIR}/bsdlabel ${BINDIR}/disklabel MLINKS= bsdlabel.8 disklabel.8 .endif diff --git a/sbin/camcontrol/Makefile b/sbin/camcontrol/Makefile index 31bbd46f4a52..877e332b8355 100644 --- a/sbin/camcontrol/Makefile +++ b/sbin/camcontrol/Makefile @@ -7,7 +7,8 @@ SRCS+= modeedit.c .else CFLAGS+= -DMINIMALISTIC .endif -.if ${MACHINE_ARCH} == "arm" +# This is verboten +.if ${MACHINE_CPUARCH} == "arm" WARNS?= 3 .endif DPADD= ${LIBCAM} ${LIBSBUF} ${LIBUTIL} diff --git a/sbin/gbde/Makefile b/sbin/gbde/Makefile index 0faa6ba6d397..2abfcb807c15 100644 --- a/sbin/gbde/Makefile +++ b/sbin/gbde/Makefile @@ -9,7 +9,7 @@ SRCS+= g_bde_lock.c # rijndael-fst.c does evil casting things which results in warnings on # 64 bit machines, the test-vectors check out however, so it works right. -.if ${MACHINE_ARCH} != "i386" +.if ${MACHINE_CPUARCH} != "i386" WARNS?= 3 .endif diff --git a/sbin/newfs_msdos/Makefile b/sbin/newfs_msdos/Makefile index 558f673edea4..0a9ffb4340a1 100644 --- a/sbin/newfs_msdos/Makefile +++ b/sbin/newfs_msdos/Makefile @@ -3,7 +3,8 @@ PROG= newfs_msdos MAN= newfs_msdos.8 -.if ${MACHINE_ARCH} == "arm" +# XXX - this is verboten +.if ${MACHINE_CPUARCH} == "arm" WARNS?= 3 .endif diff --git a/sbin/sunlabel/Makefile b/sbin/sunlabel/Makefile index 9eb1a3257091..ed64bee5809c 100644 --- a/sbin/sunlabel/Makefile +++ b/sbin/sunlabel/Makefile @@ -6,7 +6,7 @@ PROG= sunlabel SRCS= sunlabel.c geom_sunlabel_enc.c MAN= sunlabel.8 -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" LINKS= ${BINDIR}/sunlabel ${BINDIR}/disklabel MLINKS= sunlabel.8 disklabel.8 .endif diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile index 212427fb9fe9..af48d7061f45 100644 --- a/secure/lib/libcrypto/Makefile +++ b/secure/lib/libcrypto/Makefile @@ -49,7 +49,7 @@ INCS+= asn1.h asn1_mac.h asn1t.h # bf SRCS+= bf_cfb64.c bf_ecb.c bf_ofb64.c bf_skey.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" .if ${MACHINE_CPU:Mi686} SRCS+= bf-686.s .else @@ -73,9 +73,9 @@ SRCS+= bn_add.c bn_blind.c bn_const.c bn_ctx.c bn_depr.c bn_div.c \ bn_lib.c bn_mod.c bn_mont.c bn_mpi.c bn_mul.c bn_nist.c bn_opt.c \ bn_prime.c bn_print.c bn_rand.c bn_recp.c bn_shift.c bn_sqr.c \ bn_sqrt.c bn_word.c bn_x931p.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= bn-586.s co-586.s -.elif ${MACHINE_ARCH} == "amd64" +.elif ${MACHINE_CPUARCH} == "amd64" SRCS+= x86_64-gcc.c .else SRCS+= bn_asm.c @@ -89,7 +89,7 @@ INCS+= buffer.h # cast SRCS+= c_cfb64.c c_ecb.c c_ofb64.c c_skey.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= cast-586.s .else SRCS+= c_enc.c @@ -97,7 +97,7 @@ SRCS+= c_enc.c INCS+= cast.h # camellia -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= camellia.c cmll_cbc.c cmll_cfb.c cmll_ctr.c cmll_ecb.c \ cmll_misc.c cmll_ofb.c INCS+= camellia.h @@ -117,7 +117,7 @@ SRCS+= cbc3_enc.c cbc_cksm.c cbc_enc.c cfb64ede.c cfb64enc.c cfb_enc.c \ enc_read.c enc_writ.c fcrypt.c ofb64ede.c ofb64enc.c \ ofb_enc.c pcbc_enc.c qud_cksm.c rand_key.c read2pwd.c \ rpc_enc.c set_key.c str2key.c xcbc_enc.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= des-586.s crypt586.s .else SRCS+= des_enc.c fcrypt_b.c @@ -172,7 +172,7 @@ SRCS+= bio_b64.c bio_enc.c bio_md.c bio_ok.c c_all.c c_allc.c c_alld.c \ m_mdc2.c m_null.c m_ripemd.c m_sha.c m_sha1.c names.c \ openbsd_hw.c p5_crpt.c p5_crpt2.c p_dec.c p_enc.c p_lib.c \ p_open.c p_seal.c p_sign.c p_verify.c -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= e_camellia.c .endif INCS+= evp.h @@ -208,7 +208,7 @@ INCS+= md4.h # md5 SRCS+= md5_dgst.c md5_one.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= md5-586.s .endif INCS+= md5.h @@ -255,7 +255,7 @@ INCS+= rc2.h # rc4 SRCS+= rc4_skey.c rc4_fblk.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= rc4-586.s .else SRCS+= rc4_enc.c @@ -264,7 +264,7 @@ INCS+= rc4.h # rc5 SRCS+= rc5_ecb.c rc5_skey.c rc5cfb64.c rc5ofb64.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= rc5-586.s .else SRCS+= rc5_enc.c @@ -284,7 +284,7 @@ INCS+= rsa.h # sha SRCS+= sha1_one.c sha1dgst.c sha_dgst.c sha_one.c sha256.c sha512.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= sha1-586.s .endif INCS+= sha.h @@ -351,10 +351,10 @@ buildinf.h: ${.CURDIR}/Makefile ( echo "#ifndef MK1MF_BUILD"; \ echo " /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \ echo " #define CFLAGS \"$(CC)\""; \ - echo " #define PLATFORM \"FreeBSD-${MACHINE_ARCH}\""; \ + echo " #define PLATFORM \"FreeBSD-${MACHINE_CPUARCH}\""; \ echo "#endif" ) > ${.TARGET} -opensslconf.h: opensslconf-${MACHINE_ARCH}.h +opensslconf.h: opensslconf-${MACHINE_CPUARCH}.h cp -f ${.ALLSRC} ${.TARGET} evp.h: ${LCRYPTO_SRC}/crypto/evp/evp.h @@ -383,11 +383,11 @@ afterinstall: .include -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" .PATH: ${.CURDIR}/i386 .endif -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" _bn_asmpath= ${LCRYPTO_SRC}/crypto/bn/asm .endif diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 4863cda0248b..2fa0e9d9631b 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -628,7 +628,7 @@ MLINKS+=xe.4 if_xe.4 MLINKS+=xl.4 if_xl.4 MLINKS+=zyd.4 if_zyd.4 -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" _acpi_asus.4= acpi_asus.4 _acpi_dock.4= acpi_dock.4 _acpi_fujitsu.4=acpi_fujitsu.4 @@ -678,7 +678,7 @@ _wpi.4= wpi.4 MLINKS+=lindev.4 full.4 .endif -.if ${MACHINE_ARCH} == "powerpc" +.if ${MACHINE_CPUARCH} == "powerpc" _atp.4= atp.4 .endif diff --git a/share/man/man5/Makefile b/share/man/man5/Makefile index 1216fc4491cc..7aad66b907e5 100644 --- a/share/man/man5/Makefile +++ b/share/man/man5/Makefile @@ -83,7 +83,7 @@ MLINKS+=resolver.5 resolv.conf.5 MAN+= hesiod.conf.5 .endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" _boot.config.5= boot.config.5 .endif diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 94d918b48798..ecb91bfd2883 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -58,7 +58,7 @@ STRIP?= -s .SUFFIXES: .out .o .po .So .S .asm .s .c .cc .cpp .cxx .m .C .f .y .l .ln .if !defined(PICFLAG) -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" PICFLAG=-fPIC .else PICFLAG=-fpic diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 3559a267f2bb..f6f8a005f504 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -79,8 +79,9 @@ CWARNFLAGS += -Werror CWARNFLAGS += -Wno-unknown-pragmas .endif -.if ${MK_SSP} != "no" && ${CC:T:Micc} != "icc" && ${MACHINE_ARCH} != "ia64" && \ - ${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips" +.if ${MK_SSP} != "no" && ${CC:T:Micc} != "icc" && \ + ${MACHINE_CPUARCH} != "ia64" && \ + ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" # Don't use -Wstack-protector as it breaks world with -Werror. SSP_CFLAGS ?= -fstack-protector CFLAGS += ${SSP_CFLAGS} diff --git a/sys/boot/arm/ixp425/boot2/Makefile b/sys/boot/arm/ixp425/boot2/Makefile index 138446b6fa25..a329b65c0db6 100644 --- a/sys/boot/arm/ixp425/boot2/Makefile +++ b/sys/boot/arm/ixp425/boot2/Makefile @@ -20,7 +20,7 @@ NO_MAN= KERNPHYSADDR=0x180000 KERNVIRTADDR=${KERNPHYSADDR} BOOT_STACK=0x200000-4 -M=${MACHINE_ARCH} +M=${MACHINE} LDFLAGS=-e ${KERNPHYSADDR} -EB -T ldscript.${M} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} S=${.CURDIR}/../../../.. diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk index f759f271fb8e..c7e6281f69e1 100644 --- a/sys/conf/kern.post.mk +++ b/sys/conf/kern.post.mk @@ -84,8 +84,8 @@ gdbinit: grep -v '# XXX' ${S}/../tools/debugscripts/dot.gdbinit | \ sed "s:MODPATH:${.OBJDIR}/modules:" > .gdbinit cp ${S}/../tools/debugscripts/gdbinit.kernel ${.CURDIR} -.if exists(${S}/../tools/debugscripts/gdbinit.${MACHINE_ARCH}) - cp ${S}/../tools/debugscripts/gdbinit.${MACHINE_ARCH} \ +.if exists(${S}/../tools/debugscripts/gdbinit.${MACHINE_CPUARCH}) + cp ${S}/../tools/debugscripts/gdbinit.${MACHINE_CPUARCH} \ ${.CURDIR}/gdbinit.machine .endif .endif diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index b61113e7e50e..d4bdc1f54b26 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -32,7 +32,7 @@ CTFFLAGS+= -g . else _MINUS_O= -O2 . endif -. if ${MACHINE_ARCH} == "amd64" +. if ${MACHINE_CPUARCH} == "amd64" COPTFLAGS?=-O2 -frename-registers -pipe . else COPTFLAGS?=${_MINUS_O} -pipe diff --git a/usr.bin/ldd/Makefile b/usr.bin/ldd/Makefile index cd172280d783..fd2b7b4d9ccb 100644 --- a/usr.bin/ldd/Makefile +++ b/usr.bin/ldd/Makefile @@ -2,7 +2,7 @@ PROG?= ldd SRCS= ldd.c -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= sods.c .endif diff --git a/usr.bin/truss/Makefile b/usr.bin/truss/Makefile index d907ad59c8e3..ca0ce9234a21 100644 --- a/usr.bin/truss/Makefile +++ b/usr.bin/truss/Makefile @@ -2,7 +2,7 @@ NO_WERROR= PROG= truss -SRCS= main.c setup.c syscalls.c syscalls.h ioctl.c ${MACHINE_ARCH}-fbsd.c +SRCS= main.c setup.c syscalls.c syscalls.h ioctl.c ${MACHINE_CPUARCH}-fbsd.c CFLAGS+= -I${.CURDIR} -I. CLEANFILES= syscalls.master syscalls.h ioctl.c @@ -19,7 +19,7 @@ syscalls.h: syscalls.master ioctl.c: ${.CURDIR}/../kdump/mkioctls sh ${.CURDIR}/../kdump/mkioctls ${DESTDIR}/usr/include > ${.TARGET} -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" SRCS+= i386-linux.c linux_syscalls.h CLEANFILES+=i386l-syscalls.master linux_syscalls.h @@ -31,7 +31,7 @@ linux_syscalls.h: i386l-syscalls.master ${.CURDIR}/i386linux.conf .endif -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" SRCS+= amd64-linux32.c linux32_syscalls.h CLEANFILES+=amd64l32-syscalls.master linux32_syscalls.h diff --git a/usr.sbin/ac/Makefile b/usr.sbin/ac/Makefile index 46064fcf300b..576dbb3323ce 100644 --- a/usr.sbin/ac/Makefile +++ b/usr.sbin/ac/Makefile @@ -4,7 +4,7 @@ PROG= ac MAN= ac.8 # Temporary, while tracking down problem wrt 64-bit time_t's on sparc64 -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" CFLAGS+=-DDEBUG .endif diff --git a/usr.sbin/amd/Makefile.inc b/usr.sbin/amd/Makefile.inc index 673edc1b9152..1965ff933e4c 100644 --- a/usr.sbin/amd/Makefile.inc +++ b/usr.sbin/amd/Makefile.inc @@ -27,7 +27,7 @@ CFLAGS+= -DHAVE_LOCALCONFIG_H CFLAGS+= -DYES_HESIOD .endif -CFLAGS+= -DHOST_CPU=\"${MACHINE_ARCH}\" -DHOST_ARCH=\"${MACHINE_ARCH}\" +CFLAGS+= -DHOST_CPU=\"${MACHINE_CPUARCH}\" -DHOST_ARCH=\"${MACHINE_ARCH}\" .if exists(${.OBJDIR}/../libamu) LIBAMUDIR= ${.OBJDIR}/../libamu diff --git a/usr.sbin/apm/Makefile b/usr.sbin/apm/Makefile index 08ed25fce66a..3cc6f5042ea9 100644 --- a/usr.sbin/apm/Makefile +++ b/usr.sbin/apm/Makefile @@ -3,6 +3,6 @@ PROG= apm MAN= apm.8 MLINKS= apm.8 apmconf.8 -MANSUBDIR= /${MACHINE_ARCH} +MANSUBDIR= /${MACHINE_CPUARCH} .include diff --git a/usr.sbin/kldxref/Makefile b/usr.sbin/kldxref/Makefile index 2f1550583cf7..c877a8a57ffe 100644 --- a/usr.sbin/kldxref/Makefile +++ b/usr.sbin/kldxref/Makefile @@ -7,8 +7,8 @@ SRCS= kldxref.c ef.c ef_obj.c WARNS?= 2 CFLAGS+=-fno-strict-aliasing -.if exists(ef_${MACHINE_ARCH}.c) -SRCS+= ef_${MACHINE_ARCH}.c +.if exists(ef_${MACHINE_CPUARCH}.c) +SRCS+= ef_${MACHINE_CPUARCH}.c .else SRCS+= ef_nop.c .endif diff --git a/usr.sbin/sade/Makefile b/usr.sbin/sade/Makefile index bd94155595a3..ad284894df0d 100644 --- a/usr.sbin/sade/Makefile +++ b/usr.sbin/sade/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.if ${MACHINE_ARCH} != "ia64" +.if ${MACHINE_CPUARCH} != "ia64" _wizard= wizard.c .endif diff --git a/usr.sbin/sysinstall/Makefile b/usr.sbin/sysinstall/Makefile index c9a7c8980ecf..d18033aacacb 100644 --- a/usr.sbin/sysinstall/Makefile +++ b/usr.sbin/sysinstall/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.if ${MACHINE_ARCH} != "ia64" +.if ${MACHINE_CPUARCH} != "ia64" _wizard= wizard.c .endif diff --git a/usr.sbin/tcpdump/tcpdump/Makefile b/usr.sbin/tcpdump/tcpdump/Makefile index 6f072b72effa..c29694388c4c 100644 --- a/usr.sbin/tcpdump/tcpdump/Makefile +++ b/usr.sbin/tcpdump/tcpdump/Makefile @@ -46,7 +46,7 @@ SRCS+= print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c \ print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c CFLAGS+= -DINET6 .endif -.if ${MACHINE_ARCH} != "i386" +.if ${MACHINE_CPUARCH} != "i386" CFLAGS+= -DLBL_ALIGN .endif -- cgit v1.3 From f5a5c5653a99ce0bc36c42fa5ce0244536560023 Mon Sep 17 00:00:00 2001 From: Rui Paulo Date: Tue, 24 Aug 2010 12:56:45 +0000 Subject: Replace structure assignments with explicity memcpy calls. This allows Clang to compile this file: it was using the builtin memcpy and we want to use the memcpy defined in gptboot.c. (Clang can't compile boot2 yet). Submitted by: Dimitry Andric Reviewed by: jhb --- sys/boot/common/ufsread.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/common/ufsread.c b/sys/boot/common/ufsread.c index cd3ba4c5d126..5d0e8af56b8e 100644 --- a/sys/boot/common/ufsread.c +++ b/sys/boot/common/ufsread.c @@ -223,14 +223,19 @@ fsread(ino_t inode, void *buf, size_t nbyte) return -1; n = INO_TO_VBO(n, inode); #if defined(UFS1_ONLY) - dp1 = ((struct ufs1_dinode *)blkbuf)[n]; + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); #elif defined(UFS2_ONLY) - dp2 = ((struct ufs2_dinode *)blkbuf)[n]; + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); #else if (fs->fs_magic == FS_UFS1_MAGIC) - dp1 = ((struct ufs1_dinode *)blkbuf)[n]; + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); else - dp2 = ((struct ufs2_dinode *)blkbuf)[n]; + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); + #endif inomap = inode; fs_off = 0; -- cgit v1.3 From 194270c84bf0a529dcaf2161a6a91d3c74e77cd6 Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Wed, 25 Aug 2010 16:23:50 +0000 Subject: Fix build of ppc32 loader. --- sys/boot/common/Makefile.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/boot') diff --git a/sys/boot/common/Makefile.inc b/sys/boot/common/Makefile.inc index ff3ec3912b79..925e961bb491 100644 --- a/sys/boot/common/Makefile.inc +++ b/sys/boot/common/Makefile.inc @@ -9,7 +9,7 @@ SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c .elif ${MACHINE} == "pc98" SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c -.elif ${MACHINE_ARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" +.elif ${MACHINE_CPUARCH} == "arm" SRCS+= load_elf32.c reloc_elf32.c .elif ${MACHINE_CPUARCH} == "powerpc" SRCS+= load_elf32.c reloc_elf32.c -- cgit v1.3 From c05f0da034bab79c7a07c200bdd56e0b4b3b9de7 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 31 Aug 2010 17:33:29 +0000 Subject: Use a more robust way to substitute gcc for clang, when compiling gnu/lib/libobjc and sys/boot/i386/boot2, so it also works when using absolute paths and/or options, as in CC="/absolute/path/clang -foo". Approved by: rpaulo (mentor) --- gnu/lib/libobjc/Makefile | 4 +++- sys/boot/i386/boot2/Makefile | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'sys/boot') diff --git a/gnu/lib/libobjc/Makefile b/gnu/lib/libobjc/Makefile index 3dc49d842a60..3513103f2d7c 100644 --- a/gnu/lib/libobjc/Makefile +++ b/gnu/lib/libobjc/Makefile @@ -16,7 +16,9 @@ SRCS= archive.c class.c encoding.c gc.c hash.c init.c linking.m misc.c \ selector.c sendmsg.c thr.c thr-objc.c exception.c # XXX: clang cannot compile libobjc yet -CC:=${CC:C/^cc|^clang/gcc/} +.if ${CC:T:Mclang} == "clang" +CC=gcc +.endif INCS= encoding.h hash.h objc-api.h objc-decls.h objc-list.h objc.h runtime.h \ sarray.h thr.h typedstream.h NXConstStr.h Object.h Protocol.h diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile index bff4647668a4..74aab82de43b 100644 --- a/sys/boot/i386/boot2/Makefile +++ b/sys/boot/i386/boot2/Makefile @@ -3,7 +3,9 @@ .include # XXX: clang can compile the boot code just fine, but boot2 gets too big -CC:=${CC:C/^cc|^clang/gcc/} +.if ${CC:T:Mclang} == "clang" +CC=gcc +.endif FILES= boot boot1 boot2 -- cgit v1.3 From 52e2247273baf52aa772948a9a0ea28690e2da2d Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 31 Aug 2010 17:38:20 +0000 Subject: Always compile pc98 boot2 with gcc instead of clang, just as with i386 boot2. Unfortunately both still are too big when compiled with clang. Reviewed by: nyan Approved by: rpaulo (mentor) --- sys/boot/pc98/boot2/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sys/boot') diff --git a/sys/boot/pc98/boot2/Makefile b/sys/boot/pc98/boot2/Makefile index 63f364c2261a..5f7355fd7838 100644 --- a/sys/boot/pc98/boot2/Makefile +++ b/sys/boot/pc98/boot2/Makefile @@ -1,5 +1,12 @@ # $FreeBSD$ +.include + +# XXX: clang can compile the boot code just fine, but boot2 gets too big +.if ${CC:T:Mclang} == "clang" +CC=gcc +.endif + FILES= boot boot1 boot2 NM?= nm -- cgit v1.3 From 227209559d23063978bb7ce3165394a84201e362 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 31 Aug 2010 18:11:50 +0000 Subject: Avoid directly manipulating a NULL pointer (which could result in undefined behaviour) in sys/boot/pc98/boot2/boot2.c. Reviewed by: nyan Approved by: rpaulo (mentor) --- sys/boot/pc98/boot2/boot2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/pc98/boot2/boot2.c b/sys/boot/pc98/boot2/boot2.c index 8c833ba02d82..e35b42536c20 100644 --- a/sys/boot/pc98/boot2/boot2.c +++ b/sys/boot/pc98/boot2/boot2.c @@ -187,9 +187,9 @@ xfsread(ino_t inode, void *buf, size_t nbyte) static inline uint32_t memsize(void) { - u_char *p = (u_char *)PTOV(0); + u_char *p = (u_char *)PTOV(0x401); - return *(p + 0x401) * 128 * 1024 + *(u_int16_t *)(p + 0x594) * 1024 * 1024; + return *p * 128 * 1024 + *(u_int16_t *)(p + (0x594 - 0x401)) * 1024 * 1024; } static inline void -- cgit v1.3 From cff47502332de59b864b682851f99d954d8fcc45 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Tue, 31 Aug 2010 19:01:12 +0000 Subject: For consistency, change all 'i386' and MACHINE_ARCH to x86. Reviewed by: jhb MFC after: 1 week --- sys/boot/i386/efi/Makefile | 2 +- sys/boot/i386/loader/Makefile | 2 +- sys/boot/i386/zfsloader/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/i386/efi/Makefile b/sys/boot/i386/efi/Makefile index 2d1104611f58..943de1190812 100644 --- a/sys/boot/i386/efi/Makefile +++ b/sys/boot/i386/efi/Makefile @@ -42,7 +42,7 @@ ${PROG}: ${LDSCRIPT} CLEANFILES= vers.c loader.efi -NEWVERSWHAT= "EFI loader" ${MACHINE_ARCH} +NEWVERSWHAT= "EFI loader" x86 vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile index a6f0d97919a3..b834ea064f36 100644 --- a/sys/boot/i386/loader/Makefile +++ b/sys/boot/i386/loader/Makefile @@ -6,7 +6,7 @@ MK_SSP= no LOADER?= loader PROG= ${LOADER}.sym INTERNALPROG= -NEWVERSWHAT?= "bootstrap loader" i386 +NEWVERSWHAT?= "bootstrap loader" x86 # architecture-specific loader code SRCS= main.c conf.c vers.c diff --git a/sys/boot/i386/zfsloader/Makefile b/sys/boot/i386/zfsloader/Makefile index 51338e17f82b..926d69d05480 100644 --- a/sys/boot/i386/zfsloader/Makefile +++ b/sys/boot/i386/zfsloader/Makefile @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../loader LOADER= zfsloader -NEWVERSWHAT= "ZFS enabled bootstrap loader" i386 +NEWVERSWHAT= "ZFS enabled bootstrap loader" x86 LOADER_ZFS_SUPPORT=yes LOADER_ONLY= yes NO_MAN= yes -- cgit v1.3 From cd70197aa97908f96b0a5c517dec2c3f820ecb97 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 1 Sep 2010 15:24:47 +0000 Subject: Use a cleaner expression to retrieve the memory size in pc98's boot2.c, which also avoids NULL pointer arithmetic, as suggested by jhb. The available space goes from 11 bytes to 7. Reviewed by: nyan Approved by: rpaulo (mentor) --- sys/boot/pc98/boot2/boot2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/pc98/boot2/boot2.c b/sys/boot/pc98/boot2/boot2.c index e35b42536c20..54082ad207fa 100644 --- a/sys/boot/pc98/boot2/boot2.c +++ b/sys/boot/pc98/boot2/boot2.c @@ -187,9 +187,8 @@ xfsread(ino_t inode, void *buf, size_t nbyte) static inline uint32_t memsize(void) { - u_char *p = (u_char *)PTOV(0x401); - - return *p * 128 * 1024 + *(u_int16_t *)(p + (0x594 - 0x401)) * 1024 * 1024; + return (*(u_char *)PTOV(0x401) * 128 * 1024 + + *(uint16_t *)PTOV(0x594) * 1024 * 1024); } static inline void -- cgit v1.3 From 4176401397bc6ac21687c3a500fb868cc85afa7c Mon Sep 17 00:00:00 2001 From: Rick Macklem Date: Thu, 2 Sep 2010 01:05:10 +0000 Subject: Modify pxe.c to use the version of nfs_getrootfh() that returns the file handle's size and was recently committed to lib/libstand/nfs.c. This allows pxeboot to use NFSv3 and work correcty for non-FreeBSD as well as FreeBSD NFS servers. If built with OLD_NFSV2 defined, the old code that predated this patch will be used. Tested by: danny at cs.huji.ac.il --- sys/boot/i386/libi386/pxe.c | 59 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'sys/boot') diff --git a/sys/boot/i386/libi386/pxe.c b/sys/boot/i386/libi386/pxe.c index 5629d90e2cb6..0caee6abe42b 100644 --- a/sys/boot/i386/libi386/pxe.c +++ b/sys/boot/i386/libi386/pxe.c @@ -409,6 +409,7 @@ pxe_perror(int err) * Reach inside the libstand NFS code and dig out an NFS handle * for the root filesystem. */ +#ifdef OLD_NFSV2 struct nfs_iodesc { struct iodesc *iodesc; off_t off; @@ -456,6 +457,64 @@ pxe_setnfshandle(char *rootpath) sprintf(cp, "X"); setenv("boot.nfsroot.nfshandle", buf, 1); } +#else /* !OLD_NFSV2 */ + +#define NFS_V3MAXFHSIZE 64 + +struct nfs_iodesc { + struct iodesc *iodesc; + off_t off; + uint32_t fhsize; + u_char fh[NFS_V3MAXFHSIZE]; + /* structure truncated */ +}; +extern struct nfs_iodesc nfs_root_node; +extern int rpc_port; + +static void +pxe_rpcmountcall() +{ + struct iodesc *d; + int error; + + if (!(d = socktodesc(pxe_sock))) + return; + d->myport = htons(--rpc_port); + d->destip = rootip; + if ((error = nfs_getrootfh(d, rootpath, &nfs_root_node.fhsize, + nfs_root_node.fh)) != 0) { + printf("NFS MOUNT RPC error: %d\n", error); + nfs_root_node.fhsize = 0; + } + nfs_root_node.iodesc = d; +} + +static void +pxe_setnfshandle(char *rootpath) +{ + int i; + u_char *fh; + char buf[2 * NFS_V3MAXFHSIZE + 3], *cp; + + /* + * If NFS files were never opened, we need to do mount call + * ourselves. Use nfs_root_node.iodesc as flag indicating + * previous NFS usage. + */ + if (nfs_root_node.iodesc == NULL) + pxe_rpcmountcall(); + + fh = &nfs_root_node.fh[0]; + buf[0] = 'X'; + cp = &buf[1]; + for (i = 0; i < nfs_root_node.fhsize; i++, cp += 2) + sprintf(cp, "%02x", fh[i]); + sprintf(cp, "X"); + setenv("boot.nfsroot.nfshandle", buf, 1); + sprintf(buf, "%d", nfs_root_node.fhsize); + setenv("boot.nfsroot.nfshandlelen", buf, 1); +} +#endif /* OLD_NFSV2 */ void pxenv_call(int func) -- cgit v1.3 From fa942e6074cceb526256643911d778d6fbd8a1b8 Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Thu, 2 Sep 2010 22:26:49 +0000 Subject: In the case of non-sequential mappings, ofw_mapmem() could ask Open Firmware to map a memory region with negative length, causing crashes and Undefined Behavior. Add the appropriate check to make the behavior defined. --- sys/boot/ofw/libofw/ofw_copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/boot') diff --git a/sys/boot/ofw/libofw/ofw_copy.c b/sys/boot/ofw/libofw/ofw_copy.c index 93e7ec656d04..781d4233a014 100644 --- a/sys/boot/ofw/libofw/ofw_copy.c +++ b/sys/boot/ofw/libofw/ofw_copy.c @@ -68,7 +68,7 @@ ofw_mapmem(vm_offset_t dest, const size_t len) /* * Trim area covered by existing mapping, if any */ - if (dest < (last_dest + last_len)) { + if (dest < (last_dest + last_len) && dest >= last_dest) { nlen -= (last_dest + last_len) - dest; dest = last_dest + last_len; } -- cgit v1.3 From 93dbfc78406da5ac59e05602c4ecc12be91e9ded Mon Sep 17 00:00:00 2001 From: Maksim Yevmenkin Date: Wed, 8 Sep 2010 19:50:47 +0000 Subject: Add custom kernel configuration and device tree source files for Seagate FreeAgent DockStar(tm) device. It seems to be a dumb down version of Marvell SheevaPlug. Device tree source file could use more tweaking, but at least it wll network boot and run FreeBSD/arm. --- sys/arm/conf/DOCKSTAR | 76 ++++++++++++ sys/boot/fdt/dts/dockstar.dts | 265 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 341 insertions(+) create mode 100644 sys/arm/conf/DOCKSTAR create mode 100644 sys/boot/fdt/dts/dockstar.dts (limited to 'sys/boot') diff --git a/sys/arm/conf/DOCKSTAR b/sys/arm/conf/DOCKSTAR new file mode 100644 index 000000000000..780cb78d4d68 --- /dev/null +++ b/sys/arm/conf/DOCKSTAR @@ -0,0 +1,76 @@ +# +# Custom kernel for Seagate DockStar (Marvell SheevaPlug based) devices. +# +# $FreeBSD$ +# + +ident DOCKSTAR +include "../mv/kirkwood/std.sheevaplug" + +options SOC_MV_KIRKWOOD +makeoptions MODULES_OVERRIDE="" + +#makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions WERROR="-Werror" + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +options NFSCLIENT #Network Filesystem Client +options NFSLOCKD #Network Lock Manager +options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options BOOTP +options BOOTP_NFSROOT +options BOOTP_NFSV3 +options BOOTP_COMPAT +options BOOTP_WIRED_TO=mge0 + +# Root fs on USB device +#options ROOTDEVNAME=\"ufs:/dev/da0a\" + +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options MUTEX_NOINLINE +options RWLOCK_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING + +# Debugging +options ALT_BREAK_TO_DEBUGGER +options DDB +options KDB + +# Pseudo devices +device md +device random +device pty +device loop + +# Serial ports +device uart + +# Networking +device ether +device mge # Marvell Gigabit Ethernet controller +device mii +device bpf +options HZ=1000 +options DEVICE_POLLING +device vlan + +# USB +options USB_DEBUG # enable debug msgs +device usb +device ehci +device umass +device scbus +device pass +device da + +# Flattened Device Tree +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=dockstar.dts diff --git a/sys/boot/fdt/dts/dockstar.dts b/sys/boot/fdt/dts/dockstar.dts new file mode 100644 index 000000000000..46981094e5dc --- /dev/null +++ b/sys/boot/fdt/dts/dockstar.dts @@ -0,0 +1,265 @@ +/* + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Seagate DockStar (Marvell SheevaPlug based) Device Tree Source. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/ { + model = "seagate,DockStar"; + compatible = "DockStar"; + #address-cells = <1>; + #size-cells = <1>; + + aliases { + ethernet0 = &enet0; + mpp = &MPP; + serial0 = &serial0; + serial1 = &serial1; + soc = &SOC; + sram = &SRAM; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "ARM,88FR131"; + reg = <0x0>; + d-cache-line-size = <32>; // 32 bytes + i-cache-line-size = <32>; // 32 bytes + d-cache-size = <0x4000>; // L1, 16K + i-cache-size = <0x4000>; // L1, 16K + timebase-frequency = <0>; + bus-frequency = <0>; + clock-frequency = <0>; + }; + }; + + memory { + device_type = "memory"; + reg = <0x0 0x8000000>; // 128M at 0x0 + }; + + localbus@f1000000 { + #address-cells = <2>; + #size-cells = <1>; + compatible = "mrvl,lbc"; + + /* This reflects CPU decode windows setup. */ + ranges = <0x0 0x0f 0xf9300000 0x00100000 + 0x1 0x1e 0xfa000000 0x00100000 + 0x2 0x1d 0xfa100000 0x02000000 + 0x3 0x1b 0xfc100000 0x00000400>; + + nor@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x0 0x0 0x00100000>; + bank-width = <2>; + device-width = <1>; + }; + + led@1,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "led"; + reg = <0x1 0x0 0x00100000>; + }; + + nor@2,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x2 0x0 0x02000000>; + bank-width = <2>; + device-width = <1>; + }; + + nand@3,0 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0x3 0x0 0x00100000>; + bank-width = <2>; + device-width = <1>; + }; + }; + + SOC: soc88f6281@f1000000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges = <0x0 0xf1000000 0x00100000>; + bus-frequency = <0>; + + PIC: pic@20200 { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x20200 0x3c>; + compatible = "mrvl,pic"; + }; + + timer@20300 { + compatible = "mrvl,timer"; + reg = <0x20300 0x30>; + interrupts = <1>; + interrupt-parent = <&PIC>; + mrvl,has-wdt; + }; + + MPP: mpp@10000 { + #pin-cells = <2>; + compatible = "mrvl,mpp"; + reg = <0x10000 0x34>; + pin-count = <50>; + pin-map = < + 0 1 /* MPP[0]: NF_IO[2] */ + 1 1 /* MPP[1]: NF_IO[3] */ + 2 1 /* MPP[2]: NF_IO[4] */ + 3 1 /* MPP[3]: NF_IO[5] */ + 4 1 /* MPP[4]: NF_IO[6] */ + 5 1 /* MPP[5]: NF_IO[7] */ + 6 1 /* MPP[6]: SYSRST_OUTn */ + 8 2 /* MPP[8]: UA0_RTS */ + 9 2 /* MPP[9]: UA0_CTS */ + 10 3 /* MPP[10]: UA0_TXD */ + 11 3 /* MPP[11]: UA0_RXD */ + 12 1 /* MPP[12]: SD_CLK */ + 13 1 /* MPP[13]: SD_CMD */ + 14 1 /* MPP[14]: SD_D[0] */ + 15 1 /* MPP[15]: SD_D[1] */ + 16 1 /* MPP[16]: SD_D[2] */ + 17 1 /* MPP[17]: SD_D[3] */ + 18 1 /* MPP[18]: NF_IO[0] */ + 19 1 /* MPP[19]: NF_IO[1] */ + 29 1 >; /* MPP[29]: TSMP[9] */ + }; + + GPIO: gpio@10100 { + #gpio-cells = <3>; + compatible = "mrvl,gpio"; + reg = <0x10100 0x20>; + gpio-controller; + interrupts = <35 36 37 38 39 40 41>; + interrupt-parent = <&PIC>; + }; + + rtc@10300 { + compatible = "mrvl,rtc"; + reg = <0x10300 0x08>; + }; + + twsi@11000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "mrvl,twsi"; + reg = <0x11000 0x20>; + interrupts = <43>; + interrupt-parent = <&PIC>; + }; + + enet0: ethernet@72000 { + #address-cells = <1>; + #size-cells = <1>; + model = "V2"; + compatible = "mrvl,ge"; + reg = <0x72000 0x2000>; + ranges = <0x0 0x72000 0x2000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <12 13 14 11 46>; + interrupt-parent = <&PIC>; + phy-handle = <&phy0>; + + mdio@0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "mrvl,mdio"; + + phy0: ethernet-phy@0 { + reg = <0x0>; + }; + }; + }; + + serial0: serial@12000 { + compatible = "ns16550"; + reg = <0x12000 0x20>; + reg-shift = <2>; + clock-frequency = <0>; + interrupts = <33>; + interrupt-parent = <&PIC>; + }; + + serial1: serial@12100 { + compatible = "ns16550"; + reg = <0x12100 0x20>; + reg-shift = <2>; + clock-frequency = <0>; + interrupts = <34>; + interrupt-parent = <&PIC>; + }; + + crypto@30000 { + compatible = "mrvl,cesa"; + reg = <0x30000 0x10000>; + interrupts = <22>; + interrupt-parent = <&PIC>; + }; + + usb@50000 { + compatible = "mrvl,usb-ehci", "usb-ehci"; + reg = <0x50000 0x1000>; + interrupts = <48 19>; + interrupt-parent = <&PIC>; + }; + + xor@60000 { + compatible = "mrvl,xor"; + reg = <0x60000 0x1000>; + interrupts = <5 6 7 8>; + interrupt-parent = <&PIC>; + }; + }; + + SRAM: sram@fd000000 { + compatible = "mrvl,cesa-sram"; + reg = <0xfd000000 0x00100000>; + }; + + chosen { + stdin = "serial0"; + stdout = "serial0"; + }; +}; -- cgit v1.3 From bf74de7eba9648cb03fabb1b81157b58c9605614 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 8 Sep 2010 20:10:29 +0000 Subject: If autoboot_delay is set to -1, boot immediately without checking for a keypress to match the behavior of the loader. PR: docs/108101 Submitted by: Wayne Sierke ws of au.dyndns.ws Tested by: brd MFC after: 1 week --- sys/boot/forth/beastie.4th | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/boot') diff --git a/sys/boot/forth/beastie.4th b/sys/boot/forth/beastie.4th index c726875907fa..d96f5791e79f 100644 --- a/sys/boot/forth/beastie.4th +++ b/sys/boot/forth/beastie.4th @@ -240,7 +240,10 @@ set-current drop 10 else - 0 0 2swap >number drop drop drop + 2dup s" -1" compare 0= if + 0 boot + then + 0 s>d 2swap >number 2drop drop then begin dup tkey -- cgit v1.3 From e66811b19374a5a5387ce964fb003426ad92aa51 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Thu, 9 Sep 2010 21:15:16 +0000 Subject: Remove duplicated code. MFC after: 2 weeks --- sys/boot/zfs/zfsimpl.c | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/zfs/zfsimpl.c b/sys/boot/zfs/zfsimpl.c index e645ebaa6cd1..e7ed218d1819 100644 --- a/sys/boot/zfs/zfsimpl.c +++ b/sys/boot/zfs/zfsimpl.c @@ -488,7 +488,16 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vdev_t **vdevp, int is_newer) vdev->v_name = strdup(type); } } + } else { + is_new = 0; + } + if (is_new || is_newer) { + /* + * This is either new vdev or we've already seen this vdev, + * but from an older vdev label, so let's refresh its state + * from the newer label. + */ if (is_offline) vdev->v_state = VDEV_STATE_OFFLINE; else if (is_removed) @@ -499,26 +508,6 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vdev_t **vdevp, int is_newer) vdev->v_state = VDEV_STATE_DEGRADED; else vdev->v_state = VDEV_STATE_HEALTHY; - } else { - is_new = 0; - - if (is_newer) { - /* - * We've already seen this vdev, but from an older - * vdev label, so let's refresh its state from the - * newer label. - */ - if (is_offline) - vdev->v_state = VDEV_STATE_OFFLINE; - else if (is_removed) - vdev->v_state = VDEV_STATE_REMOVED; - else if (is_faulted) - vdev->v_state = VDEV_STATE_FAULTED; - else if (is_degraded) - vdev->v_state = VDEV_STATE_DEGRADED; - else - vdev->v_state = VDEV_STATE_HEALTHY; - } } rc = nvlist_find(nvlist, ZPOOL_CONFIG_CHILDREN, -- cgit v1.3 From c42f23013109ba7acb9b50745c403e79ed7c8b15 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Thu, 9 Sep 2010 21:18:00 +0000 Subject: Allow to boot from a pool within which replacing is in progress. Before the change it wasn't possible and the following error was printed: ZFS: can only boot from disk, mirror or raidz vdevs Now if the original vdev (the one we are replacing) is still present we will read from it, but if it is not present we won't read from the new vdev, as it might not have enough valid data yet. MFC after: 2 weeks --- sys/boot/zfs/zfsimpl.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/zfs/zfsimpl.c b/sys/boot/zfs/zfsimpl.c index e7ed218d1819..a4fd5bedabe6 100644 --- a/sys/boot/zfs/zfsimpl.c +++ b/sys/boot/zfs/zfsimpl.c @@ -376,6 +376,27 @@ vdev_mirror_read(vdev_t *vdev, const blkptr_t *bp, void *buf, return (rc); } +static int +vdev_replacing_read(vdev_t *vdev, const blkptr_t *bp, void *buf, + off_t offset, size_t bytes) +{ + vdev_t *kid; + + /* + * Here we should have two kids: + * First one which is the one we are replacing and we can trust + * only this one to have valid data, but it might not be present. + * Second one is that one we are replacing with. It is most likely + * healthy, but we can't trust it has needed data, so we won't use it. + */ + kid = STAILQ_FIRST(&vdev->v_children); + if (kid == NULL) + return (EIO); + if (kid->v_state != VDEV_STATE_HEALTHY) + return (EIO); + return (kid->v_read(kid, bp, buf, offset, bytes)); +} + static vdev_t * vdev_find(uint64_t guid) { @@ -416,7 +437,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vdev_t **vdevp, int is_newer) vdev_t *vdev, *kid; const unsigned char *kids; int nkids, i, is_new; - uint64_t is_offline, is_faulted, is_degraded, is_removed; + uint64_t is_offline, is_faulted, is_degraded, is_removed, isnt_present; if (nvlist_find(nvlist, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, 0, &guid) @@ -428,14 +449,17 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vdev_t **vdevp, int is_newer) return (ENOENT); } + + if (strcmp(type, VDEV_TYPE_MIRROR) && strcmp(type, VDEV_TYPE_DISK) - && strcmp(type, VDEV_TYPE_RAIDZ)) { + && strcmp(type, VDEV_TYPE_RAIDZ) + && strcmp(type, VDEV_TYPE_REPLACING)) { printf("ZFS: can only boot from disk, mirror or raidz vdevs\n"); return (EIO); } - is_offline = is_removed = is_faulted = is_degraded = 0; + is_offline = is_removed = is_faulted = is_degraded = isnt_present = 0; nvlist_find(nvlist, ZPOOL_CONFIG_OFFLINE, DATA_TYPE_UINT64, 0, &is_offline); @@ -445,6 +469,8 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vdev_t **vdevp, int is_newer) &is_faulted); nvlist_find(nvlist, ZPOOL_CONFIG_DEGRADED, DATA_TYPE_UINT64, 0, &is_degraded); + nvlist_find(nvlist, ZPOOL_CONFIG_NOT_PRESENT, DATA_TYPE_UINT64, 0, + &isnt_present); vdev = vdev_find(guid); if (!vdev) { @@ -454,6 +480,8 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vdev_t **vdevp, int is_newer) vdev = vdev_create(guid, vdev_mirror_read); else if (!strcmp(type, VDEV_TYPE_RAIDZ)) vdev = vdev_create(guid, vdev_raidz_read); + else if (!strcmp(type, VDEV_TYPE_REPLACING)) + vdev = vdev_create(guid, vdev_replacing_read); else vdev = vdev_create(guid, vdev_disk_read); @@ -506,6 +534,8 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vdev_t **vdevp, int is_newer) vdev->v_state = VDEV_STATE_FAULTED; else if (is_degraded) vdev->v_state = VDEV_STATE_DEGRADED; + else if (isnt_present) + vdev->v_state = VDEV_STATE_CANT_OPEN; else vdev->v_state = VDEV_STATE_HEALTHY; } -- cgit v1.3 From f60ec6d63d02ebc755a8c209ff7f8429ea649950 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Thu, 9 Sep 2010 21:19:09 +0000 Subject: Ignore log vdevs. MFC after: 2 weeks --- sys/boot/zfs/zfsimpl.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sys/boot') diff --git a/sys/boot/zfs/zfsimpl.c b/sys/boot/zfs/zfsimpl.c index a4fd5bedabe6..979424e6554c 100644 --- a/sys/boot/zfs/zfsimpl.c +++ b/sys/boot/zfs/zfsimpl.c @@ -773,6 +773,7 @@ vdev_probe(vdev_phys_read_t *read, void *read_priv, spa_t **spap) uint64_t val; uint64_t guid; uint64_t pool_txg, pool_guid; + uint64_t is_log; const char *pool_name; const unsigned char *vdevs; int i, rc, is_newer; @@ -849,6 +850,12 @@ vdev_probe(vdev_phys_read_t *read, void *read_priv, spa_t **spap) return (EIO); } + is_log = 0; + (void) nvlist_find(nvlist, ZPOOL_CONFIG_IS_LOG, DATA_TYPE_UINT64, 0, + &is_log); + if (is_log) + return (EIO); + /* * Create the pool if this is the first time we've seen it. */ -- cgit v1.3 From fc1b42b552106fd7724f5b5fc0e572888bc692b2 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Thu, 9 Sep 2010 21:32:09 +0000 Subject: Remove empty lines committed by accident. MFC after: 2 weeks --- sys/boot/zfs/zfsimpl.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/zfs/zfsimpl.c b/sys/boot/zfs/zfsimpl.c index 979424e6554c..f5eff6231d67 100644 --- a/sys/boot/zfs/zfsimpl.c +++ b/sys/boot/zfs/zfsimpl.c @@ -449,8 +449,6 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vdev_t **vdevp, int is_newer) return (ENOENT); } - - if (strcmp(type, VDEV_TYPE_MIRROR) && strcmp(type, VDEV_TYPE_DISK) && strcmp(type, VDEV_TYPE_RAIDZ) -- cgit v1.3 From fe198baaa646b07b3172f15bd1e19cb9197a70c1 Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Thu, 16 Sep 2010 12:05:00 +0000 Subject: Merge from powerpc: - Change putc_func_t to use a char instead of an int for the character. - Make functions and variables not used outside of this source file static. - Remove unused prototypes and variables. - The OFW read and seek methods take 3 and not 4 input arguments. --- sys/boot/sparc64/boot1/boot1.c | 60 +++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 33 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/sparc64/boot1/boot1.c b/sys/boot/sparc64/boot1/boot1.c index 813da29f4ecf..6b9fa30ace4e 100644 --- a/sys/boot/sparc64/boot1/boot1.c +++ b/sys/boot/sparc64/boot1/boot1.c @@ -26,9 +26,7 @@ __FBSDID("$FreeBSD$"); #define _PATH_LOADER "/boot/loader" #define _PATH_KERNEL "/boot/kernel/kernel" -#define BSIZEMAX 16384 - -typedef int putc_func_t(int c, void *arg); +typedef int putc_func_t(char c, void *arg); typedef int32_t ofwh_t; struct sp_data { @@ -44,11 +42,6 @@ static char bootargs[128]; static ofwh_t bootdev; -static struct fs fs; -static ino_t inomap; -static char blkbuf[BSIZEMAX]; -static unsigned int fsblks; - static uint32_t fs_off; int main(int ac, char **av); @@ -66,14 +59,13 @@ static int mount(const char *device); static void panic(const char *fmt, ...) __dead2; static int printf(const char *fmt, ...); -static int putchar(int c, void *arg); +static int putchar(char c, void *arg); static int vprintf(const char *fmt, va_list ap); static int vsnprintf(char *str, size_t sz, const char *fmt, va_list ap); static int __printf(const char *fmt, putc_func_t *putc, void *arg, va_list ap); -static int __putc(int c, void *arg); static int __puts(const char *s, putc_func_t *putc, void *arg); -static int __sputc(int c, void *arg); +static int __sputc(char c, void *arg); static char *__uitoa(char *buf, u_int val, int base); static char *__ultoa(char *buf, u_long val, int base); @@ -83,19 +75,18 @@ static char *__ultoa(char *buf, u_long val, int base); typedef u_int64_t ofwcell_t; typedef u_int32_t u_ofwh_t; typedef int (*ofwfp_t)(ofwcell_t []); -ofwfp_t ofw; /* the prom Open Firmware entry */ +static ofwfp_t ofw; /* the PROM Open Firmware entry */ void ofw_init(int, int, int, int, ofwfp_t); -ofwh_t ofw_finddevice(const char *); -ofwh_t ofw_open(const char *); -int ofw_getprop(ofwh_t, const char *, void *, size_t); -int ofw_read(ofwh_t, void *, size_t); -int ofw_write(ofwh_t, const void *, size_t); -int ofw_seek(ofwh_t, u_int64_t); -void ofw_exit(void) __dead2; +static ofwh_t ofw_finddevice(const char *); +static ofwh_t ofw_open(const char *); +static int ofw_getprop(ofwh_t, const char *, void *, size_t); +static int ofw_read(ofwh_t, void *, size_t); +static int ofw_write(ofwh_t, const void *, size_t); +static int ofw_seek(ofwh_t, u_int64_t); +static void ofw_exit(void) __dead2; -ofwh_t bootdevh; -ofwh_t stdinh, stdouth; +static ofwh_t stdinh, stdouth; /* * This has to stay here, as the PROM seems to ignore the @@ -138,7 +129,7 @@ ofw_init(int d, int d1, int d2, int d3, ofwfp_t ofwaddr) exit(main(ac, av)); } -ofwh_t +static ofwh_t ofw_finddevice(const char *name) { ofwcell_t args[] = { @@ -156,7 +147,7 @@ ofw_finddevice(const char *name) return (args[4]); } -int +static int ofw_getprop(ofwh_t ofwh, const char *name, void *buf, size_t len) { ofwcell_t args[] = { @@ -178,7 +169,7 @@ ofw_getprop(ofwh_t ofwh, const char *name, void *buf, size_t len) return (0); } -ofwh_t +static ofwh_t ofw_open(const char *path) { ofwcell_t args[] = { @@ -196,7 +187,7 @@ ofw_open(const char *path) return (args[4]); } -int +static int ofw_close(ofwh_t devh) { ofwcell_t args[] = { @@ -213,12 +204,12 @@ ofw_close(ofwh_t devh) return (0); } -int +static int ofw_read(ofwh_t devh, void *buf, size_t len) { ofwcell_t args[] = { (ofwcell_t)"read", - 4, + 3, 1, (u_ofwh_t)devh, (ofwcell_t)buf, @@ -233,7 +224,7 @@ ofw_read(ofwh_t devh, void *buf, size_t len) return (0); } -int +static int ofw_write(ofwh_t devh, const void *buf, size_t len) { ofwcell_t args[] = { @@ -253,12 +244,12 @@ ofw_write(ofwh_t devh, const void *buf, size_t len) return (0); } -int +static int ofw_seek(ofwh_t devh, u_int64_t off) { ofwcell_t args[] = { (ofwcell_t)"seek", - 4, + 3, 1, (u_ofwh_t)devh, off >> 32, @@ -273,7 +264,7 @@ ofw_seek(ofwh_t devh, u_int64_t off) return (0); } -void +static void ofw_exit(void) { ofwcell_t args[3]; @@ -299,6 +290,7 @@ bcopy(const void *src, void *dst, size_t len) static void memcpy(void *dst, const void *src, size_t len) { + bcopy(src, dst, len); } @@ -314,6 +306,7 @@ bzero(void *b, size_t len) static int strcmp(const char *s1, const char *s2) { + for (; *s1 == *s2 && *s1; s1++, s2++) ; return ((u_char)*s1 - (u_char)*s2); @@ -431,6 +424,7 @@ load(const char *fname) static int dskread(void *buf, u_int64_t lba, int nblk) { + /* * The Open Firmware should open the correct partition for us. * That means, if we read from offset zero on an open instance handle, @@ -468,7 +462,7 @@ printf(const char *fmt, ...) } static int -putchar(int c, void *arg) +putchar(char c, void *arg) { char buf; @@ -614,7 +608,7 @@ reswitch: c = *fmt++; } static int -__sputc(int c, void *arg) +__sputc(char c, void *arg) { struct sp_data *sp; -- cgit v1.3 From 701c50988f905a1d27d253b34be714db05043c70 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Fri, 17 Sep 2010 22:51:45 +0000 Subject: Remove magic value. --- sys/boot/zfs/zfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/boot') diff --git a/sys/boot/zfs/zfs.c b/sys/boot/zfs/zfs.c index 5aec76676f16..a995f574f7ba 100644 --- a/sys/boot/zfs/zfs.c +++ b/sys/boot/zfs/zfs.c @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include "zfsimpl.c" +#define MAXBDDEV 31 + static int zfs_open(const char *path, struct open_file *f); static int zfs_write(struct open_file *f, void *buf, size_t size, size_t *resid); static int zfs_close(struct open_file *f); @@ -402,7 +404,7 @@ zfs_dev_init(void) * diskN, diskNpM or diskNsM. */ zfs_init(); - for (unit = 0; unit < 32 /* XXX */; unit++) { + for (unit = 0; unit < MAXBDDEV; unit++) { sprintf(devname, "disk%d:", unit); fd = open(devname, O_RDONLY); if (fd == -1) -- cgit v1.3 From 1d09a9b99983e4e80915bd59a98e91778c6a0645 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Fri, 17 Sep 2010 22:59:15 +0000 Subject: Before VirtualBox is fixed, mark with #ifdef what has to be done to make it possible to boot from ZFS RAIDZ for example from within VirtualBox. The problem with VirtualBox is that its BIOS reports only one disk present. If we choose to ignore this report, we can find all the disks available. We can't have this work-around to be turned on by default, because some broken BIOSes report true when it comes to number of disks, but present the same disk multiple times. --- sys/boot/i386/libi386/biosdisk.c | 4 +++- sys/boot/i386/zfsboot/zfsboot.c | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/i386/libi386/biosdisk.c b/sys/boot/i386/libi386/biosdisk.c index cf0b03353ea7..a67a7ef9a882 100644 --- a/sys/boot/i386/libi386/biosdisk.c +++ b/sys/boot/i386/libi386/biosdisk.c @@ -214,10 +214,12 @@ bd_init(void) /* sequence 0, 0x80 */ for (base = 0; base <= 0x80; base += 0x80) { for (unit = base; (nbdinfo < MAXBDDEV); unit++) { +#ifndef VIRTUALBOX /* check the BIOS equipment list for number of fixed disks */ if((base == 0x80) && (nfd >= *(unsigned char *)PTOV(BIOS_NUMDRIVES))) - break; + break; +#endif bdinfo[nbdinfo].bd_unit = unit; bdinfo[nbdinfo].bd_flags = (unit < 0x80) ? BD_FLOPPY : 0; diff --git a/sys/boot/i386/zfsboot/zfsboot.c b/sys/boot/i386/zfsboot/zfsboot.c index b6e5f0cfc7c4..c6ef699a4809 100644 --- a/sys/boot/i386/zfsboot/zfsboot.c +++ b/sys/boot/i386/zfsboot/zfsboot.c @@ -94,7 +94,7 @@ __FBSDID("$FreeBSD$"); #define V86_CY(x) ((x) & 1) #define V86_ZR(x) ((x) & 0x40) -#define BIOS_NUMDRIVES 0x475 +#define BIOS_NUMDRIVES 0x475 #define DRV_HARD 0x80 #define DRV_MASK 0x7f @@ -667,7 +667,12 @@ main(void) * will find any other available pools and it may fill in missing * vdevs for the boot pool. */ - for (i = 0; i < *(unsigned char *)PTOV(BIOS_NUMDRIVES); i++) { +#ifndef VIRTUALBOX + for (i = 0; i < *(unsigned char *)PTOV(BIOS_NUMDRIVES); i++) +#else + for (i = 0; i < MAXBDDEV; i++) +#endif + { if ((i | DRV_HARD) == *(uint8_t *)PTOV(ARGS)) continue; -- cgit v1.3 From cbf4dac64f01f5a2e89ddf0d07ada0f734a73a4b Mon Sep 17 00:00:00 2001 From: Norikatsu Shigemura Date: Sun, 19 Sep 2010 14:40:37 +0000 Subject: Add support 'device tpm' for amd64. Add tpm(4)'s default setting to /boot/defaults/loader.conf. Add 'device tpm' to NOTES for amd64 and i386. Discussed with: takawata Approved by: imp (mentor) --- sys/amd64/conf/NOTES | 2 ++ sys/boot/forth/loader.conf | 1 + sys/conf/files.amd64 | 3 +++ sys/i386/conf/NOTES | 2 ++ 4 files changed, 8 insertions(+) (limited to 'sys/boot') diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES index 67fbcd7460ec..e69e4ad8890a 100644 --- a/sys/amd64/conf/NOTES +++ b/sys/amd64/conf/NOTES @@ -421,6 +421,7 @@ options SAFE_RNDTEST # enable rndtest support # vpd: Vital Product Data kernel interface # asmc: Apple System Management Controller # si: Specialix International SI/XIO or SX intelligent serial card +# tpm: Trusted Platform Module # Notes on the Specialix SI/XIO driver: # The host card is memory, not IO mapped. @@ -436,6 +437,7 @@ device smbios device vpd device asmc #device si +device tpm # # Laptop/Notebook options: diff --git a/sys/boot/forth/loader.conf b/sys/boot/forth/loader.conf index eac8fe6886d6..4f07b912178b 100644 --- a/sys/boot/forth/loader.conf +++ b/sys/boot/forth/loader.conf @@ -473,6 +473,7 @@ vkbd_load="NO" # Virtual AT keyboard interface vpd_load="NO" # Vital Product Data kernel interface vpo_load="NO" # Parallel to SCSI interface driver amdtemp_load="NO" # AMD K8/K10/K11 temperature monitor +tpm_load="NO" # Trusted Platform Module ############################################################## ### ACPI settings ########################################## diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 727a1027d9a1..ec7ffb554623 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -229,6 +229,9 @@ dev/syscons/scterm-teken.c optional sc dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga dev/syscons/scvtb.c optional sc +dev/tpm/tpm.c optional tpm +dev/tpm/tpm_acpi.c optional tpm acpi +dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_amd64.c optional uart dev/wpi/if_wpi.c optional wpi isa/syscons_isa.c optional sc diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index b4f8ee80bc81..a68037bb2f63 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -751,6 +751,7 @@ device glxsb # AMD Geode LX Security Block # spic: Sony Programmable I/O controller (VAIO notebooks) # asmc: Apple System Management Controller # si: Specialix International SI/XIO or SX intelligent serial card driver +# tpm: Trusted Platform Module # Notes on APM # The flags takes the following meaning for apm0: @@ -789,6 +790,7 @@ hint.spic.0.at="isa" hint.spic.0.port="0x10a0" device asmc #device si +device tpm # # Laptop/Notebook options: -- cgit v1.3 From d20525351505edbd0bb87faaa101dd42f512ed90 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 21 Sep 2010 21:41:45 +0000 Subject: When building world with clang, for gnu/lib/libobjc, sys/boot/i386/boot2 and sys/boot/pc98/boot2, do not simply assign 'gcc' to CC, since compile flags are sometimes passed via this variable, for example during the build32 stage on amd64. This caused the 32-bit libobjc build on amd64 to fail. Instead, only replace the first instance of clang (if any, including optional path) with gcc, and leave the arguments alone. Approved-by: rpaulo (mentor) --- gnu/lib/libobjc/Makefile | 4 +--- sys/boot/i386/boot2/Makefile | 4 +--- sys/boot/pc98/boot2/Makefile | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) (limited to 'sys/boot') diff --git a/gnu/lib/libobjc/Makefile b/gnu/lib/libobjc/Makefile index 3513103f2d7c..80d0240356e2 100644 --- a/gnu/lib/libobjc/Makefile +++ b/gnu/lib/libobjc/Makefile @@ -16,9 +16,7 @@ SRCS= archive.c class.c encoding.c gc.c hash.c init.c linking.m misc.c \ selector.c sendmsg.c thr.c thr-objc.c exception.c # XXX: clang cannot compile libobjc yet -.if ${CC:T:Mclang} == "clang" -CC=gcc -.endif +CC:=${CC:C/^(.*\/)?clang$/gcc/1} INCS= encoding.h hash.h objc-api.h objc-decls.h objc-list.h objc.h runtime.h \ sarray.h thr.h typedstream.h NXConstStr.h Object.h Protocol.h diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile index 74aab82de43b..b91a43bccc4e 100644 --- a/sys/boot/i386/boot2/Makefile +++ b/sys/boot/i386/boot2/Makefile @@ -3,9 +3,7 @@ .include # XXX: clang can compile the boot code just fine, but boot2 gets too big -.if ${CC:T:Mclang} == "clang" -CC=gcc -.endif +CC:=${CC:C/^(.*\/)?clang$/gcc/1} FILES= boot boot1 boot2 diff --git a/sys/boot/pc98/boot2/Makefile b/sys/boot/pc98/boot2/Makefile index 5f7355fd7838..dfd8607510c2 100644 --- a/sys/boot/pc98/boot2/Makefile +++ b/sys/boot/pc98/boot2/Makefile @@ -3,9 +3,7 @@ .include # XXX: clang can compile the boot code just fine, but boot2 gets too big -.if ${CC:T:Mclang} == "clang" -CC=gcc -.endif +CC:=${CC:C/^(.*\/)?clang$/gcc/1} FILES= boot boot1 boot2 -- cgit v1.3 From a0e2fdedd1b50169d0ddf69186abb77b7b2f9859 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Fri, 24 Sep 2010 19:49:12 +0000 Subject: - Split code shared by almost any boot loader into separate files and clean up most layering violations: sys/boot/i386/common/rbx.h: RBX_* defines OPT_SET() OPT_CHECK() sys/boot/common/util.[ch]: memcpy() memset() memcmp() bcpy() bzero() bcmp() strcmp() strncmp() [new] strcpy() strcat() strchr() strlen() printf() sys/boot/i386/common/cons.[ch]: ioctrl putc() xputc() putchar() getc() xgetc() keyhit() [now takes number of seconds as an argument] getstr() sys/boot/i386/common/drv.[ch]: struct dsk drvread() drvwrite() [new] drvsize() [new] sys/boot/common/crc32.[ch] [new] sys/boot/common/gpt.[ch] [new] - Teach gptboot and gptzfsboot about new files. I haven't touched the rest, but there is still a lot of code duplication to be removed. - Implement full GPT support. Currently we just read primary header and partition table and don't care about checksums, etc. After this change we verify checksums of primary header and primary partition table and if there is a problem we fall back to backup header and backup partition table. - Clean up most messages to use prefix of boot program, so in case of an error we know where the error comes from, eg.: gptboot: unable to read primary GPT header - If we can't boot, print boot prompt only once and not every five seconds. - Honour newly added GPT attributes: bootme - this is bootable partition bootonce - try to boot from this partition only once bootfailed - we failed to boot from this partition - Change boot order of gptboot to the following: 1. Try to boot from all the partitions that have both 'bootme' and 'bootonce' attributes one by one. 2. Try to boot from all the partitions that have only 'bootme' attribute one by one. 3. If there are no partitions with 'bootme' attribute, boot from the first UFS partition. - The 'bootonce' functionality is implemented in the following way: 1. Walk through all the partitions and when 'bootonce' attribute is found without 'bootme' attribute, remove 'bootonce' attribute and set 'bootfailed' attribute. 'bootonce' attribute alone means that we tried to boot from this partition, but boot failed after leaving gptboot and machine was restarted. 2. Find partition with both 'bootme' and 'bootonce' attributes. 3. Remove 'bootme' attribute. 4. Try to execute /boot/loader or /boot/kernel/kernel from that partition. If succeeded we stop here. 5. If execution failed, remove 'bootonce' and set 'bootfailed'. 6. Go to 2. If whole boot succeeded there is new /etc/rc.d/gptboot script coming that will log all partitions that we failed to boot from (the ones with 'bootfailed' attribute) and will remove this attribute. It will also find partition with 'bootonce' attribute - this is the partition we booted from successfully. The script will log success and remove the attribute. All the GPT updates we do here goes to both primary and backup GPT if they are valid. We don't touch headers or partition tables when checksum doesn't match. Reviewed by: arch (Message-ID: <20100917234542.GE1902@garage.freebsd.pl>) Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com MFC after: 2 weeks --- sys/boot/common/crc32.c | 108 +++++++ sys/boot/common/crc32.h | 13 + sys/boot/common/gpt.c | 381 +++++++++++++++++++++++++ sys/boot/common/gpt.h | 39 +++ sys/boot/common/util.c | 176 ++++++++++++ sys/boot/common/util.h | 53 ++++ sys/boot/i386/common/cons.c | 152 ++++++++++ sys/boot/i386/common/cons.h | 34 +++ sys/boot/i386/common/drv.c | 131 +++++++++ sys/boot/i386/common/drv.h | 48 ++++ sys/boot/i386/common/rbx.h | 61 ++++ sys/boot/i386/gptboot/Makefile | 13 +- sys/boot/i386/gptboot/gptboot.c | 580 ++++++++++---------------------------- sys/boot/i386/gptzfsboot/Makefile | 10 +- sys/boot/i386/zfsboot/Makefile | 17 +- sys/boot/i386/zfsboot/zfsboot.c | 419 +-------------------------- sys/boot/zfs/Makefile | 1 + sys/boot/zfs/zfsimpl.c | 11 +- 18 files changed, 1383 insertions(+), 864 deletions(-) create mode 100644 sys/boot/common/crc32.c create mode 100644 sys/boot/common/crc32.h create mode 100644 sys/boot/common/gpt.c create mode 100644 sys/boot/common/gpt.h create mode 100644 sys/boot/common/util.c create mode 100644 sys/boot/common/util.h create mode 100644 sys/boot/i386/common/cons.c create mode 100644 sys/boot/i386/common/cons.h create mode 100644 sys/boot/i386/common/drv.c create mode 100644 sys/boot/i386/common/drv.h create mode 100644 sys/boot/i386/common/rbx.h (limited to 'sys/boot') diff --git a/sys/boot/common/crc32.c b/sys/boot/common/crc32.c new file mode 100644 index 000000000000..032517993a49 --- /dev/null +++ b/sys/boot/common/crc32.c @@ -0,0 +1,108 @@ +/*- + * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or + * code or tables extracted from it, as desired without restriction. + */ + +/* + * First, the polynomial itself and its table of feedback terms. The + * polynomial is + * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 + * + * Note that we take it "backwards" and put the highest-order term in + * the lowest-order bit. The X^32 term is "implied"; the LSB is the + * X^31 term, etc. The X^0 term (usually shown as "+1") results in + * the MSB being 1 + * + * Note that the usual hardware shift register implementation, which + * is what we're using (we're merely optimizing it by doing eight-bit + * chunks at a time) shifts bits into the lowest-order term. In our + * implementation, that means shifting towards the right. Why do we + * do it this way? Because the calculated CRC must be transmitted in + * order from highest-order term to lowest-order term. UARTs transmit + * characters in order from LSB to MSB. By storing the CRC this way + * we hand it to the UART in the order low-byte to high-byte; the UART + * sends each low-bit to hight-bit; and the result is transmission bit + * by bit from highest- to lowest-order term without requiring any bit + * shuffling on our part. Reception works similarly + * + * The feedback terms table consists of 256, 32-bit entries. Notes + * + * The table can be generated at runtime if desired; code to do so + * is shown later. It might not be obvious, but the feedback + * terms simply represent the results of eight shift/xor opera + * tions for all combinations of data and CRC register values + * + * The values must be right-shifted by eight bits by the "updcrc + * logic; the shift must be unsigned (bring in zeroes). On some + * hardware you could probably optimize the shift in assembler by + * using byte-swap instructions + * polynomial $edb88320 + * + * + * CRC32 code derived from work by Gary S. Brown. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include "crc32.h" + +static uint32_t crc32_tab[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, + 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, + 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, + 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, + 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, + 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, + 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, + 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, + 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, + 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, + 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, + 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, + 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, + 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, + 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, + 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, + 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, + 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d +}; + +uint32_t +crc32(const void *buf, size_t size) +{ + const uint8_t *p = buf; + uint32_t crc; + + crc = ~0U; + while (size--) + crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); + return (crc ^ ~0U); +} diff --git a/sys/boot/common/crc32.h b/sys/boot/common/crc32.h new file mode 100644 index 000000000000..adfd628671aa --- /dev/null +++ b/sys/boot/common/crc32.h @@ -0,0 +1,13 @@ +/*- + * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or + * code or tables extracted from it, as desired without restriction. + * + * $FreeBSD$ + */ + +#ifndef _CRC32_H_ +#define _CRC32_H_ + +uint32_t crc32(const void *buf, size_t size); + +#endif /* !_CRC32_H_ */ diff --git a/sys/boot/common/gpt.c b/sys/boot/common/gpt.c new file mode 100644 index 000000000000..62e86ddded8b --- /dev/null +++ b/sys/boot/common/gpt.c @@ -0,0 +1,381 @@ +/*- + * Copyright (c) 2010 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifndef LITTLE_ENDIAN +#error gpt.c works only for little endian architectures +#endif + +#include "crc32.h" +#include "drv.h" +#include "util.h" +#include "gpt.h" + +#define MAXTBLENTS 128 + +static struct gpt_hdr hdr_primary, hdr_backup, *gpthdr; +static uint64_t hdr_primary_lba, hdr_backup_lba; +static struct gpt_ent table_primary[MAXTBLENTS], table_backup[MAXTBLENTS]; +static struct gpt_ent *gpttable; +static int curent, bootonce; + +/* + * Buffer below 64kB passed on gptread(), which can hold at least + * one sector od data (512 bytes). + */ +static char *secbuf; + +static void +gptupdate(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, + struct gpt_ent *table) +{ + int entries_per_sec, firstent; + daddr_t slba; + + /* + * We need to update the following for both primary and backup GPT: + * 1. Sector on disk that contains curent partition. + * 2. Partition table checksum. + * 3. Header checksum. + * 4. Header on disk. + */ + + entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; + slba = curent / entries_per_sec; + firstent = slba * entries_per_sec; + bcpy(&table[firstent], secbuf, DEV_BSIZE); + slba += hdr->hdr_lba_table; + if (drvwrite(dskp, secbuf, slba, 1)) { + printf("%s: unable to update %s GPT partition table\n", + BOOTPROG, which); + return; + } + hdr->hdr_crc_table = crc32(table, hdr->hdr_entries * hdr->hdr_entsz); + hdr->hdr_crc_self = 0; + hdr->hdr_crc_self = crc32(hdr, hdr->hdr_size); + bzero(secbuf, DEV_BSIZE); + bcpy(hdr, secbuf, hdr->hdr_size); + if (drvwrite(dskp, secbuf, hdr->hdr_lba_self, 1)) { + printf("%s: unable to update %s GPT header\n", BOOTPROG, which); + return; + } +} + +int +gptfind(const uuid_t *uuid, struct dsk *dskp, int part) +{ + struct gpt_ent *ent; + int firsttry; + + if (part >= 0) { + if (part == 0 || part > gpthdr->hdr_entries) { + printf("%s: invalid partition index\n", BOOTPROG); + return (-1); + } + ent = &gpttable[part - 1]; + if (bcmp(&ent->ent_type, uuid, sizeof(uuid_t)) != 0) { + printf("%s: specified partition is not UFS\n", + BOOTPROG); + return (-1); + } + curent = part - 1; + goto found; + } + + firsttry = (curent == -1); + curent++; + if (curent >= gpthdr->hdr_entries) { + curent = gpthdr->hdr_entries; + return (-1); + } + if (bootonce) { + /* + * First look for partition with both GPT_ENT_ATTR_BOOTME and + * GPT_ENT_ATTR_BOOTONCE flags. + */ + for (; curent < gpthdr->hdr_entries; curent++) { + ent = &gpttable[curent]; + if (bcmp(&ent->ent_type, uuid, sizeof(uuid_t)) != 0) + continue; + if (!(ent->ent_attr & GPT_ENT_ATTR_BOOTME)) + continue; + if (!(ent->ent_attr & GPT_ENT_ATTR_BOOTONCE)) + continue; + /* Ok, found one. */ + goto found; + } + bootonce = 0; + curent = 0; + } + for (; curent < gpthdr->hdr_entries; curent++) { + ent = &gpttable[curent]; + if (bcmp(&ent->ent_type, uuid, sizeof(uuid_t)) != 0) + continue; + if (!(ent->ent_attr & GPT_ENT_ATTR_BOOTME)) + continue; + if (ent->ent_attr & GPT_ENT_ATTR_BOOTONCE) + continue; + /* Ok, found one. */ + goto found; + } + if (firsttry) { + /* + * No partition with BOOTME flag was found, try to boot from + * first UFS partition. + */ + for (curent = 0; curent < gpthdr->hdr_entries; curent++) { + ent = &gpttable[curent]; + if (bcmp(&ent->ent_type, uuid, sizeof(uuid_t)) != 0) + continue; + /* Ok, found one. */ + goto found; + } + } + return (-1); +found: + dskp->part = curent + 1; + ent = &gpttable[curent]; + dskp->start = ent->ent_lba_start; + if (ent->ent_attr & GPT_ENT_ATTR_BOOTONCE) { + /* + * Clear BOOTME, but leave BOOTONCE set before trying to + * boot from this partition. + */ + if (hdr_primary_lba > 0) { + table_primary[curent].ent_attr &= ~GPT_ENT_ATTR_BOOTME; + gptupdate("primary", dskp, &hdr_primary, table_primary); + } + if (hdr_backup_lba > 0) { + table_backup[curent].ent_attr &= ~GPT_ENT_ATTR_BOOTME; + gptupdate("backup", dskp, &hdr_backup, table_backup); + } + } + return (0); +} + +static int +gptread_hdr(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, + uint64_t hdrlba) +{ + uint32_t crc; + + if (drvread(dskp, secbuf, hdrlba, 1)) { + printf("%s: unable to read %s GPT header\n", BOOTPROG, which); + return (-1); + } + bcpy(secbuf, hdr, sizeof(*hdr)); + if (bcmp(hdr->hdr_sig, GPT_HDR_SIG, sizeof(hdr->hdr_sig)) != 0 || + hdr->hdr_lba_self != hdrlba || hdr->hdr_revision < 0x00010000 || + hdr->hdr_entsz < sizeof(struct gpt_ent) || + hdr->hdr_entries > MAXTBLENTS || DEV_BSIZE % hdr->hdr_entsz != 0) { + printf("%s: invalid %s GPT header\n", BOOTPROG, which); + return (-1); + } + crc = hdr->hdr_crc_self; + hdr->hdr_crc_self = 0; + if (crc32(hdr, hdr->hdr_size) != crc) { + printf("%s: %s GPT header checksum mismatch\n", BOOTPROG, + which); + return (-1); + } + hdr->hdr_crc_self = crc; + return (0); +} + +void +gptbootfailed(struct dsk *dskp) +{ + + if (!(gpttable[curent].ent_attr & GPT_ENT_ATTR_BOOTONCE)) + return; + + if (hdr_primary_lba > 0) { + table_primary[curent].ent_attr &= ~GPT_ENT_ATTR_BOOTONCE; + table_primary[curent].ent_attr |= GPT_ENT_ATTR_BOOTFAILED; + gptupdate("primary", dskp, &hdr_primary, table_primary); + } + if (hdr_backup_lba > 0) { + table_backup[curent].ent_attr &= ~GPT_ENT_ATTR_BOOTONCE; + table_backup[curent].ent_attr |= GPT_ENT_ATTR_BOOTFAILED; + gptupdate("backup", dskp, &hdr_backup, table_backup); + } +} + +static void +gptbootconv(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, + struct gpt_ent *table) +{ + struct gpt_ent *ent; + daddr_t slba; + int table_updated, sector_updated; + int entries_per_sec, nent, part; + + table_updated = 0; + entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; + for (nent = 0, slba = hdr->hdr_lba_table; + slba < hdr->hdr_lba_table + hdr->hdr_entries / entries_per_sec; + slba++, nent += entries_per_sec) { + sector_updated = 0; + for (part = 0; part < entries_per_sec; part++) { + ent = &table[nent + part]; + if ((ent->ent_attr & (GPT_ENT_ATTR_BOOTME | + GPT_ENT_ATTR_BOOTONCE | + GPT_ENT_ATTR_BOOTFAILED)) != + GPT_ENT_ATTR_BOOTONCE) { + continue; + } + ent->ent_attr &= ~GPT_ENT_ATTR_BOOTONCE; + ent->ent_attr |= GPT_ENT_ATTR_BOOTFAILED; + table_updated = 1; + sector_updated = 1; + } + if (!sector_updated) + continue; + bcpy(&table[nent], secbuf, DEV_BSIZE); + if (drvwrite(dskp, secbuf, slba, 1)) { + printf("%s: unable to update %s GPT partition table\n", + BOOTPROG, which); + } + } + if (!table_updated) + return; + hdr->hdr_crc_table = crc32(table, hdr->hdr_entries * hdr->hdr_entsz); + hdr->hdr_crc_self = 0; + hdr->hdr_crc_self = crc32(hdr, hdr->hdr_size); + bzero(secbuf, DEV_BSIZE); + bcpy(hdr, secbuf, hdr->hdr_size); + if (drvwrite(dskp, secbuf, hdr->hdr_lba_self, 1)) + printf("%s: unable to update %s GPT header\n", BOOTPROG, which); +} + +static int +gptread_table(const char *which, const uuid_t *uuid, struct dsk *dskp, + struct gpt_hdr *hdr, struct gpt_ent *table) +{ + struct gpt_ent *ent; + int entries_per_sec; + int part, nent; + daddr_t slba; + + if (hdr->hdr_entries == 0) + return (0); + + entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; + slba = hdr->hdr_lba_table; + nent = 0; + for (;;) { + if (drvread(dskp, secbuf, slba, 1)) { + printf("%s: unable to read %s GPT partition table\n", + BOOTPROG, which); + return (-1); + } + ent = (struct gpt_ent *)secbuf; + for (part = 0; part < entries_per_sec; part++, ent++) { + bcpy(ent, &table[nent], sizeof(table[nent])); + if (++nent >= hdr->hdr_entries) + break; + } + if (nent >= hdr->hdr_entries) + break; + slba++; + } + if (crc32(table, nent * hdr->hdr_entsz) != hdr->hdr_crc_table) { + printf("%s: %s GPT table checksum mismatch\n", BOOTPROG, which); + return (-1); + } + return (0); +} + +int +gptread(const uuid_t *uuid, struct dsk *dskp, char *buf) +{ + uint64_t altlba; + + /* + * Read and verify both GPT headers: primary and backup. + */ + + secbuf = buf; + hdr_primary_lba = hdr_backup_lba = 0; + curent = -1; + bootonce = 1; + dskp->start = 0; + + if (gptread_hdr("primary", dskp, &hdr_primary, 1) == 0 && + gptread_table("primary", uuid, dskp, &hdr_primary, + table_primary) == 0) { + hdr_primary_lba = hdr_primary.hdr_lba_self; + gpthdr = &hdr_primary; + gpttable = table_primary; + } + + altlba = drvsize(dskp); + if (altlba > 0) + altlba--; + else if (hdr_primary_lba > 0) { + /* + * If we cannot obtain disk size, but primary header + * is valid, we can get backup header location from + * there. + */ + altlba = hdr_primary.hdr_lba_alt; + } + if (altlba == 0) + printf("%s: unable to locate backup GPT header\n", BOOTPROG); + else if (gptread_hdr("backup", dskp, &hdr_backup, altlba) == 0 && + gptread_table("backup", uuid, dskp, &hdr_backup, + table_backup) == 0) { + hdr_backup_lba = hdr_backup.hdr_lba_self; + if (hdr_primary_lba == 0) { + gpthdr = &hdr_backup; + gpttable = table_backup; + printf("%s: using backup GPT\n", BOOTPROG); + } + } + + /* + * Convert all BOOTONCE without BOOTME flags into BOOTFAILED. + * BOOTONCE without BOOTME means that we tried to boot from it, + * but failed after leaving gptboot and machine was rebooted. + * We don't want to leave partitions marked as BOOTONCE only, + * because when we boot successfully start-up scripts should + * find at most one partition with only BOOTONCE flag and this + * will mean that we booted from that partition. + */ + if (hdr_primary_lba != 0) + gptbootconv("primary", dskp, &hdr_primary, table_primary); + if (hdr_backup_lba != 0) + gptbootconv("backup", dskp, &hdr_backup, table_backup); + + if (hdr_primary_lba == 0 && hdr_backup_lba == 0) + return (-1); + return (0); +} diff --git a/sys/boot/common/gpt.h b/sys/boot/common/gpt.h new file mode 100644 index 000000000000..c42b40de8a3f --- /dev/null +++ b/sys/boot/common/gpt.h @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2010 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _GPT_H_ +#define _GPT_H_ + +#include +#include + +int gptread(const uuid_t *uuid, struct dsk *dskp, char *buf); +int gptfind(const uuid_t *uuid, struct dsk *dskp, int part); +void gptbootfailed(struct dsk *dskp); + +#endif /* !_GPT_H_ */ diff --git a/sys/boot/common/util.c b/sys/boot/common/util.c new file mode 100644 index 000000000000..012106aef8ac --- /dev/null +++ b/sys/boot/common/util.c @@ -0,0 +1,176 @@ +/*- + * Copyright (c) 1998 Robert Nordier + * Copyright (c) 2010 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +#include "cons.h" +#include "util.h" + +void +memcpy(void *dst, const void *src, int len) +{ + const char *s = src; + char *d = dst; + + while (len--) + *d++ = *s++; +} + +void +memset(void *b, int c, size_t len) +{ + char *bp = b; + + while (len--) + *bp++ = (unsigned char)c; +} + +int +memcmp(const void *b1, const void *b2, size_t len) +{ + const unsigned char *p1, *p2; + + for (p1 = b1, p2 = b2; len > 0; len--, p1++, p2++) { + if (*p1 != *p2) + return ((*p1) - (*p2)); + } + return (0); +} + +int +strcmp(const char *s1, const char *s2) +{ + + for (; *s1 == *s2 && *s1 != '\0'; s1++, s2++) + ; + return ((unsigned char)*s1 - (unsigned char)*s2); +} + +int +strncmp(const char *s1, const char *s2, size_t len) +{ + + for (; *s1 == *s2 && *s1 != '\0' && len > 0; len--, s1++, s2++) + ; + return ((unsigned char)*s1 - (unsigned char)*s2); +} + +void +strcpy(char *dst, const char *src) +{ + + while (*src != '\0') + *dst++ = *src++; + *dst = '\0'; +} + +void +strcat(char *dst, const char *src) +{ + + while (*dst != '\0') + dst++; + while (*src != '\0') + *dst++ = *src++; + *dst = '\0'; +} + +char * +strchr(const char *s, char ch) +{ + + for (; *s != '\0'; s++) { + if (*s == ch) + return ((char *)(uintptr_t)(const void *)s); + } + return (NULL); +} + +size_t +strlen(const char *s) +{ + size_t len = 0; + + while (*s++ != '\0') + len++; + return (len); +} + +void +printf(const char *fmt, ...) +{ + va_list ap; + const char *hex = "0123456789abcdef"; + char buf[10], *s; + unsigned long long u; + int c, l; + + va_start(ap, fmt); + while ((c = *fmt++) != '\0') { + if (c != '%') { + putchar(c); + continue; + } + l = 0; +nextfmt: + c = *fmt++; + switch (c) { + case 'l': + l++; + goto nextfmt; + case 'c': + putchar(va_arg(ap, int)); + break; + case 's': + for (s = va_arg(ap, char *); *s != '\0'; s++) + putchar(*s); + break; + case 'd': /* A lie, always prints unsigned */ + case 'u': + case 'x': + switch (l) { + case 2: + u = va_arg(ap, unsigned long long); + break; + case 1: + u = va_arg(ap, unsigned long); + break; + default: + u = va_arg(ap, unsigned int); + break; + } + s = buf; + if (c == 'd' || c == 'u') { + do + *s++ = '0' + (u % 10U); + while (u /= 10); + } else { + do + *s++ = hex[u & 0xfu]; + while (u >>= 4); + } + while (--s >= buf) + putchar(*s); + break; + } + } + va_end(ap); +} diff --git a/sys/boot/common/util.h b/sys/boot/common/util.h new file mode 100644 index 000000000000..600c4e04c679 --- /dev/null +++ b/sys/boot/common/util.h @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2010 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _UTIL_H_ +#define _UTIL_H_ + +#include + +#include + +void memcpy(void *dst, const void *src, int len); +void memset(void *b, int c, size_t len); +int memcmp(const void *b1, const void *b2, size_t len); + +#define bcpy(src, dst, len) memcpy((dst), (src), (len)) +#define bzero(buf, size) memset((buf), 0, (size)) +#define bcmp(b1, b2, len) (memcmp((b1), (b2), (len)) != 0) + +int strcmp(const char *s1, const char *s2); +int strncmp(const char *s1, const char *s2, size_t len); +void strcpy(char *dst, const char *src); +void strcat(char *dst, const char *src); +char *strchr(const char *s, char ch); +size_t strlen(const char *s); + +void printf(const char *fmt, ...); + +#endif /* !_UTIL_H_ */ diff --git a/sys/boot/i386/common/cons.c b/sys/boot/i386/common/cons.c new file mode 100644 index 000000000000..56febf2037fb --- /dev/null +++ b/sys/boot/i386/common/cons.c @@ -0,0 +1,152 @@ +/*- + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +#include + +#include "lib.h" +#include "rbx.h" +#include "util.h" +#include "cons.h" + +#define V86_ZR(x) ((x) & PSL_Z) + +#define SECOND 18 /* Circa that many ticks in a second. */ + +uint8_t ioctrl = IO_KEYBOARD; + +void +putc(int c) +{ + + v86.addr = 0x10; + v86.eax = 0xe00 | (c & 0xff); + v86.ebx = 0x7; + v86int(); +} + +void +xputc(int c) +{ + + if (ioctrl & IO_KEYBOARD) + putc(c); + if (ioctrl & IO_SERIAL) + sio_putc(c); +} + +void +putchar(int c) +{ + + if (c == '\n') + xputc('\r'); + xputc(c); +} + +int +getc(int fn) +{ + + /* + * The extra comparison against zero is an attempt to work around + * what appears to be a bug in QEMU and Bochs. Both emulators + * sometimes report a key-press with scancode one and ascii zero + * when no such key is pressed in reality. As far as I can tell, + * this only happens shortly after a reboot. + */ + v86.ctl = V86_FLAGS; + v86.addr = 0x16; + v86.eax = fn << 8; + v86int(); + return fn == 0 ? v86.eax & 0xff : (!V86_ZR(v86.efl) && (v86.eax & 0xff)); +} + +int +xgetc(int fn) +{ + + if (OPT_CHECK(RBX_NOINTR)) + return (0); + for (;;) { + if (ioctrl & IO_KEYBOARD && getc(1)) + return (fn ? 1 : getc(0)); + if (ioctrl & IO_SERIAL && sio_ischar()) + return (fn ? 1 : sio_getc()); + if (fn) + return (0); + } + /* NOTREACHED */ +} + +int +keyhit(unsigned int secs) +{ + uint32_t t0, t1; + + if (OPT_CHECK(RBX_NOINTR)) + return (0); + secs *= SECOND; + t0 = 0; + for (;;) { + if (xgetc(1)) + return (1); + if (secs > 0) { + t1 = *(uint32_t *)PTOV(0x46c); + if (!t0) + t0 = t1; + if (t1 < t0 || t1 >= t0 + secs) + return (0); + } + } + /* NOTREACHED */ +} + +void +getstr(char *cmdstr, size_t cmdstrsize) +{ + char *s; + int c; + + s = cmdstr; + for (;;) { + switch (c = xgetc(0)) { + case 0: + break; + case '\177': + case '\b': + if (s > cmdstr) { + s--; + printf("\b \b"); + } + break; + case '\n': + case '\r': + *s = 0; + return; + default: + if (s - cmdstr < cmdstrsize - 1) + *s++ = c; + putchar(c); + break; + } + } +} diff --git a/sys/boot/i386/common/cons.h b/sys/boot/i386/common/cons.h new file mode 100644 index 000000000000..fe00a13e7171 --- /dev/null +++ b/sys/boot/i386/common/cons.h @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + * + * $FreeBSD$ + */ + +#ifndef _CONS_H_ +#define _CONS_H_ + +#define IO_KEYBOARD 1 +#define IO_SERIAL 2 + +extern uint8_t ioctrl; + +void putc(int c); +void xputc(int c); +void putchar(int c); +int getc(int fn); +int xgetc(int fn); +int keyhit(unsigned int secs); +void getstr(char *cmdstr, size_t cmdstrsize); + +#endif /* !_CONS_H_ */ diff --git a/sys/boot/i386/common/drv.c b/sys/boot/i386/common/drv.c new file mode 100644 index 000000000000..d249bc186406 --- /dev/null +++ b/sys/boot/i386/common/drv.c @@ -0,0 +1,131 @@ +/*- + * Copyright (c) 1998 Robert Nordier + * Copyright (c) 2010 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +#include + +#include "rbx.h" +#include "util.h" +#include "drv.h" +#ifndef GPT +#include "xreadorg.h" +#endif + +#define V86_CY(x) ((x) & PSL_C) +#define V86_ZR(x) ((x) & PSL_Z) + +#ifdef GPT +uint64_t +drvsize(struct dsk *dskp) +{ + unsigned char params[0x42]; + uint64_t sectors; + + *(uint32_t *)params = sizeof(params); + + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x4800; + v86.edx = dskp->drive; + v86.ds = VTOPSEG(params); + v86.esi = VTOPOFF(params); + v86int(); + if (V86_CY(v86.efl)) { + printf("error %u\n", v86.eax >> 8 & 0xff); + return (0); + } + memcpy(§ors, params + 0x10, sizeof(sectors)); + return (sectors); +} +#endif /* GPT */ + +#ifdef GPT +static struct { + uint16_t len; + uint16_t count; + uint16_t off; + uint16_t seg; + uint64_t lba; +} packet; +#endif /* GPT */ + +int +drvread(struct dsk *dskp, void *buf, daddr_t lba, unsigned nblk) +{ + static unsigned c = 0x2d5c7c2f; + + if (!OPT_CHECK(RBX_QUIET)) + printf("%c\b", c = c << 8 | c >> 24); +#ifdef GPT + packet.len = 0x10; + packet.count = nblk; + packet.off = VTOPOFF(buf); + packet.seg = VTOPSEG(buf); + packet.lba = lba; + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x4200; + v86.edx = dskp->drive; + v86.ds = VTOPSEG(&packet); + v86.esi = VTOPOFF(&packet); +#else /* !GPT */ + v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; + v86.addr = XREADORG; /* call to xread in boot1 */ + v86.es = VTOPSEG(buf); + v86.eax = lba; + v86.ebx = VTOPOFF(buf); + v86.ecx = lba >> 32; + v86.edx = nblk << 8 | dskp->drive; +#endif /* !GPT */ + v86int(); + if (V86_CY(v86.efl)) { + printf("%s: error %u lba %u\n", + BOOTPROG, v86.eax >> 8 & 0xff, lba); + return (-1); + } + return (0); +} + +#ifdef GPT +int +drvwrite(struct dsk *dskp, void *buf, daddr_t lba, unsigned nblk) +{ + + packet.len = 0x10; + packet.count = nblk; + packet.off = VTOPOFF(buf); + packet.seg = VTOPSEG(buf); + packet.lba = lba; + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x4300; + v86.edx = dskp->drive; + v86.ds = VTOPSEG(&packet); + v86.esi = VTOPOFF(&packet); + v86int(); + if (V86_CY(v86.efl)) { + printf("error %u lba %u\n", v86.eax >> 8 & 0xff, lba); + return (-1); + } + return (0); +} +#endif /* GPT */ diff --git a/sys/boot/i386/common/drv.h b/sys/boot/i386/common/drv.h new file mode 100644 index 000000000000..1ecfbc3af9e6 --- /dev/null +++ b/sys/boot/i386/common/drv.h @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2010 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DRV_H_ +#define _DRV_H_ + +struct dsk { + unsigned int drive; + unsigned int type; + unsigned int unit; + unsigned int slice; + int part; + daddr_t start; + int init; +}; + +int drvread(struct dsk *dskp, void *buf, daddr_t lba, unsigned nblk); +#ifdef GPT +int drvwrite(struct dsk *dskp, void *buf, daddr_t lba, unsigned nblk); +uint64_t drvsize(struct dsk *dskp); +#endif /* GPT */ + +#endif /* !_DRV_H_ */ diff --git a/sys/boot/i386/common/rbx.h b/sys/boot/i386/common/rbx.h new file mode 100644 index 000000000000..21371a563805 --- /dev/null +++ b/sys/boot/i386/common/rbx.h @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + * + * $FreeBSD$ + */ + +#ifndef _RBX_H_ +#define _RBX_H_ + +#define RBX_ASKNAME 0x0 /* -a */ +#define RBX_SINGLE 0x1 /* -s */ +/* 0x2 is reserved for log2(RB_NOSYNC). */ +/* 0x3 is reserved for log2(RB_HALT). */ +/* 0x4 is reserved for log2(RB_INITNAME). */ +#define RBX_DFLTROOT 0x5 /* -r */ +#define RBX_KDB 0x6 /* -d */ +/* 0x7 is reserved for log2(RB_RDONLY). */ +/* 0x8 is reserved for log2(RB_DUMP). */ +/* 0x9 is reserved for log2(RB_MINIROOT). */ +#define RBX_CONFIG 0xa /* -c */ +#define RBX_VERBOSE 0xb /* -v */ +#define RBX_SERIAL 0xc /* -h */ +#define RBX_CDROM 0xd /* -C */ +/* 0xe is reserved for log2(RB_POWEROFF). */ +#define RBX_GDB 0xf /* -g */ +#define RBX_MUTE 0x10 /* -m */ +/* 0x11 is reserved for log2(RB_SELFTEST). */ +/* 0x12 is reserved for boot programs. */ +/* 0x13 is reserved for boot programs. */ +#define RBX_PAUSE 0x14 /* -p */ +#define RBX_QUIET 0x15 /* -q */ +#define RBX_NOINTR 0x1c /* -n */ +/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ +#define RBX_DUAL 0x1d /* -D */ +/* 0x1f is reserved for log2(RB_BOOTINFO). */ + +/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ +#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ + OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ + OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ + OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ + OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ + OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) + +#define OPT_SET(opt) (1 << (opt)) +#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) + +extern uint32_t opts; + +#endif /* !_RBX_H_ */ diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile index f76fb4e70afe..3b43537f4ccb 100644 --- a/sys/boot/i386/gptboot/Makefile +++ b/sys/boot/i386/gptboot/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../boot2 +.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${.CURDIR}/../../common FILES= gptboot @@ -19,18 +19,21 @@ GPTBOOT_UFS?= UFS1_AND_UFS2 #GPTBOOT_UFS?= UFS2_ONLY #GPTBOOT_UFS?= UFS1_ONLY -CFLAGS= -Os \ +CFLAGS= -DBOOTPROG=\"gptboot\" \ + -Os \ -fno-guess-branch-probability \ -fomit-frame-pointer \ -fno-unit-at-a-time \ -mno-align-long-strings \ -mrtd \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ + -DGPT \ -D${GPTBOOT_UFS} \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${.CURDIR}/../../common \ + -I${.CURDIR}/../common \ -I${.CURDIR}/../btx/lib -I. \ -I${.CURDIR}/../boot2 \ -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ @@ -57,13 +60,13 @@ gptldr.bin: gptldr.out gptldr.out: gptldr.o ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o -CLEANFILES+= gptboot.bin gptboot.out gptboot.o sio.o +CLEANFILES+= gptboot.bin gptboot.out gptboot.o sio.o ufsread.o gptboot.bin: gptboot.out objcopy -S -O binary gptboot.out ${.TARGET} -gptboot.out: ${BTXCRT} gptboot.o sio.o - ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} +gptboot.out: ${BTXCRT} gptboot.o sio.o gpt.o crc32.o drv.o cons.o util.o + ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} gptboot.o: ${.CURDIR}/../../common/ufsread.c diff --git a/sys/boot/i386/gptboot/gptboot.c b/sys/boot/i386/gptboot/gptboot.c index 6939556eb0dd..5f0ab7c655cb 100644 --- a/sys/boot/i386/gptboot/gptboot.c +++ b/sys/boot/i386/gptboot/gptboot.c @@ -32,46 +32,11 @@ __FBSDID("$FreeBSD$"); #include #include "lib.h" - -#define IO_KEYBOARD 1 -#define IO_SERIAL 2 - -#define SECOND 18 /* Circa that many ticks in a second. */ - -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -#define RBX_KDB 0x6 /* -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -#define RBX_SERIAL 0xc /* -h */ -#define RBX_CDROM 0xd /* -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -#define RBX_MUTE 0x10 /* -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -#define RBX_PAUSE 0x14 /* -p */ -#define RBX_QUIET 0x15 /* -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -#define RBX_DUAL 0x1d /* -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ - OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ - OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ - OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) +#include "rbx.h" +#include "drv.h" +#include "util.h" +#include "cons.h" +#include "gpt.h" #define PATH_CONFIG "/boot.config" #define PATH_BOOT3 "/boot/loader" @@ -82,8 +47,6 @@ __FBSDID("$FreeBSD$"); #define NDEV 3 #define MEM_BASE 0x12 #define MEM_EXT 0x15 -#define V86_CY(x) ((x) & PSL_C) -#define V86_ZR(x) ((x) & PSL_Z) #define DRV_HARD 0x80 #define DRV_MASK 0x7f @@ -93,211 +56,178 @@ __FBSDID("$FreeBSD$"); #define TYPE_MAXHARD TYPE_DA #define TYPE_FD 2 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - extern uint32_t _end; static const uuid_t freebsd_ufs_uuid = GPT_ENT_TYPE_FREEBSD_UFS; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ static const unsigned char flags[NOPT] = { - RBX_DUAL, - RBX_SERIAL, - RBX_ASKNAME, - RBX_CDROM, - RBX_CONFIG, - RBX_KDB, - RBX_GDB, - RBX_MUTE, - RBX_NOINTR, - RBX_PAUSE, - RBX_QUIET, - RBX_DFLTROOT, - RBX_SINGLE, - RBX_VERBOSE + RBX_DUAL, + RBX_SERIAL, + RBX_ASKNAME, + RBX_CDROM, + RBX_CONFIG, + RBX_KDB, + RBX_GDB, + RBX_MUTE, + RBX_NOINTR, + RBX_PAUSE, + RBX_QUIET, + RBX_DFLTROOT, + RBX_SINGLE, + RBX_VERBOSE }; +uint32_t opts; static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; static const unsigned char dev_maj[NDEV] = {30, 4, 2}; -static struct dsk { - unsigned drive; - unsigned type; - unsigned unit; - int part; - daddr_t start; - int init; -} dsk; -static char cmd[512], cmddup[512]; +static struct dsk dsk; static char kname[1024]; -static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static uint8_t ioctrl = IO_KEYBOARD; void exit(int); -static int bcmp(const void *, const void *, size_t); static void load(void); -static int parse(void); +static int parse(char *, int *); static int xfsread(ino_t, void *, size_t); static int dskread(void *, daddr_t, unsigned); -static void printf(const char *,...); -static void putchar(int); -static void memcpy(void *, const void *, int); static uint32_t memsize(void); -static int drvread(void *, daddr_t, unsigned); -static int keyhit(unsigned); -static int xputc(int); -static int xgetc(int); -static int getc(int); - -static void -memcpy(void *dst, const void *src, int len) -{ - const char *s = src; - char *d = dst; - - while (len--) - *d++ = *s++; -} - -static inline int -strcmp(const char *s1, const char *s2) -{ - for (; *s1 == *s2 && *s1; s1++, s2++); - return (unsigned char)*s1 - (unsigned char)*s2; -} #include "ufsread.c" static inline int xfsread(ino_t inode, void *buf, size_t nbyte) { - if ((size_t)fsread(inode, buf, nbyte) != nbyte) { - printf("Invalid %s\n", "format"); - return -1; - } - return 0; + + if ((size_t)fsread(inode, buf, nbyte) != nbyte) { + printf("Invalid %s\n", "format"); + return (-1); + } + return (0); } static inline uint32_t memsize(void) { - v86.addr = MEM_EXT; - v86.eax = 0x8800; - v86int(); - return v86.eax; -} -static inline void -getstr(void) -{ - char *s; - int c; - - s = cmd; - for (;;) { - switch (c = xgetc(0)) { - case 0: - break; - case '\177': - case '\b': - if (s > cmd) { - s--; - printf("\b \b"); - } - break; - case '\n': - case '\r': - *s = 0; - return; - default: - if (s - cmd < sizeof(cmd) - 1) - *s++ = c; - putchar(c); - } - } + v86.addr = MEM_EXT; + v86.eax = 0x8800; + v86int(); + return (v86.eax); } -static inline void -putc(int c) +static int +gptinit(void) { - v86.addr = 0x10; - v86.eax = 0xe00 | (c & 0xff); - v86.ebx = 0x7; - v86int(); + + if (gptread(&freebsd_ufs_uuid, &dsk, dmadat->secbuf) == -1) { + printf("%s: unable to load GPT\n", BOOTPROG); + return (-1); + } + if (gptfind(&freebsd_ufs_uuid, &dsk, dsk.part) == -1) { + printf("%s: no UFS partition was found\n", BOOTPROG); + return (-1); + } + dsk_meta = 0; + return (0); } int main(void) { - int autoboot; - ino_t ino; + char cmd[512], cmdtmp[512]; + int autoboot, dskupdated; + ino_t ino; + + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + v86.ctl = V86_FLAGS; + v86.efl = PSL_RESERVED_DEFAULT | PSL_I; + dsk.drive = *(uint8_t *)PTOV(ARGS); + dsk.type = dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; + dsk.unit = dsk.drive & DRV_MASK; + dsk.part = -1; + dsk.start = 0; + bootinfo.bi_version = BOOTINFO_VERSION; + bootinfo.bi_size = sizeof(bootinfo); + bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ + bootinfo.bi_extmem = memsize(); + bootinfo.bi_memsizes_valid++; + + /* Process configuration file */ + + if (gptinit() != 0) + return (-1); + + autoboot = 1; + *cmd = '\0'; + + for (;;) { + *kname = '\0'; + ino = lookup(PATH_CONFIG); + if (ino > 0) + fsread(ino, cmd, sizeof(cmd)); + + if (*cmd != '\0') { + memcpy(cmdtmp, cmd, sizeof(cmdtmp)); + if (parse(cmdtmp, &dskupdated)) + break; + if (dskupdated && gptinit() != 0) + break; + if (!OPT_CHECK(RBX_QUIET)) + printf("%s: %s", PATH_CONFIG, cmd); + *cmd = '\0'; + } - dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); - v86.ctl = V86_FLAGS; - v86.efl = PSL_RESERVED_DEFAULT | PSL_I; - dsk.drive = *(uint8_t *)PTOV(ARGS); - dsk.type = dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; - dsk.unit = dsk.drive & DRV_MASK; - dsk.part = -1; - bootinfo.bi_version = BOOTINFO_VERSION; - bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); - bootinfo.bi_memsizes_valid++; - - /* Process configuration file */ - - autoboot = 1; - - if ((ino = lookup(PATH_CONFIG))) - fsread(ino, cmd, sizeof(cmd)); - - if (*cmd) { - memcpy(cmddup, cmd, sizeof(cmd)); - if (parse()) - autoboot = 0; - if (!OPT_CHECK(RBX_QUIET)) - printf("%s: %s", PATH_CONFIG, cmddup); - /* Do not process this command twice */ - *cmd = 0; - } + if (autoboot && keyhit(3)) { + if (*kname == '\0') + memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + break; + } + autoboot = 0; + + /* + * Try to exec stage 3 boot loader. If interrupted by a + * keypress, or in case of failure, try to load a kernel + * directly instead. + */ + if (*kname != '\0') + load(); + memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + load(); + memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); + load(); + gptbootfailed(&dsk); + if (gptfind(&freebsd_ufs_uuid, &dsk, -1) == -1) + break; + dsk_meta = 0; + } - /* - * Try to exec stage 3 boot loader. If interrupted by a keypress, - * or in case of failure, try to load a kernel directly instead. - */ + /* Present the user with the boot2 prompt. */ - if (autoboot && !*kname) { - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); - if (!keyhit(3*SECOND)) { - load(); - memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); + for (;;) { + if (!OPT_CHECK(RBX_QUIET)) { + printf("\nFreeBSD/x86 boot\n" + "Default: %u:%s(%up%u)%s\n" + "boot: ", + dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, + dsk.part, kname); + } + if (ioctrl & IO_SERIAL) + sio_flush(); + *cmd = '\0'; + if (keyhit(0)) + getstr(cmd, sizeof(cmd)); + else if (!OPT_CHECK(RBX_QUIET)) + putchar('\n'); + if (parse(cmd, &dskupdated)) { + putchar('\a'); + continue; + } + if (dskupdated && gptinit() != 0) + continue; + load(); } - } - - /* Present the user with the boot2 prompt. */ - - for (;;) { - if (!autoboot || !OPT_CHECK(RBX_QUIET)) - printf("\nFreeBSD/x86 boot\n" - "Default: %u:%s(%up%u)%s\n" - "boot: ", - dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, - dsk.part, kname); - if (ioctrl & IO_SERIAL) - sio_flush(); - if (!autoboot || keyhit(5*SECOND)) - getstr(); - else if (!autoboot || !OPT_CHECK(RBX_QUIET)) - putchar('\n'); - autoboot = 0; - if (parse()) - putchar('\a'); - else - load(); - } + /* NOTREACHED */ } /* XXX - Needed for btxld to link the boot2 binary; do not remove. */ @@ -321,8 +251,11 @@ load(void) int fmt, i, j; if (!(ino = lookup(kname))) { - if (!ls) - printf("No %s\n", kname); + if (!ls) { + printf("%s: No %s on %u:%s(%up%u)\n", BOOTPROG, + kname, dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, + dsk.part); + } return; } if (xfsread(ino, &hdr, sizeof(hdr))) @@ -402,14 +335,15 @@ load(void) } static int -parse(void) +parse(char *cmdstr, int *dskupdated) { - char *arg = cmd; + char *arg = cmdstr; char *ep, *p, *q; const char *cp; unsigned int drv; int c, i, j; + *dskupdated = 0; while ((c = *arg++)) { if (c == ' ' || c == '\t' || c == '\n') continue; @@ -480,7 +414,7 @@ parse(void) drv = dsk.unit; dsk.drive = (dsk.type <= TYPE_MAXHARD ? DRV_HARD : 0) + drv; - dsk_meta = 0; + *dskupdated = 1; } if ((i = ep - arg)) { if ((size_t)i >= sizeof(kname)) @@ -496,232 +430,6 @@ parse(void) static int dskread(void *buf, daddr_t lba, unsigned nblk) { - struct gpt_hdr hdr; - struct gpt_ent *ent; - char *sec; - daddr_t slba, elba; - int part, entries_per_sec; - - if (!dsk_meta) { - /* Read and verify GPT. */ - sec = dmadat->secbuf; - dsk.start = 0; - if (drvread(sec, 1, 1)) - return -1; - memcpy(&hdr, sec, sizeof(hdr)); - if (bcmp(hdr.hdr_sig, GPT_HDR_SIG, sizeof(hdr.hdr_sig)) != 0 || - hdr.hdr_lba_self != 1 || hdr.hdr_revision < 0x00010000 || - hdr.hdr_entsz < sizeof(*ent) || DEV_BSIZE % hdr.hdr_entsz != 0) { - printf("Invalid GPT header\n"); - return -1; - } - - /* XXX: CRC check? */ - - /* - * If the partition isn't specified, then search for the first UFS - * partition and hope it is /. Perhaps we should be using an OS - * flag in the GPT entry to mark / partitions. - * - * If the partition is specified, then figure out the LBA for the - * sector containing that partition index and load it. - */ - entries_per_sec = DEV_BSIZE / hdr.hdr_entsz; - if (dsk.part == -1) { - slba = hdr.hdr_lba_table; - elba = slba + hdr.hdr_entries / entries_per_sec; - while (slba < elba && dsk.part == -1) { - if (drvread(sec, slba, 1)) - return -1; - for (part = 0; part < entries_per_sec; part++) { - ent = (struct gpt_ent *)(sec + part * hdr.hdr_entsz); - if (bcmp(&ent->ent_type, &freebsd_ufs_uuid, - sizeof(uuid_t)) == 0) { - dsk.part = (slba - hdr.hdr_lba_table) * - entries_per_sec + part + 1; - dsk.start = ent->ent_lba_start; - break; - } - } - slba++; - } - if (dsk.part == -1) { - printf("No UFS partition was found\n"); - return -1; - } - } else { - if (dsk.part > hdr.hdr_entries) { - printf("Invalid partition index\n"); - return -1; - } - slba = hdr.hdr_lba_table + (dsk.part - 1) / entries_per_sec; - if (drvread(sec, slba, 1)) - return -1; - part = (dsk.part - 1) % entries_per_sec; - ent = (struct gpt_ent *)(sec + part * hdr.hdr_entsz); - if (bcmp(&ent->ent_type, &freebsd_ufs_uuid, sizeof(uuid_t)) != 0) { - printf("Specified partition is not UFS\n"); - return -1; - } - dsk.start = ent->ent_lba_start; - } - /* - * XXX: No way to detect SCSI vs. ATA currently. - */ -#if 0 - if (!dsk.init) { - if (d->d_type == DTYPE_SCSI) - dsk.type = TYPE_DA; - dsk.init++; - } -#endif - } - return drvread(buf, dsk.start + lba, nblk); -} - -static void -printf(const char *fmt,...) -{ - va_list ap; - char buf[10]; - char *s; - unsigned u; - int c; - - va_start(ap, fmt); - while ((c = *fmt++)) { - if (c == '%') { - c = *fmt++; - switch (c) { - case 'c': - putchar(va_arg(ap, int)); - continue; - case 's': - for (s = va_arg(ap, char *); *s; s++) - putchar(*s); - continue; - case 'u': - u = va_arg(ap, unsigned); - s = buf; - do - *s++ = '0' + u % 10U; - while (u /= 10U); - while (--s >= buf) - putchar(*s); - continue; - } - } - putchar(c); - } - va_end(ap); - return; -} - -static void -putchar(int c) -{ - if (c == '\n') - xputc('\r'); - xputc(c); -} - -static int -bcmp(const void *b1, const void *b2, size_t length) -{ - const char *p1 = b1, *p2 = b2; - - if (length == 0) - return (0); - do { - if (*p1++ != *p2++) - break; - } while (--length); - return (length); -} - -static struct { - uint16_t len; - uint16_t count; - uint16_t off; - uint16_t seg; - uint64_t lba; -} packet; - -static int -drvread(void *buf, daddr_t lba, unsigned nblk) -{ - static unsigned c = 0x2d5c7c2f; - - if (!OPT_CHECK(RBX_QUIET)) - printf("%c\b", c = c << 8 | c >> 24); - packet.len = 0x10; - packet.count = nblk; - packet.off = VTOPOFF(buf); - packet.seg = VTOPSEG(buf); - packet.lba = lba; - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x4200; - v86.edx = dsk.drive; - v86.ds = VTOPSEG(&packet); - v86.esi = VTOPOFF(&packet); - v86int(); - if (V86_CY(v86.efl)) { - printf("error %u lba %u\n", v86.eax >> 8 & 0xff, lba); - return -1; - } - return 0; -} -static int -keyhit(unsigned ticks) -{ - uint32_t t0, t1; - - if (OPT_CHECK(RBX_NOINTR)) - return 0; - t0 = 0; - for (;;) { - if (xgetc(1)) - return 1; - t1 = *(uint32_t *)PTOV(0x46c); - if (!t0) - t0 = t1; - if (t1 < t0 || t1 >= t0 + ticks) - return 0; - } -} - -static int -xputc(int c) -{ - if (ioctrl & IO_KEYBOARD) - putc(c); - if (ioctrl & IO_SERIAL) - sio_putc(c); - return c; -} - -static int -xgetc(int fn) -{ - if (OPT_CHECK(RBX_NOINTR)) - return 0; - for (;;) { - if (ioctrl & IO_KEYBOARD && getc(1)) - return fn ? 1 : getc(0); - if (ioctrl & IO_SERIAL && sio_ischar()) - return fn ? 1 : sio_getc(); - if (fn) - return 0; - } -} - -static int -getc(int fn) -{ - v86.addr = 0x16; - v86.eax = fn << 8; - v86int(); - return fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl); + return drvread(&dsk, buf, lba + dsk.start, nblk); } diff --git a/sys/boot/i386/gptzfsboot/Makefile b/sys/boot/i386/gptzfsboot/Makefile index cf7ff35b6427..30a5fc78abac 100644 --- a/sys/boot/i386/gptzfsboot/Makefile +++ b/sys/boot/i386/gptzfsboot/Makefile @@ -1,6 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../gptboot ${.CURDIR}/../zfsboot +.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../gptboot \ + ${.CURDIR}/../zfsboot ${.CURDIR}/../common \ + ${.CURDIR}/../../common FILES= gptzfsboot @@ -14,7 +16,8 @@ REL1= 0x700 ORG1= 0x7c00 ORG2= 0x0 -CFLAGS= -Os \ +CFLAGS= -DBOOTPROG=\"gptzfsboot\" \ + -Os \ -fno-guess-branch-probability \ -fomit-frame-pointer \ -fno-unit-at-a-time \ @@ -26,6 +29,7 @@ CFLAGS= -Os \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${.CURDIR}/../../common \ + -I${.CURDIR}/../common \ -I${.CURDIR}/../../zfs \ -I${.CURDIR}/../../../cddl/boot/zfs \ -I${.CURDIR}/../btx/lib -I. \ @@ -59,7 +63,7 @@ CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o gptzfsboot.bin: gptzfsboot.out objcopy -S -O binary gptzfsboot.out ${.TARGET} -gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o +gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c diff --git a/sys/boot/i386/zfsboot/Makefile b/sys/boot/i386/zfsboot/Makefile index 7e5cb567e0e9..10616e418acc 100644 --- a/sys/boot/i386/zfsboot/Makefile +++ b/sys/boot/i386/zfsboot/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../boot2 +.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${.CURDIR}/../../common FILES= zfsboot @@ -17,7 +17,8 @@ REL1= 0x700 ORG1= 0x7c00 ORG2= 0x2000 -CFLAGS= -Os -g \ +CFLAGS= -DBOOTPROG=\"zfsboot\" \ + -Os -g \ -fno-guess-branch-probability \ -fomit-frame-pointer \ -fno-unit-at-a-time \ @@ -29,6 +30,8 @@ CFLAGS= -Os -g \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ + -I${.CURDIR}/../../common \ + -I${.CURDIR}/../common \ -I${.CURDIR}/../../zfs \ -I${.CURDIR}/../../../cddl/boot/zfs \ -I${.CURDIR}/../btx/lib -I. \ @@ -57,7 +60,7 @@ zfsldr.out: zfsldr.o ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o CLEANFILES+= zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \ - zfsboot.o zfsboot.s zfsboot.s.tmp zfsboot.h sio.o + zfsboot.o zfsboot.s zfsboot.s.tmp xreadorg.h sio.o # We currently allow 32768 bytes for zfsboot - in practice it could be # any size up to 3.5Mb but keeping it fixed size simplifies zfsldr. @@ -79,19 +82,19 @@ zfsboot.ldr: zfsboot.bin: zfsboot.out objcopy -S -O binary zfsboot.out ${.TARGET} -zfsboot.out: ${BTXCRT} zfsboot.o sio.o +zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} zfsboot.o: zfsboot.s -SRCS= zfsboot.c zfsboot.h +SRCS= zfsboot.c xreadorg.h -zfsboot.s: zfsboot.c zfsboot.h ${.CURDIR}/../../zfs/zfsimpl.c +zfsboot.s: zfsboot.c xreadorg.h ${.CURDIR}/../../zfs/zfsimpl.c ${CC} ${CFLAGS} -S -o zfsboot.s.tmp ${.CURDIR}/zfsboot.c sed -e '/align/d' -e '/nop/d' < zfsboot.s.tmp > zfsboot.s rm -f zfsboot.s.tmp -zfsboot.h: zfsldr.out +xreadorg.h: zfsldr.out ${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \ { x = $$1 - ORG1; \ printf("#define XREADORG %#x\n", REL1 + x) }' \ diff --git a/sys/boot/i386/zfsboot/zfsboot.c b/sys/boot/i386/zfsboot/zfsboot.c index c6ef699a4809..1d0077b7a4af 100644 --- a/sys/boot/i386/zfsboot/zfsboot.c +++ b/sys/boot/i386/zfsboot/zfsboot.c @@ -36,50 +36,11 @@ __FBSDID("$FreeBSD$"); #include -#ifndef GPT -#include "zfsboot.h" -#endif #include "lib.h" - -#define IO_KEYBOARD 1 -#define IO_SERIAL 2 - -#define SECOND 18 /* Circa that many ticks in a second. */ - -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -#define RBX_KDB 0x6 /* -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -#define RBX_SERIAL 0xc /* -h */ -#define RBX_CDROM 0xd /* -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -#define RBX_MUTE 0x10 /* -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -#define RBX_PAUSE 0x14 /* -p */ -#define RBX_QUIET 0x15 /* -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -#define RBX_DUAL 0x1d /* -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ - OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ - OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ - OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) +#include "rbx.h" +#include "drv.h" +#include "util.h" +#include "cons.h" /* Hint to loader that we came from ZFS */ #define KARGS_FLAGS_ZFS 0x4 @@ -91,8 +52,6 @@ __FBSDID("$FreeBSD$"); #define ARGS 0x900 #define NOPT 14 #define NDEV 3 -#define V86_CY(x) ((x) & 1) -#define V86_ZR(x) ((x) & 0x40) #define BIOS_NUMDRIVES 0x475 #define DRV_HARD 0x80 @@ -103,8 +62,7 @@ __FBSDID("$FreeBSD$"); #define TYPE_MAXHARD TYPE_DA #define TYPE_FD 2 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) +#define MAXBDDEV 31 extern uint32_t _end; @@ -128,26 +86,16 @@ static const unsigned char flags[NOPT] = { RBX_SINGLE, RBX_VERBOSE }; +uint32_t opts; static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; static const unsigned char dev_maj[NDEV] = {30, 4, 2}; -struct dsk { - unsigned drive; - unsigned type; - unsigned unit; - unsigned slice; - unsigned part; - int init; - daddr_t start; -}; static char cmd[512]; static char kname[1024]; -static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint32_t bootdev; -static uint8_t ioctrl = IO_KEYBOARD; vm_offset_t high_heap_base; uint32_t bios_basemem, bios_extmem, high_heap_size; @@ -173,79 +121,7 @@ static struct dmadat *dmadat; void exit(int); static void load(void); static int parse(void); -static void printf(const char *,...); -static void putchar(int); static void bios_getmem(void); -static int drvread(struct dsk *, void *, daddr_t, unsigned); -static int keyhit(unsigned); -static int xputc(int); -static int xgetc(int); -static int getc(int); - -static void memcpy(void *, const void *, int); -static void -memcpy(void *dst, const void *src, int len) -{ - const char *s = src; - char *d = dst; - - while (len--) - *d++ = *s++; -} - -static void -strcpy(char *dst, const char *src) -{ - while (*src) - *dst++ = *src++; - *dst++ = 0; -} - -static void -strcat(char *dst, const char *src) -{ - while (*dst) - dst++; - while (*src) - *dst++ = *src++; - *dst++ = 0; -} - -static int -strcmp(const char *s1, const char *s2) -{ - for (; *s1 == *s2 && *s1; s1++, s2++); - return (unsigned char)*s1 - (unsigned char)*s2; -} - -static const char * -strchr(const char *s, char ch) -{ - for (; *s; s++) - if (*s == ch) - return s; - return 0; -} - -static int -memcmp(const void *p1, const void *p2, size_t n) -{ - const char *s1 = (const char *) p1; - const char *s2 = (const char *) p2; - for (; n > 0 && *s1 == *s2; s1++, s2++, n--); - if (n) - return (unsigned char)*s1 - (unsigned char)*s2; - else - return 0; -} - -static void -memset(void *p, char val, size_t n) -{ - char *s = (char *) p; - while (n--) - *s++ = val; -} static void * malloc(size_t n) @@ -261,15 +137,6 @@ malloc(size_t n) return p; } -static size_t -strlen(const char *s) -{ - size_t len = 0; - while (*s++) - len++; - return len; -} - static char * strdup(const char *s) { @@ -324,6 +191,7 @@ vdev_read(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes) p = buf; lba = off / DEV_BSIZE; + lba += dsk->start; while (bytes > 0) { nb = bytes / DEV_BSIZE; if (nb > READ_BUF_SIZE / DEV_BSIZE) @@ -435,46 +303,6 @@ bios_getmem(void) } } -static inline void -getstr(void) -{ - char *s; - int c; - - s = cmd; - for (;;) { - switch (c = xgetc(0)) { - case 0: - break; - case '\177': - case '\b': - if (s > cmd) { - s--; - printf("\b \b"); - } - break; - case '\n': - case '\r': - *s = 0; - return; - default: - if (s - cmd < sizeof(cmd) - 1) - *s++ = c; - putchar(c); - } - } -} - -static inline void -putc(int c) -{ - v86.ctl = 0; - v86.addr = 0x10; - v86.eax = 0xe00 | (c & 0xff); - v86.ebx = 0x7; - v86int(); -} - /* * Try to detect a device supported by the legacy int13 BIOS */ @@ -571,7 +399,7 @@ probe_drive(struct dsk *dsk, spa_t **spap) * We record the first pool we find (we will try * to boot from that one). */ - spap = 0; + spap = NULL; /* * This slice had a vdev. We need a new dsk @@ -687,7 +515,7 @@ main(void) dsk->part = 0; dsk->start = 0; dsk->init = 0; - probe_drive(dsk, 0); + probe_drive(dsk, NULL); } /* @@ -697,7 +525,7 @@ main(void) if (!spa) { spa = STAILQ_FIRST(&zfs_pools); if (!spa) { - printf("No ZFS pools located, can't boot\n"); + printf("%s: No ZFS pools located, can't boot\n", BOOTPROG); for (;;) ; } @@ -726,7 +554,7 @@ main(void) if (autoboot && !*kname) { memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); - if (!keyhit(3*SECOND)) { + if (!keyhit(3)) { load(); memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); } @@ -742,8 +570,8 @@ main(void) spa->spa_name, kname); if (ioctrl & IO_SERIAL) sio_flush(); - if (!autoboot || keyhit(5*SECOND)) - getstr(); + if (!autoboot || keyhit(5)) + getstr(cmd, sizeof(cmd)); else if (!autoboot || !OPT_CHECK(RBX_QUIET)) putchar('\n'); autoboot = 0; @@ -858,7 +686,7 @@ load(void) } static int -parse() +parse(void) { char *arg = cmd; char *ep, *p, *q; @@ -950,222 +778,3 @@ parse() } return 0; } - -static void -printf(const char *fmt,...) -{ - va_list ap; - char buf[20]; - char *s; - unsigned long long u; - int c; - int minus; - int prec; - int l; - int len; - int pad; - - va_start(ap, fmt); - while ((c = *fmt++)) { - if (c == '%') { - minus = 0; - prec = 0; - l = 0; - nextfmt: - c = *fmt++; - switch (c) { - case '-': - minus = 1; - goto nextfmt; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - prec = 10 * prec + (c - '0'); - goto nextfmt; - case 'c': - putchar(va_arg(ap, int)); - continue; - case 'l': - l++; - goto nextfmt; - case 's': - s = va_arg(ap, char *); - if (prec) { - len = strlen(s); - if (len < prec) - pad = prec - len; - else - pad = 0; - if (minus) - while (pad--) - putchar(' '); - for (; *s; s++) - putchar(*s); - if (!minus) - while (pad--) - putchar(' '); - } else { - for (; *s; s++) - putchar(*s); - } - continue; - case 'u': - switch (l) { - case 2: - u = va_arg(ap, unsigned long long); - break; - case 1: - u = va_arg(ap, unsigned long); - break; - default: - u = va_arg(ap, unsigned); - break; - } - s = buf; - do - *s++ = '0' + u % 10U; - while (u /= 10U); - while (--s >= buf) - putchar(*s); - continue; - } - } - putchar(c); - } - va_end(ap); - return; -} - -static void -putchar(int c) -{ - if (c == '\n') - xputc('\r'); - xputc(c); -} - -#ifdef GPT -static struct { - uint16_t len; - uint16_t count; - uint16_t off; - uint16_t seg; - uint64_t lba; -} packet; -#endif - -static int -drvread(struct dsk *dsk, void *buf, daddr_t lba, unsigned nblk) -{ -#ifdef GPT - static unsigned c = 0x2d5c7c2f; - - if (!OPT_CHECK(RBX_QUIET)) - printf("%c\b", c = c << 8 | c >> 24); - packet.len = 0x10; - packet.count = nblk; - packet.off = VTOPOFF(buf); - packet.seg = VTOPSEG(buf); - packet.lba = lba + dsk->start; - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x4200; - v86.edx = dsk->drive; - v86.ds = VTOPSEG(&packet); - v86.esi = VTOPOFF(&packet); - v86int(); - if (V86_CY(v86.efl)) { - printf("error %u lba %u\n", v86.eax >> 8 & 0xff, lba); - return -1; - } - return 0; -#else - static unsigned c = 0x2d5c7c2f; - - lba += dsk->start; - if (!OPT_CHECK(RBX_QUIET)) - printf("%c\b", c = c << 8 | c >> 24); - v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; - v86.addr = XREADORG; /* call to xread in boot1 */ - v86.es = VTOPSEG(buf); - v86.eax = lba; - v86.ebx = VTOPOFF(buf); - v86.ecx = lba >> 32; - v86.edx = nblk << 8 | dsk->drive; - v86int(); - v86.ctl = V86_FLAGS; - if (V86_CY(v86.efl)) { - printf("error %u lba %u\n", v86.eax >> 8 & 0xff, lba); - return -1; - } - return 0; -#endif -} - -static int -keyhit(unsigned ticks) -{ - uint32_t t0, t1; - - if (OPT_CHECK(RBX_NOINTR)) - return 0; - t0 = 0; - for (;;) { - if (xgetc(1)) - return 1; - t1 = *(uint32_t *)PTOV(0x46c); - if (!t0) - t0 = t1; - if (t1 < t0 || t1 >= t0 + ticks) - return 0; - } -} - -static int -xputc(int c) -{ - if (ioctrl & IO_KEYBOARD) - putc(c); - if (ioctrl & IO_SERIAL) - sio_putc(c); - return c; -} - -static int -xgetc(int fn) -{ - if (OPT_CHECK(RBX_NOINTR)) - return 0; - for (;;) { - if (ioctrl & IO_KEYBOARD && getc(1)) - return fn ? 1 : getc(0); - if (ioctrl & IO_SERIAL && sio_ischar()) - return fn ? 1 : sio_getc(); - if (fn) - return 0; - } -} - -static int -getc(int fn) -{ - /* - * The extra comparison against zero is an attempt to work around - * what appears to be a bug in QEMU and Bochs. Both emulators - * sometimes report a key-press with scancode one and ascii zero - * when no such key is pressed in reality. As far as I can tell, - * this only happens shortly after a reboot. - */ - v86.ctl = V86_FLAGS; - v86.addr = 0x16; - v86.eax = fn << 8; - v86int(); - return fn == 0 ? v86.eax & 0xff : (!V86_ZR(v86.efl) && (v86.eax & 0xff)); -} diff --git a/sys/boot/zfs/Makefile b/sys/boot/zfs/Makefile index beba733581cd..91525d77c8d0 100644 --- a/sys/boot/zfs/Makefile +++ b/sys/boot/zfs/Makefile @@ -5,6 +5,7 @@ INTERNALLIB= SRCS+= zfs.c +CFLAGS+= -DBOOTPROG=\"zfsloader\" CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../.. -I. CFLAGS+= -I${.CURDIR}/../../../lib/libstand CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs diff --git a/sys/boot/zfs/zfsimpl.c b/sys/boot/zfs/zfsimpl.c index f5eff6231d67..cb0912099c12 100644 --- a/sys/boot/zfs/zfsimpl.c +++ b/sys/boot/zfs/zfsimpl.c @@ -496,12 +496,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vdev_t **vdevp, int is_newer) vdev->v_nparity = 0; if (nvlist_find(nvlist, ZPOOL_CONFIG_PATH, DATA_TYPE_STRING, 0, &path) == 0) { - if (strlen(path) > 5 - && path[0] == '/' - && path[1] == 'd' - && path[2] == 'e' - && path[3] == 'v' - && path[4] == '/') + if (strncmp(path, "/dev/", 5) == 0) path += 5; vdev->v_name = strdup(path); } else { @@ -682,7 +677,7 @@ pager_printf(const char *fmt, ...) #endif -#define STATUS_FORMAT " %-16s %-10s\n" +#define STATUS_FORMAT " %s %s\n" static void print_state(int indent, const char *name, vdev_state_t state) @@ -1393,7 +1388,7 @@ fzap_list(spa_t *spa, const dnode_phys_t *dnode) */ value = fzap_leaf_value(&zl, zc); - printf("%-32s 0x%llx\n", name, value); + printf("%s 0x%llx\n", name, value); } } -- cgit v1.3 From 105e26e2133b26b7a6230782c8bb443a4a0c76ff Mon Sep 17 00:00:00 2001 From: Peter Holm Date: Fri, 8 Oct 2010 10:27:52 +0000 Subject: Ensure that a make from sys/boot does not pick up include files from /usr/include. Discussed with: kib --- sys/boot/i386/gptboot/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/boot') diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile index 3b43537f4ccb..a0fad610c000 100644 --- a/sys/boot/i386/gptboot/Makefile +++ b/sys/boot/i386/gptboot/Makefile @@ -36,6 +36,7 @@ CFLAGS= -DBOOTPROG=\"gptboot\" \ -I${.CURDIR}/../common \ -I${.CURDIR}/../btx/lib -I. \ -I${.CURDIR}/../boot2 \ + -I${.CURDIR}/../../.. \ -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -- cgit v1.3 From 0d9deed52c5ed3b24d2da5ec3a0a172fe9092a96 Mon Sep 17 00:00:00 2001 From: Ulrich Spörlein Date: Fri, 8 Oct 2010 12:40:16 +0000 Subject: mdoc: drop redundant .Pp and .LP calls They have no effect when coming in pairs, or before .Bl/.Bd --- bin/chflags/chflags.1 | 1 - bin/stty/stty.1 | 1 - games/caesar/caesar.6 | 2 -- lib/libarchive/libarchive-formats.5 | 1 - lib/libc/gen/confstr.3 | 1 - lib/libc/gen/getcap.3 | 1 - lib/libc/gen/stringlist.3 | 1 - lib/libc/gen/sysctl.3 | 1 - lib/libc/locale/localeconv.3 | 1 - lib/libc/locale/setlocale.3 | 1 - lib/libc/net/getnetent.3 | 1 - lib/libc/net/getprotoent.3 | 1 - lib/libc/net/nsdispatch.3 | 2 -- lib/libc/posix1e/acl_add_flag_np.3 | 1 - lib/libc/posix1e/acl_add_perm.3 | 2 -- lib/libc/posix1e/acl_get.3 | 1 - lib/libc/posix1e/acl_set.3 | 1 - lib/libc/posix1e/acl_set_entry_type_np.3 | 1 - lib/libc/posix1e/acl_set_tag_type.3 | 1 - lib/libc/regex/re_format.7 | 1 - lib/libc/stdlib/malloc.3 | 1 - lib/libc/stdlib/strtod.3 | 1 - lib/libc/sys/aio_read.2 | 1 - lib/libc/sys/aio_write.2 | 1 - lib/libc/sys/clock_gettime.2 | 1 - lib/libc/sys/gettimeofday.2 | 1 - lib/libc/sys/kldstat.2 | 1 - lib/libc/sys/kldsym.2 | 1 - lib/libc/sys/kqueue.2 | 1 - lib/libc/sys/modstat.2 | 1 - lib/libc/sys/recv.2 | 2 -- lib/libc/sys/sched_setscheduler.2 | 1 - lib/libc/uuid/uuid.3 | 1 - lib/libcam/cam_cdbparse.3 | 1 - lib/libdisk/libdisk.3 | 1 - lib/libelf/elf_begin.3 | 1 - lib/libgssapi/gssapi.3 | 1 - lib/libpmc/pmc.p4.3 | 1 - lib/libradius/radius.conf.5 | 1 - lib/libstand/libstand.3 | 4 ---- lib/libtacplus/libtacplus.3 | 1 - lib/libutil/realhostname.3 | 1 - lib/libutil/realhostname_sa.3 | 1 - libexec/ftpd/ftpd.8 | 2 -- libexec/getty/gettytab.5 | 1 - libexec/rtld-elf/rtld.1 | 1 - sbin/camcontrol/camcontrol.8 | 6 ------ sbin/ccdconfig/ccdconfig.8 | 2 -- sbin/devd/devd.conf.5 | 1 - sbin/geom/class/journal/gjournal.8 | 3 --- sbin/geom/class/raid3/graid3.8 | 1 - sbin/ipfw/ipfw.8 | 2 -- sbin/mknod/mknod.8 | 1 - share/man/man3/fpgetround.3 | 3 --- share/man/man4/acpi_hp.4 | 1 - share/man/man4/aue.4 | 2 -- share/man/man4/bpf.4 | 9 --------- share/man/man4/bt.4 | 1 - share/man/man4/bwi.4 | 1 - share/man/man4/bwn.4 | 1 - share/man/man4/cd.4 | 1 - share/man/man4/ch.4 | 1 - share/man/man4/cpuctl.4 | 3 --- share/man/man4/dc.4 | 2 -- share/man/man4/ddb.4 | 1 - share/man/man4/de.4 | 2 -- share/man/man4/digi.4 | 1 - share/man/man4/igmp.4 | 1 - share/man/man4/inet.4 | 1 - share/man/man4/ipw.4 | 1 - share/man/man4/iscsi_initiator.4 | 1 - share/man/man4/isp.4 | 2 -- share/man/man4/iwi.4 | 1 - share/man/man4/iwn.4 | 1 - share/man/man4/joy.4 | 1 - share/man/man4/keyboard.4 | 1 - share/man/man4/led.4 | 1 - share/man/man4/lpbb.4 | 1 - share/man/man4/mac_biba.4 | 1 - share/man/man4/mac_lomac.4 | 1 - share/man/man4/mac_portacl.4 | 1 - share/man/man4/malo.4 | 1 - share/man/man4/meteor.4 | 1 - share/man/man4/mk48txx.4 | 2 -- share/man/man4/mld.4 | 1 - share/man/man4/mtio.4 | 1 - share/man/man4/mwl.4 | 2 -- share/man/man4/netintro.4 | 2 -- share/man/man4/ng_UI.4 | 1 - share/man/man4/ng_async.4 | 1 - share/man/man4/ng_cisco.4 | 1 - share/man/man4/ng_frame_relay.4 | 1 - share/man/man4/ng_gif.4 | 1 - share/man/man4/ng_iface.4 | 1 - share/man/man4/ng_l2cap.4 | 1 - share/man/man4/ng_lmi.4 | 1 - share/man/man4/ng_pppoe.4 | 1 - share/man/man4/ng_rfc1490.4 | 1 - share/man/man4/ng_tee.4 | 1 - share/man/man4/ng_tty.4 | 1 - share/man/man4/ng_vjc.4 | 1 - share/man/man4/pcn.4 | 2 -- share/man/man4/psm.4 | 1 - share/man/man4/pt.4 | 3 +-- share/man/man4/pts.4 | 1 - share/man/man4/pty.4 | 1 - share/man/man4/ral.4 | 1 - share/man/man4/random.4 | 1 - share/man/man4/rl.4 | 2 -- share/man/man4/rum.4 | 1 - share/man/man4/run.4 | 1 - share/man/man4/screen.4 | 1 - share/man/man4/send.4 | 1 - share/man/man4/ses.4 | 1 - share/man/man4/sf.4 | 2 -- share/man/man4/sis.4 | 2 -- share/man/man4/sk.4 | 3 --- share/man/man4/smb.4 | 1 - share/man/man4/snd_hda.4 | 1 - share/man/man4/ste.4 | 2 -- share/man/man4/sym.4 | 2 -- share/man/man4/syscons.4 | 1 - share/man/man4/ti.4 | 2 -- share/man/man4/tl.4 | 2 -- share/man/man4/tx.4 | 1 - share/man/man4/uath.4 | 1 - share/man/man4/upgt.4 | 1 - share/man/man4/ural.4 | 1 - share/man/man4/urtw.4 | 1 - share/man/man4/vr.4 | 2 -- share/man/man4/wb.4 | 2 -- share/man/man4/wi.4 | 2 -- share/man/man4/wpi.4 | 1 - share/man/man4/xl.4 | 2 -- share/man/man5/elf.5 | 8 -------- share/man/man5/link.5 | 6 ------ share/man/man5/make.conf.5 | 1 - share/man/man5/passwd.5 | 1 - share/man/man5/quota.user.5 | 2 -- share/man/man5/resolver.5 | 1 - share/man/man7/firewall.7 | 1 - share/man/man7/sdoc.7 | 1 - share/man/man8/picobsd.8 | 1 - share/man/man8/rc.8 | 1 - share/man/man8/rc.sendmail.8 | 1 - share/man/man9/DB_COMMAND.9 | 2 -- share/man/man9/MD5.9 | 1 - share/man/man9/VOP_READDIR.9 | 1 - share/man/man9/fail.9 | 1 - share/man/man9/ieee80211_ddb.9 | 1 - share/man/man9/ieee80211_radiotap.9 | 2 -- share/man/man9/mbuf.9 | 1 - share/man/man9/style.9 | 1 - share/man/man9/timeout.9 | 2 -- share/man/man9/uio.9 | 1 - share/termcap/termcap.5 | 3 --- sys/boot/common/loader.8 | 1 - usr.bin/chat/chat.8 | 1 - usr.bin/cksum/cksum.1 | 1 - usr.bin/colldef/colldef.1 | 2 -- usr.bin/csup/cpasswd.1 | 1 - usr.bin/gencat/gencat.1 | 1 - usr.bin/getopt/getopt.1 | 2 -- usr.bin/nl/nl.1 | 1 - usr.bin/vmstat/vmstat.8 | 1 - usr.sbin/burncd/burncd.8 | 2 -- usr.sbin/ckdist/ckdist.1 | 1 - usr.sbin/crunch/crunchgen/crunchgen.1 | 2 -- usr.sbin/dconschat/dconschat.8 | 1 - usr.sbin/flowctl/flowctl.8 | 1 - usr.sbin/freebsd-update/freebsd-update.8 | 1 - usr.sbin/i2c/i2c.8 | 1 - usr.sbin/jail/jail.8 | 2 -- usr.sbin/lpr/lpq/lpq.1 | 1 - usr.sbin/lpr/lprm/lprm.1 | 1 - usr.sbin/mergemaster/mergemaster.8 | 1 - usr.sbin/mixer/mixer.8 | 1 - usr.sbin/mlxcontrol/mlxcontrol.8 | 1 - usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 | 1 - usr.sbin/portsnap/portsnap/portsnap.8 | 1 - usr.sbin/pw/pw.8 | 4 ---- usr.sbin/sysinstall/sysinstall.8 | 1 - usr.sbin/vidcontrol/vidcontrol.1 | 1 - 183 files changed, 1 insertion(+), 260 deletions(-) (limited to 'sys/boot') diff --git a/bin/chflags/chflags.1 b/bin/chflags/chflags.1 index 904c366846dc..fe9d700a903f 100644 --- a/bin/chflags/chflags.1 +++ b/bin/chflags/chflags.1 @@ -98,7 +98,6 @@ will also be printed, in octal notation. The flags are specified as an octal number or a comma separated list of keywords. The following keywords are currently defined: -.Pp .Bl -tag -offset indent -width ".Cm opaque" .It Cm arch , archived set the archived flag (super-user only) diff --git a/bin/stty/stty.1 b/bin/stty/stty.1 index 6cecfd6b0581..d2741edb569b 100644 --- a/bin/stty/stty.1 +++ b/bin/stty/stty.1 @@ -419,7 +419,6 @@ Non-Canonical mode input processing (-icanon). .El .Ss Combination Modes: -.Pp .Bl -tag -width Fl .It Ar saved settings Set the current terminal diff --git a/games/caesar/caesar.6 b/games/caesar/caesar.6 index 4f6ac172a9ca..28ffe86086db 100644 --- a/games/caesar/caesar.6 +++ b/games/caesar/caesar.6 @@ -58,13 +58,11 @@ If invoked as a rotation value of 13 will be used. .Pp The frequency (from most common to least) of English letters is as follows: -.Pp .Bd -ragged -offset indent ETAONRISHDLFCMUGPYWBVKXJQZ .Ed .Pp Their frequencies as a percentage are as follows: -.Pp .Bd -ragged -offset indent E(13), T(10.5), A(8.1), O(7.9), N(7.1), R(6.8), I(6.3), S(6.1), H(5.2), D(3.8), L(3.4), F(2.9), C(2.7), M(2.5), U(2.4), G(2), diff --git a/lib/libarchive/libarchive-formats.5 b/lib/libarchive/libarchive-formats.5 index e6849b90bea5..ef4b6ca6255b 100644 --- a/lib/libarchive/libarchive-formats.5 +++ b/lib/libarchive/libarchive-formats.5 @@ -65,7 +65,6 @@ Later variants have extended this by either appropriating undefined areas of the header record, extending the header to multiple records, or by storing special entries that modify the interpretation of subsequent entries. -.Pp .Bl -tag -width indent .It Cm gnutar The diff --git a/lib/libc/gen/confstr.3 b/lib/libc/gen/confstr.3 index 3066aae363dd..9ca4250aa350 100644 --- a/lib/libc/gen/confstr.3 +++ b/lib/libc/gen/confstr.3 @@ -77,7 +77,6 @@ has a value, up to The copied value is always null terminated. .Pp The available values are as follows: -.Pp .Bl -tag -width 6n .It Li _CS_PATH Return a value for the diff --git a/lib/libc/gen/getcap.3 b/lib/libc/gen/getcap.3 index 58aa75725531..73826ae7c0dc 100644 --- a/lib/libc/gen/getcap.3 +++ b/lib/libc/gen/getcap.3 @@ -415,7 +415,6 @@ type `^') and any other value bindings are hidden. The capability abc also has two values bound but only a value of type `$' is prevented from being defined in the capability record more. -.Pp .Bd -unfilled -offset indent file1: new\||\|new_record\||\|a modification of "old":\e diff --git a/lib/libc/gen/stringlist.3 b/lib/libc/gen/stringlist.3 index c55b77d7802a..82465b6055e0 100644 --- a/lib/libc/gen/stringlist.3 +++ b/lib/libc/gen/stringlist.3 @@ -66,7 +66,6 @@ typedef struct _stringlist { size_t sl_cur; } StringList; .Ed -.Pp .Bl -tag -width "sl_str" -offset indent .It Va sl_str a pointer to the base of the array containing the list. diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3 index 9eba6247b713..a841545f2d54 100644 --- a/lib/libc/gen/sysctl.3 +++ b/lib/libc/gen/sysctl.3 @@ -183,7 +183,6 @@ The top level names are defined with a CTL_ prefix in and are as follows. The next and subsequent levels down are found in the include files listed here, and described in separate sections below. -.Pp .Bl -column CTLXMACHDEPXXX "Next level namesXXXXXX" -offset indent .It Sy "Name Next level names Description" .It "CTL_DEBUG sys/sysctl.h Debugging" diff --git a/lib/libc/locale/localeconv.3 b/lib/libc/locale/localeconv.3 index e03515eea538..c4b5746a8f92 100644 --- a/lib/libc/locale/localeconv.3 +++ b/lib/libc/locale/localeconv.3 @@ -80,7 +80,6 @@ struct lconv { .Ed .Pp The individual fields have the following meanings: -.Pp .Bl -tag -width mon_decimal_point .It Va decimal_point The decimal point character, except for currency values, diff --git a/lib/libc/locale/setlocale.3 b/lib/libc/locale/setlocale.3 index 41937caa8028..e0d06e8b8d5e 100644 --- a/lib/libc/locale/setlocale.3 +++ b/lib/libc/locale/setlocale.3 @@ -57,7 +57,6 @@ The .Fn setlocale function recognizes several categories of routines. These are the categories and the sets of routines they select: -.Pp .Bl -tag -width LC_MONETARY .It Dv LC_ALL Set the entire locale generically. diff --git a/lib/libc/net/getnetent.3 b/lib/libc/net/getnetent.3 index f408f7617cab..2e9cd339b0e2 100644 --- a/lib/libc/net/getnetent.3 +++ b/lib/libc/net/getnetent.3 @@ -72,7 +72,6 @@ system. The order of the lookups is controlled by the `networks' entry in .Xr nsswitch.conf 5 . -.Pp .Bd -literal -offset indent struct netent { char *n_name; /* official name of net */ diff --git a/lib/libc/net/getprotoent.3 b/lib/libc/net/getprotoent.3 index b3ded5d9469e..9f9e00daf7b8 100644 --- a/lib/libc/net/getprotoent.3 +++ b/lib/libc/net/getprotoent.3 @@ -64,7 +64,6 @@ following structure containing the broken-out fields of a line in the network protocol data base, .Pa /etc/protocols . -.Pp .Bd -literal -offset indent struct protoent { char *p_name; /* official name of protocol */ diff --git a/lib/libc/net/nsdispatch.3 b/lib/libc/net/nsdispatch.3 index 8ae7540d9be0..d1d8d5a0e71e 100644 --- a/lib/libc/net/nsdispatch.3 +++ b/lib/libc/net/nsdispatch.3 @@ -85,7 +85,6 @@ typedef struct _ns_dtab { void *mdata; } ns_dtab; .Ed -.Pp .Bd -ragged -offset indent The .Fa dtab @@ -133,7 +132,6 @@ typedef struct _ns_src { u_int32_t flags; } ns_src; .Ed -.Pp .Bd -ragged -offset indent The .Fa defaults diff --git a/lib/libc/posix1e/acl_add_flag_np.3 b/lib/libc/posix1e/acl_add_flag_np.3 index 3acde6b2872d..7ae83e28c0d7 100644 --- a/lib/libc/posix1e/acl_add_flag_np.3 +++ b/lib/libc/posix1e/acl_add_flag_np.3 @@ -51,7 +51,6 @@ Note: it is not considered an error to attempt to add flags that already exist in the flagset. .Pp Valid values are: -.Pp .Bl -column -offset 3n "ACL_ENTRY_NO_PROPAGATE_INHERIT" .It ACL_ENTRY_FILE_INHERIT Will be inherited by files. .It ACL_ENTRY_DIRECTORY_INHERIT Will be inherited by directories. diff --git a/lib/libc/posix1e/acl_add_perm.3 b/lib/libc/posix1e/acl_add_perm.3 index 336e55e0a6a2..beb5f98a0f7c 100644 --- a/lib/libc/posix1e/acl_add_perm.3 +++ b/lib/libc/posix1e/acl_add_perm.3 @@ -51,7 +51,6 @@ Note: it is not considered an error to attempt to add permissions that already exist in the permission set. .Pp For POSIX.1e ACLs, valid values are: -.Pp .Bl -column -offset 3n "ACL_WRITE_NAMED_ATTRS" .It ACL_EXECUTE Execute permission .It ACL_WRITE Write permission @@ -59,7 +58,6 @@ For POSIX.1e ACLs, valid values are: .El .Pp For NFSv4 ACLs, valid values are: -.Pp .Bl -column -offset 3n "ACL_WRITE_NAMED_ATTRS" .It ACL_READ_DATA Read permission .It ACL_LIST_DIRECTORY Same as ACL_READ_DATA diff --git a/lib/libc/posix1e/acl_get.3 b/lib/libc/posix1e/acl_get.3 index 651709f7ed42..ae0c48d93822 100644 --- a/lib/libc/posix1e/acl_get.3 +++ b/lib/libc/posix1e/acl_get.3 @@ -95,7 +95,6 @@ decisions. Valid values for the .Va type argument are: -.Pp .Bl -column -offset 3n "ACL_TYPE_DEFAULT" .It ACL_TYPE_ACCESS POSIX.1e access ACL .It ACL_TYPE_DEFAULT POSIX.1e default ACL diff --git a/lib/libc/posix1e/acl_set.3 b/lib/libc/posix1e/acl_set.3 index a6134fed1e94..7450dc93eb9e 100644 --- a/lib/libc/posix1e/acl_set.3 +++ b/lib/libc/posix1e/acl_set.3 @@ -79,7 +79,6 @@ path is a symlink. Valid values for the .Va type argument are: -.Pp .Bl -column -offset 3n "ACL_TYPE_DEFAULT" .It ACL_TYPE_ACCESS POSIX.1e access ACL .It ACL_TYPE_DEFAULT POSIX.1e default ACL diff --git a/lib/libc/posix1e/acl_set_entry_type_np.3 b/lib/libc/posix1e/acl_set_entry_type_np.3 index 9f69babc172b..bda0c481846d 100644 --- a/lib/libc/posix1e/acl_set_entry_type_np.3 +++ b/lib/libc/posix1e/acl_set_entry_type_np.3 @@ -48,7 +48,6 @@ to the value referred to by .Fa entry_type . .Pp Valid values are: -.Pp .Bl -column -offset 3n "ACL_ENTRY_TYPE_ALLOW" .It ACL_ENTRY_TYPE_ALLOW "allow" type entry .It ACL_ENTRY_TYPE_DENY "deny" type entry diff --git a/lib/libc/posix1e/acl_set_tag_type.3 b/lib/libc/posix1e/acl_set_tag_type.3 index 25689224c621..88aad72b2c7b 100644 --- a/lib/libc/posix1e/acl_set_tag_type.3 +++ b/lib/libc/posix1e/acl_set_tag_type.3 @@ -48,7 +48,6 @@ to the value of .Fa tag_type . .Pp Valid values are: -.Pp .Bl -column -offset 3n "ACL_OTHER_OBJ" .It ACL_USER_OBJ Permissions apply to file owner .It ACL_USER Permissions apply to additional user specified by qualifier diff --git a/lib/libc/regex/re_format.7 b/lib/libc/regex/re_format.7 index 463c6a27969e..a2a527da519e 100644 --- a/lib/libc/regex/re_format.7 +++ b/lib/libc/regex/re_format.7 @@ -275,7 +275,6 @@ and stands for the list of all characters belonging to that class. Standard character class names are: -.Pp .Bl -column "alnum" "digit" "xdigit" -offset indent .It Em "alnum digit punct" .It Em "alpha graph space" diff --git a/lib/libc/stdlib/malloc.3 b/lib/libc/stdlib/malloc.3 index 2f21b6a5294e..9f49b2e56e42 100644 --- a/lib/libc/stdlib/malloc.3 +++ b/lib/libc/stdlib/malloc.3 @@ -550,7 +550,6 @@ allocation functions. .El .Sh EXAMPLES To dump core whenever a problem occurs: -.Pp .Bd -literal -offset indent ln -s 'A' /etc/malloc.conf .Ed diff --git a/lib/libc/stdlib/strtod.3 b/lib/libc/stdlib/strtod.3 index a6e8af8a283c..e19e5febb136 100644 --- a/lib/libc/stdlib/strtod.3 +++ b/lib/libc/stdlib/strtod.3 @@ -173,7 +173,6 @@ conforms to .Sh AUTHORS The author of this software is .An David M. Gay . -.Pp .Bd -literal Copyright (c) 1998 by Lucent Technologies All Rights Reserved diff --git a/lib/libc/sys/aio_read.2 b/lib/libc/sys/aio_read.2 index 2c780404f904..ddf4f7630239 100644 --- a/lib/libc/sys/aio_read.2 +++ b/lib/libc/sys/aio_read.2 @@ -136,7 +136,6 @@ system call must be called, and will return -1, and must be called to determine the actual value that would have been returned in .Va errno . -.Pp .Bl -tag -width Er .It Bq Er EBADF The diff --git a/lib/libc/sys/aio_write.2 b/lib/libc/sys/aio_write.2 index dd1e0f589cf8..291fd7154bf7 100644 --- a/lib/libc/sys/aio_write.2 +++ b/lib/libc/sys/aio_write.2 @@ -140,7 +140,6 @@ system call must be called, and will return -1, and must be called to determine the actual value that would have been returned in .Va errno . -.Pp .Bl -tag -width Er .It Bq Er EBADF The diff --git a/lib/libc/sys/clock_gettime.2 b/lib/libc/sys/clock_gettime.2 index a2fa62490ecc..583cc8f4fdd0 100644 --- a/lib/libc/sys/clock_gettime.2 +++ b/lib/libc/sys/clock_gettime.2 @@ -102,7 +102,6 @@ The structure pointed to by is defined in .In sys/timespec.h as: -.Pp .Bd -literal struct timespec { time_t tv_sec; /* seconds */ diff --git a/lib/libc/sys/gettimeofday.2 b/lib/libc/sys/gettimeofday.2 index 9ffd0b3bcd3a..23cc059ecbc3 100644 --- a/lib/libc/sys/gettimeofday.2 +++ b/lib/libc/sys/gettimeofday.2 @@ -75,7 +75,6 @@ and are defined in .In sys/time.h as: -.Pp .Bd -literal struct timeval { time_t tv_sec; /* seconds */ diff --git a/lib/libc/sys/kldstat.2 b/lib/libc/sys/kldstat.2 index 88f3781f482c..0d28928d02fa 100644 --- a/lib/libc/sys/kldstat.2 +++ b/lib/libc/sys/kldstat.2 @@ -56,7 +56,6 @@ struct kld_file_stat { char pathname[MAXPATHLEN]; }; .Ed -.Pp .Bl -tag -width XXXaddress .It version This field is set to the size of the structure mentioned above by the code diff --git a/lib/libc/sys/kldsym.2 b/lib/libc/sys/kldsym.2 index acd6fcd77b14..917a92ad210d 100644 --- a/lib/libc/sys/kldsym.2 +++ b/lib/libc/sys/kldsym.2 @@ -55,7 +55,6 @@ implemented is The .Fa data argument is of the following structure: -.Pp .Bd -literal -offset indent struct kld_sym_lookup { int version; /* sizeof(struct kld_sym_lookup) */ diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index 74cd72a2ae56..a1b61775ce36 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -251,7 +251,6 @@ Takes a descriptor as the identifier, and returns whenever there is data available to read. The behavior of the filter is slightly different depending on the descriptor type. -.Pp .Bl -tag -width 2n .It Sockets Sockets which have previously been passed to diff --git a/lib/libc/sys/modstat.2 b/lib/libc/sys/modstat.2 index 439cce7bd48e..5f106b4b1af3 100644 --- a/lib/libc/sys/modstat.2 +++ b/lib/libc/sys/modstat.2 @@ -60,7 +60,6 @@ typedef union modspecific { u_long ulongval; } modspecific_t; .Ed -.Pp .Bl -tag -width XXXaddress .It version This field is set to the size of the structure mentioned above by the code diff --git a/lib/libc/sys/recv.2 b/lib/libc/sys/recv.2 index e45863e11157..66f311fef783 100644 --- a/lib/libc/sys/recv.2 +++ b/lib/libc/sys/recv.2 @@ -165,7 +165,6 @@ system call uses a structure to minimize the number of directly supplied arguments. This structure has the following form, as defined in .In sys/socket.h : -.Pp .Bd -literal struct msghdr { void *msg_name; /* optional address */ @@ -242,7 +241,6 @@ should be a structure of type which is defined in .In sys/socket.h as follows: -.Pp .Bd -literal struct cmsgcred { pid_t cmcred_pid; /* PID of sending process */ diff --git a/lib/libc/sys/sched_setscheduler.2 b/lib/libc/sys/sched_setscheduler.2 index 21b34e038190..3e7c42b7ca7f 100644 --- a/lib/libc/sys/sched_setscheduler.2 +++ b/lib/libc/sys/sched_setscheduler.2 @@ -95,7 +95,6 @@ The .Vt sched_param structure is defined in .Fa : -.Pp .Bd -literal -offset indent struct sched_param { int sched_priority; /* scheduling priority */ diff --git a/lib/libc/uuid/uuid.3 b/lib/libc/uuid/uuid.3 index 471629fb6bf0..4d1020471eab 100644 --- a/lib/libc/uuid/uuid.3 +++ b/lib/libc/uuid/uuid.3 @@ -108,7 +108,6 @@ the .Fa status argument. Possible values are: -.Pp .Bl -tag -width ".Dv uuid_s_invalid_string_uuid" .It Dv uuid_s_ok The function completed successfully. diff --git a/lib/libcam/cam_cdbparse.3 b/lib/libcam/cam_cdbparse.3 index 35a595151f3b..0dfa6c8c8903 100644 --- a/lib/libcam/cam_cdbparse.3 +++ b/lib/libcam/cam_cdbparse.3 @@ -258,7 +258,6 @@ typedef enum { Multiple flags should be ORed together. Any of the CCB flags may be used, although it is worth noting several important ones here: -.Pp .Bl -tag -width CAM_PASS_ERR_RECOVER .It Dv CAM_DIR_IN This indicates that the operation in question is a read operation. diff --git a/lib/libdisk/libdisk.3 b/lib/libdisk/libdisk.3 index 525513ff3860..1b436e24c514 100644 --- a/lib/libdisk/libdisk.3 +++ b/lib/libdisk/libdisk.3 @@ -153,7 +153,6 @@ struct disk { The only flag value by now is .Ql DISK_ON_TRACK , meaning that this disk is handled by the On-Track Disk Manager. -.Pp .Bd -literal -offset indent struct chunk { struct chunk *next; diff --git a/lib/libelf/elf_begin.3 b/lib/libelf/elf_begin.3 index 283d33a34500..ea68c26c6f88 100644 --- a/lib/libelf/elf_begin.3 +++ b/lib/libelf/elf_begin.3 @@ -222,7 +222,6 @@ elf_end(e); Function .Fn elf_begin can fail with the following errors: -.Pp .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARCHIVE The archive denoted by argument diff --git a/lib/libgssapi/gssapi.3 b/lib/libgssapi/gssapi.3 index f92da590dfda..121d9e42e6e6 100644 --- a/lib/libgssapi/gssapi.3 +++ b/lib/libgssapi/gssapi.3 @@ -51,7 +51,6 @@ and to apply security services such as confidentiality and integrity on a per-message basis. .Pp There are four stages to using the GSS-API: -.Pp .Bl -tag -width "a)" .It a) The application acquires a set of credentials with which it may prove diff --git a/lib/libpmc/pmc.p4.3 b/lib/libpmc/pmc.p4.3 index e13fa6ec5ea4..cd0da4f3d8d1 100644 --- a/lib/libpmc/pmc.p4.3 +++ b/lib/libpmc/pmc.p4.3 @@ -174,7 +174,6 @@ Only TS events are allowed for use with process-mode PMCs on Pentium-4/HTT CPUs. .Pp The event specifiers supported by Intel P4 PMCs are: -.Pp .Bl -tag -width indent .It Li p4-128bit-mmx-uop Op Li ,mask= Ns Ar flags .Pq "TI event" diff --git a/lib/libradius/radius.conf.5 b/lib/libradius/radius.conf.5 index 6fa5cd78a587..6ac84e07cc3f 100644 --- a/lib/libradius/radius.conf.5 +++ b/lib/libradius/radius.conf.5 @@ -75,7 +75,6 @@ and the backslash can be represented by .Ql \e\e . No other escape sequences are supported. .Pp -.Pp The first field gives the service type, either .Ql auth for RADIUS authentication or diff --git a/lib/libstand/libstand.3 b/lib/libstand/libstand.3 index d1c544ca7687..2938e2d90cb1 100644 --- a/lib/libstand/libstand.3 +++ b/lib/libstand/libstand.3 @@ -270,7 +270,6 @@ The .Li b conversion is provided to decode error registers. Its usage is: -.Pp .Bd -ragged -offset indent printf( .Qq reg=%b\en , @@ -285,7 +284,6 @@ Each is a sequence of characters, the first of which gives the bit number to be inspected (origin 1) and the next characters (up to a character less than 32) give the text to be displayed if the bit is set. Thus -.Pp .Bd -ragged -offset indent printf( .Qq reg=%b\en , @@ -295,7 +293,6 @@ printf( .Ed .Pp would give the output -.Pp .Bd -ragged -offset indent reg=3 .Ed @@ -303,7 +300,6 @@ reg=3 The .Li D conversion provides a hexdump facility, e.g. -.Pp .Bd -ragged -offset indent printf( .Qq %6D , diff --git a/lib/libtacplus/libtacplus.3 b/lib/libtacplus/libtacplus.3 index f76bc9d53e48..d74e1e145ea0 100644 --- a/lib/libtacplus/libtacplus.3 +++ b/lib/libtacplus/libtacplus.3 @@ -148,7 +148,6 @@ The parameter is a bit mask of flags to specify various characteristics of the server. It may contain: -.Pp .Bl -tag -width Fl .It Dv TAC_SRVR_SINGLE_CONNECT Causes the library to attempt to negotiate single connection mode diff --git a/lib/libutil/realhostname.3 b/lib/libutil/realhostname.3 index 9f5a6c5ddc6e..0300ed3525b5 100644 --- a/lib/libutil/realhostname.3 +++ b/lib/libutil/realhostname.3 @@ -76,7 +76,6 @@ The .Fn realhostname function will return one of the following constants which are defined in .In libutil.h : -.Pp .Bl -tag -width XXX -offset XXX .It Li HOSTNAME_FOUND A valid host name was found. diff --git a/lib/libutil/realhostname_sa.3 b/lib/libutil/realhostname_sa.3 index 3fd44a442b11..cd76b0773d42 100644 --- a/lib/libutil/realhostname_sa.3 +++ b/lib/libutil/realhostname_sa.3 @@ -105,7 +105,6 @@ The .Fn realhostname_sa function will return one of the following constants which are defined in .In libutil.h : -.Pp .Bl -tag -width XXX -offset XXX .It Li HOSTNAME_FOUND A valid host name was found. diff --git a/libexec/ftpd/ftpd.8 b/libexec/ftpd/ftpd.8 index d7e5deb776c7..543e1c0a5033 100644 --- a/libexec/ftpd/ftpd.8 +++ b/libexec/ftpd/ftpd.8 @@ -304,7 +304,6 @@ The following non-standard or specific commands are supported by the SITE request. -.Pp .Bl -column Request -offset indent .It Sy Request Ta Sy Description .It UMASK Ta change umask, e.g. ``SITE UMASK 002'' @@ -347,7 +346,6 @@ This allows users to utilize the metacharacters The .Nm utility authenticates users according to six rules. -.Pp .Bl -enum -offset indent .It The login name must be in the password data base diff --git a/libexec/getty/gettytab.5 b/libexec/getty/gettytab.5 index 7b475b191781..3f790766a3e8 100644 --- a/libexec/getty/gettytab.5 +++ b/libexec/getty/gettytab.5 @@ -290,7 +290,6 @@ may include any of the following character sequences, which expand to information about the environment in which .Xr getty 8 is running. -.Pp .Bl -tag -offset indent -width \&%xxxxxxxxxxxxxx .It \&%d The current date and time formatted according to the diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 839d5f198016..592cb95a42e7 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -105,7 +105,6 @@ all the environment variables listed below, but is being prefixed with .Ev LD_32_ , for example: .Ev LD_32_TRACE_LOADED_OBJECTS . -.Pp .Bl -tag -width ".Ev LD_LIBMAP_DISABLE" .It Ev LD_DUMP_REL_POST If set, diff --git a/sbin/camcontrol/camcontrol.8 b/sbin/camcontrol/camcontrol.8 index d33bfcaa08c5..f9c8eee08487 100644 --- a/sbin/camcontrol/camcontrol.8 +++ b/sbin/camcontrol/camcontrol.8 @@ -800,7 +800,6 @@ The and .Fl y arguments can be useful for scripts. -.Pp .Bl -tag -width 6n .It Fl q Be quiet, do not print any status messages. @@ -893,7 +892,6 @@ utility will report whether the disk is ready, but will not display sense information if the command fails since the .Fl v switch was not specified. -.Pp .Bd -literal -offset indent camcontrol tur da1 -E -C 4 -t 50 -v .Ed @@ -920,7 +918,6 @@ Display the buffer size of cd1, and display the first 10 bytes from the cache on cd1. Display SCSI sense information if the command fails. -.Pp .Bd -literal -offset indent camcontrol cmd -n cd -u 1 -v -c "3B 00 00 00 00 00 00 00 0e 00" \e -o 14 "00 00 00 00 1 2 3 4 5 6 v v v v" 7 8 9 8 @@ -933,7 +930,6 @@ Print out sense information if the command fails. Be very careful with this command, improper use may cause data corruption. -.Pp .Bd -literal -offset indent camcontrol modepage da3 -m 1 -e -P 3 .Ed @@ -960,13 +956,11 @@ changed. .Dl camcontrol tags da5 -N 24 .Pp Set the number of concurrent transactions for da5 to 24. -.Pp .Bd -literal -offset indent camcontrol negotiate -n da -u 4 -T disable .Ed .Pp Disable tagged queueing for da4. -.Pp .Bd -literal -offset indent camcontrol negotiate -n da -u 3 -R 20.000 -O 15 -a .Ed diff --git a/sbin/ccdconfig/ccdconfig.8 b/sbin/ccdconfig/ccdconfig.8 index f5f4224b5e30..cc29f717528b 100644 --- a/sbin/ccdconfig/ccdconfig.8 +++ b/sbin/ccdconfig/ccdconfig.8 @@ -161,7 +161,6 @@ The last example is a simple mirror. The 2nd slice of /dev/da8 is mirrored with the 3rd slice of /dev/da9 and assigned to ccd0. -.Pp .Bd -literal # ccdconfig ccd0 64 none /dev/da0s1 /dev/da1s1 /dev/da2s1 /dev/da3s1 # ccdconfig ccd0 128 CCDF_MIRROR /dev/da4 /dev/da5 /dev/da6 /dev/da7 @@ -203,7 +202,6 @@ partition such that it does not overlap the label area. For example, if you have A ccd disk with 10000 sectors you might create a 'd' partition with offset 16 and size 9984. -.Pp .Bd -literal # disklabel ccd0 > /tmp/disklabel.ccd0 # disklabel -Rr ccd0 /tmp/disklabel.ccd0 diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index 41e7f5dd1e1f..61643a7afe3f 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -94,7 +94,6 @@ In this way generic statements can be overridden for devices or notifications that require special attention. .Pp The general syntax of a statement is: -.Pp .Bd -literal -offset indent statement priority { substatement "value"; diff --git a/sbin/geom/class/journal/gjournal.8 b/sbin/geom/class/journal/gjournal.8 index 0aad6ae31cdb..edef9023eb56 100644 --- a/sbin/geom/class/journal/gjournal.8 +++ b/sbin/geom/class/journal/gjournal.8 @@ -240,7 +240,6 @@ change the value. .It "record_entries integer yes" .It "optimize integer yes" .El -.Pp .Bl -tag -width 6n .It Li debug Setting a non-zero value enables debugging at various levels. @@ -284,7 +283,6 @@ privilege may change the value. .It "misses integer yes" .It "alloc_failures integer yes" .El -.Pp .Bl -tag -width 6n .It Li used The number of bytes currently allocated to the cache. @@ -317,7 +315,6 @@ privilege may change the value. .It "journal_full integer yes" .It "low_mem integer yes" .El -.Pp .Bl -tag -width 6n .It Li skipped_bytes The number of bytes skipped. diff --git a/sbin/geom/class/raid3/graid3.8 b/sbin/geom/class/raid3/graid3.8 index f9ea0cace592..31ba50a29437 100644 --- a/sbin/geom/class/raid3/graid3.8 +++ b/sbin/geom/class/raid3/graid3.8 @@ -221,7 +221,6 @@ graid3 stop data graid3 unload .Ed .Pp -.Pp Create a RAID3 array, but do not use the automatic synchronization feature. Rebuild parity component: .Bd -literal -offset indent diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index a7efd6f9eac5..7a2ff9b222fa 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -184,7 +184,6 @@ See Section for more information on .Em sets . .Pp -.Pp Rules can be added with the .Cm add command; deleted individually or in groups with the @@ -1091,7 +1090,6 @@ will match the following IP addresses: .It Ar addr6-list : ip6-addr Ns Op Ns , Ns Ar addr6-list .It Ar ip6-addr : A host or subnet specified one of the following ways: -.Pp .Bl -tag -width indent .It Ar numeric-ip | hostname Matches a single IPv6 address as allowed by diff --git a/sbin/mknod/mknod.8 b/sbin/mknod/mknod.8 index 22efbd1280fe..fd58ba138926 100644 --- a/sbin/mknod/mknod.8 +++ b/sbin/mknod/mknod.8 @@ -55,7 +55,6 @@ The .Nm utility creates device special files. To make nodes manually, the arguments are: -.Pp .Bl -tag -width indent .It Ar name Device name, for example diff --git a/share/man/man3/fpgetround.3 b/share/man/man3/fpgetround.3 index 73fc1a08d975..1e93c849f4c9 100644 --- a/share/man/man3/fpgetround.3 +++ b/share/man/man3/fpgetround.3 @@ -47,7 +47,6 @@ .Nd IEEE floating point interface .Sh SYNOPSIS .In ieeefp.h -.Pp .Bd -literal typedef enum { FP_RN, /* round to nearest */ @@ -60,7 +59,6 @@ typedef enum { .Fn fpgetround void .Ft fp_rnd_t .Fn fpsetround "fp_rnd_t direction" -.Pp .Bd -literal typedef enum { FP_PS, /* 24 bit (single-precision) */ @@ -73,7 +71,6 @@ typedef enum { .Fn fpgetprec void .Ft fp_prec_t .Fn fpsetprec "fp_prec_t precision" -.Pp .Bd -literal #define fp_except_t int #define FP_X_INV 0x01 /* invalid operation */ diff --git a/share/man/man4/acpi_hp.4 b/share/man/man4/acpi_hp.4 index 94828d71b0c2..031d850b3afa 100644 --- a/share/man/man4/acpi_hp.4 +++ b/share/man/man4/acpi_hp.4 @@ -266,7 +266,6 @@ driver was written by .Pp It has been inspired by hp-wmi driver, which implements a subset of these features (hotkeys) on Linux. -.Pp .Bl -tag -width indent .It HP CMI whitepaper: http://h20331.www2.hp.com/Hpsub/downloads/cmi_whitepaper.pdf diff --git a/share/man/man4/aue.4 b/share/man/man4/aue.4 index 3737f2449586..c708c8948fdd 100644 --- a/share/man/man4/aue.4 +++ b/share/man/man4/aue.4 @@ -80,7 +80,6 @@ received and transmitted over separate USB bulk transfer endpoints. The .Nm driver supports the following media types: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It autoselect Enable autoselection of the media type and options. @@ -117,7 +116,6 @@ mode. The .Nm driver supports the following media options: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It full-duplex Force full duplex operation. diff --git a/share/man/man4/bpf.4 b/share/man/man4/bpf.4 index 85beb07cd68f..e69456a2d5fd 100644 --- a/share/man/man4/bpf.4 +++ b/share/man/man4/bpf.4 @@ -804,7 +804,6 @@ are the corresponding fields in the instruction definition. .Dq len refers to the length of the packet. -.Pp .Bl -tag -width BPF_STXx .It Dv BPF_LD These instructions copy a value into the accumulator. @@ -833,7 +832,6 @@ or byte The semantics of all the recognized .Dv BPF_LD instructions follow. -.Pp .Bd -literal BPF_LD+BPF_W+BPF_ABS A <- P[k:4] BPF_LD+BPF_H+BPF_ABS A <- P[k:2] @@ -852,7 +850,6 @@ the addressing modes are more restrictive than those of the accumulator loads, but they include .Dv BPF_MSH , a hack for efficiently loading the IP header length. -.Pp .Bd -literal BPF_LDX+BPF_W+BPF_IMM X <- k BPF_LDX+BPF_W+BPF_MEM X <- M[k] @@ -863,13 +860,11 @@ BPF_LDX+BPF_B+BPF_MSH X <- 4*(P[k:1]&0xf) This instruction stores the accumulator into the scratch memory. We do not need an addressing mode since there is only one possibility for the destination. -.Pp .Bd -literal BPF_ST M[k] <- A .Ed .It Dv BPF_STX This instruction stores the index register in the scratch memory store. -.Pp .Bd -literal BPF_STX M[k] <- X .Ed @@ -880,7 +875,6 @@ For binary operations, a source mode is required .Dv ( BPF_K or .Dv BPF_X ) . -.Pp .Bd -literal BPF_ALU+BPF_ADD+BPF_K A <- A + k BPF_ALU+BPF_SUB+BPF_K A <- A - k @@ -916,7 +910,6 @@ opcode uses the 32 bit .Li k field as the offset, allowing arbitrarily distant destinations. All conditionals use unsigned comparison conventions. -.Pp .Bd -literal BPF_JMP+BPF_JA pc += k BPF_JMP+BPF_JGT+BPF_K pc += (A > k) ? jt : jf @@ -936,7 +929,6 @@ The return value is either a constant .Pq Dv BPF_K or the accumulator .Pq Dv BPF_A . -.Pp .Bd -literal BPF_RET+BPF_A accept A bytes BPF_RET+BPF_K accept k bytes @@ -947,7 +939,6 @@ fit into the above classes, and for any new instructions that might need to be added. Currently, these are the register transfer instructions that copy the index register to the accumulator or vice versa. -.Pp .Bd -literal BPF_MISC+BPF_TAX X <- A BPF_MISC+BPF_TXA A <- X diff --git a/share/man/man4/bt.4 b/share/man/man4/bt.4 index be1981956162..c4c20e1f9566 100644 --- a/share/man/man4/bt.4 +++ b/share/man/man4/bt.4 @@ -50,7 +50,6 @@ In This driver provides access to the .Tn SCSI bus connected to a Buslogic/Mylex MultiMaster or compatible controller: -.Pp .Bd -ragged -offset indent .Bl -column "BT-956CD " "ISA " "Commands " Description MultiMaster "W" Series Host Adapters: diff --git a/share/man/man4/bwi.4 b/share/man/man4/bwi.4 index c9f8a391f02a..0dde87f5732b 100644 --- a/share/man/man4/bwi.4 +++ b/share/man/man4/bwi.4 @@ -106,7 +106,6 @@ The v4 version of the firmware that uses does not support these chips. .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev bwi0 inet 192.168.0.20 \e netmask 0xffffff00 diff --git a/share/man/man4/bwn.4 b/share/man/man4/bwn.4 index 679f03e23581..f0d95bd2720f 100644 --- a/share/man/man4/bwn.4 +++ b/share/man/man4/bwn.4 @@ -96,7 +96,6 @@ because the v4 version of the firmware does not support these chips. The newer firmware is too big to fit into these old chips. .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev bwn0 inet 192.168.0.20 \e netmask 0xffffff00 diff --git a/share/man/man4/cd.4 b/share/man/man4/cd.4 index ed8853539611..62b35773735f 100644 --- a/share/man/man4/cd.4 +++ b/share/man/man4/cd.4 @@ -102,7 +102,6 @@ in the header files .In sys/cdio.h and .In sys/disklabel.h . -.Pp .Bl -tag -width CDIOCREADSUBCHANNEL .It Dv DIOCGDINFO .It Dv DIOCSDINFO diff --git a/share/man/man4/ch.4 b/share/man/man4/ch.4 index 6bd2df40d0a9..b45ecaa0d538 100644 --- a/share/man/man4/ch.4 +++ b/share/man/man4/ch.4 @@ -96,7 +96,6 @@ calls apply to the changer. They are defined in the header file .In sys/chio.h . -.Pp .Bl -tag -width CHIOEXCHANGE .It Dv CHIOMOVE .Pq Vt "struct changer_move" diff --git a/share/man/man4/cpuctl.4 b/share/man/man4/cpuctl.4 index bf1bddeb83e7..9e3a2aaf783d 100644 --- a/share/man/man4/cpuctl.4 +++ b/share/man/man4/cpuctl.4 @@ -74,7 +74,6 @@ The structure is defined in .In sys/cpuctl.h as: -.Pp .Bd -literal typedef struct { int msr; /* MSR to read */ @@ -90,7 +89,6 @@ field. Retrieve CPUID information. Arguments are supplied in the following struct: -.Pp .Bd -literal typedef struct { int level; /* CPUID level */ @@ -108,7 +106,6 @@ Update CPU firmware (microcode). The structure is defined in .In sys/cpuctl.h as: -.Pp .Bd -literal typedef struct { void *data; diff --git a/share/man/man4/dc.4 b/share/man/man4/dc.4 index e24416cadc45..6628d735028d 100644 --- a/share/man/man4/dc.4 +++ b/share/man/man4/dc.4 @@ -92,7 +92,6 @@ difficult to provide a complete list of all supported cards. The .Nm driver supports the following media types: -.Pp .Bl -tag -width ".Cm 10baseT/UTP" .It Cm autoselect Enable autoselection of the media type and options. @@ -138,7 +137,6 @@ mode. The .Nm driver supports the following media options: -.Pp .Bl -tag -width ".Cm full-duplex" .It Cm full-duplex Force full duplex operation. diff --git a/share/man/man4/ddb.4 b/share/man/man4/ddb.4 index 2e1d2f5888c3..e3594cc4b22c 100644 --- a/share/man/man4/ddb.4 +++ b/share/man/man4/ddb.4 @@ -802,7 +802,6 @@ Displays short info about all currently mounted file systems. .Pp .It Ic show Cm mount Ar addr Displays details about the given mount point. -.Pp .\" .Pp .It Ic show Cm object Ns Oo Li / Ns Cm f Oc Ar addr diff --git a/share/man/man4/de.4 b/share/man/man4/de.4 index 28287ef3c116..c9f25ad31b89 100644 --- a/share/man/man4/de.4 +++ b/share/man/man4/de.4 @@ -55,7 +55,6 @@ chips. The .Nm driver supports the following media types: -.Pp .Bl -tag -width xxxxxxxxxxxxxxx .It autoselect Enable autoselection of the media type and options @@ -76,7 +75,6 @@ Set 100Mbps operation (4-pair cat-3 cable) The .Nm driver supports the following media options: -.Pp .Bl -tag -width xxxxxxxxxxxxxxx .It full-duplex Set full duplex operation diff --git a/share/man/man4/digi.4 b/share/man/man4/digi.4 index e33e365cecf1..f84ac78e0adb 100644 --- a/share/man/man4/digi.4 +++ b/share/man/man4/digi.4 @@ -51,7 +51,6 @@ likely be gone over with a fine tooth comb to reflect differences with the digi driver. .Pp When not defined the number is computed: -.Pp .Bd -ragged -offset 4n default .Dv NDGBPORTS diff --git a/share/man/man4/igmp.4 b/share/man/man4/igmp.4 index 7c711c4fe1d4..696fa7da667e 100644 --- a/share/man/man4/igmp.4 +++ b/share/man/man4/igmp.4 @@ -61,7 +61,6 @@ they are only interested in receiving multicast streams from particular sources. .\" .Sh SYSCTL VARIABLES -.Pp .Bl -tag -width indent .\" .It net.inet.igmp.stats diff --git a/share/man/man4/inet.4 b/share/man/man4/inet.4 index ef189d32c023..e64b60a286da 100644 --- a/share/man/man4/inet.4 +++ b/share/man/man4/inet.4 @@ -141,7 +141,6 @@ they have the same form as the .Dv SIOCIFADDR command (see .Xr intro 4 ) . -.Pp .Bl -tag -width SIOCSIFNETMASK .It Dv SIOCSIFNETMASK Set interface network mask. diff --git a/share/man/man4/ipw.4 b/share/man/man4/ipw.4 index 060058a09816..cfa7de7e65fa 100644 --- a/share/man/man4/ipw.4 +++ b/share/man/man4/ipw.4 @@ -90,7 +90,6 @@ firmware license .El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev ipw0 inet 192.168.0.20 \e netmask 0xffffff00 diff --git a/share/man/man4/iscsi_initiator.4 b/share/man/man4/iscsi_initiator.4 index 24cd8985ab2f..7c857bd22b57 100644 --- a/share/man/man4/iscsi_initiator.4 +++ b/share/man/man4/iscsi_initiator.4 @@ -64,7 +64,6 @@ the initiator part of the Session Identifier. .El .Pp The following are informative only: -.Pp .Bl -tag -width "net.iscsi.n.targedaddress" .It Va net.iscsi.driver_version the current version of the driver. diff --git a/share/man/man4/isp.4 b/share/man/man4/isp.4 index d3e91168344f..9de6da591bee 100644 --- a/share/man/man4/isp.4 +++ b/share/man/man4/isp.4 @@ -94,7 +94,6 @@ as it is the most likely to have been tested with this driver. Cards supported by the .Nm driver include: -.Pp .Bl -tag -width xxxxxx -offset indent .It ISP1000 SBus Fast Wide, Ultra Fast Wide cards, Single Ended or Differential @@ -201,7 +200,6 @@ A hint value for a driver debug level (see the file for the values. .El .Sh SYSCTL OPTIONS -.Pp .Bl -tag -width indent .It Va dev.isp.N.loop_down_limit This value says how long to wait in seconds after loop has gone down before diff --git a/share/man/man4/iwi.4 b/share/man/man4/iwi.4 index 64f5c0ed13af..7428542d9b2e 100644 --- a/share/man/man4/iwi.4 +++ b/share/man/man4/iwi.4 @@ -90,7 +90,6 @@ firmware license .El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev iwi0 inet 192.168.0.20 \e netmask 0xffffff00 diff --git a/share/man/man4/iwn.4 b/share/man/man4/iwn.4 index 557d258cc965..370241a4db38 100644 --- a/share/man/man4/iwn.4 +++ b/share/man/man4/iwn.4 @@ -96,7 +96,6 @@ This driver requires the firmware built with the module to work. .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev iwn0 inet 192.168.0.20 \e netmask 0xffffff00 diff --git a/share/man/man4/joy.4 b/share/man/man4/joy.4 index b0839f5f2d79..4de2f5a6ee41 100644 --- a/share/man/man4/joy.4 +++ b/share/man/man4/joy.4 @@ -39,7 +39,6 @@ This device may be opened by only one process at a time. The joystick status is read from a structure via a read() call. The structure is defined in the header file as follows: -.Pp .Bd -literal -offset indent struct joystick { int x; /* x position */ diff --git a/share/man/man4/keyboard.4 b/share/man/man4/keyboard.4 index e1a5ac28d41a..8cff2924e8fb 100644 --- a/share/man/man4/keyboard.4 +++ b/share/man/man4/keyboard.4 @@ -63,7 +63,6 @@ The meaning of every key is programmable via the PIO_KEYMAP ioctl call, that takes a structure keymap_t as argument. The layout of this structure is as follows: -.Pp .Bd -literal -offset indent struct keymap { u_short n_keys; diff --git a/share/man/man4/led.4 b/share/man/man4/led.4 index 63bb8a28ecd4..b31a083c034b 100644 --- a/share/man/man4/led.4 +++ b/share/man/man4/led.4 @@ -169,7 +169,6 @@ A flashes .Pp .Dl *_*__**_ -.Pp .Bd -literal /usr/games/morse -l "Soekris rocks" > /dev/led/error .Ed diff --git a/share/man/man4/lpbb.4 b/share/man/man4/lpbb.4 index 77e70c57b118..89b2a07a2e77 100644 --- a/share/man/man4/lpbb.4 +++ b/share/man/man4/lpbb.4 @@ -40,7 +40,6 @@ The .Em lpbb driver supports the Philips official I2C parallel bit-banging interface. -.Pp .Bd -literal LS05 pin 14 (Vcc) o ------- diff --git a/share/man/man4/mac_biba.4 b/share/man/man4/mac_biba.4 index 265f5710edcf..7b7cf6eb0e8f 100644 --- a/share/man/man4/mac_biba.4 +++ b/share/man/man4/mac_biba.4 @@ -151,7 +151,6 @@ In general, objects labels are represented in the following form: .Sm on .Pp For example: -.Pp .Bd -literal -offset indent biba/10:2+3+6 biba/low diff --git a/share/man/man4/mac_lomac.4 b/share/man/man4/mac_lomac.4 index e82513705c7d..80f2daf45fbc 100644 --- a/share/man/man4/mac_lomac.4 +++ b/share/man/man4/mac_lomac.4 @@ -108,7 +108,6 @@ In general, objects labels are represented in the following form: .Sm on .Pp For example: -.Pp .Bd -literal -offset indent lomac/10[2] lomac/low diff --git a/share/man/man4/mac_portacl.4 b/share/man/man4/mac_portacl.4 index 698852d579ef..2ecee26ca2fa 100644 --- a/share/man/man4/mac_portacl.4 +++ b/share/man/man4/mac_portacl.4 @@ -139,7 +139,6 @@ The port access control list is specified in the following format: .Sm off .D1 Ar idtype : id : protocol : port Op , Ar idtype : id : protocol : port , ... .Sm on -.Pp .Bl -tag -width ".Ar protocol" .It Ar idtype Describes the type of subject match to be performed. diff --git a/share/man/man4/malo.4 b/share/man/man4/malo.4 index 8a3c7239b90a..eb8c2edf78e0 100644 --- a/share/man/man4/malo.4 +++ b/share/man/man4/malo.4 @@ -97,7 +97,6 @@ U-Khan UW-2054i 88W8335 PCI b/g .El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev malo0 inet 192.168.0.20 \e netmask 0xffffff00 diff --git a/share/man/man4/meteor.4 b/share/man/man4/meteor.4 index 860e08e65f44..77765defcde3 100644 --- a/share/man/man4/meteor.4 +++ b/share/man/man4/meteor.4 @@ -468,7 +468,6 @@ routines use the .Va meteor_geomet structure that has the following entries: -.Pp .Bl -tag -width columns .It Va rows number of rows (lines high) in output image diff --git a/share/man/man4/mk48txx.4 b/share/man/man4/mk48txx.4 index d1ed56313465..66f9519f0282 100644 --- a/share/man/man4/mk48txx.4 +++ b/share/man/man4/mk48txx.4 @@ -65,7 +65,6 @@ function and the mk48txx_softc structure defined as follows: .Pp .Ft "int" .Fn mk48txx_attach "device_t dev" -.Pp .Bd -literal typedef uint8_t (*mk48txx_nvrd_t)(device_t dev, int off); typedef void (*mk48txx_nvwr_t)(device_t dev, int off, uint8_t v); @@ -84,7 +83,6 @@ struct mk48txx_softc { mk48txx_nvwr_t sc_nvwr; }; .Ed -.Pp .Bl -tag -width indent .It Fa sc_res The bus resource used for accessing the chip's non-volatile memory diff --git a/share/man/man4/mld.4 b/share/man/man4/mld.4 index c43d4725c04b..b761bb10123e 100644 --- a/share/man/man4/mld.4 +++ b/share/man/man4/mld.4 @@ -66,7 +66,6 @@ The retransmission of state-change reports adds some robustness to the protocol. .\" .Sh SYSCTL VARIABLES -.Pp .Bl -tag -width indent .\" .It net.inet6.mld.stats diff --git a/share/man/man4/mtio.4 b/share/man/man4/mtio.4 index 735da6358357..0b60b1e12abf 100644 --- a/share/man/man4/mtio.4 +++ b/share/man/man4/mtio.4 @@ -52,7 +52,6 @@ are control devices that can be used to issue ioctls to the SCSI tape driver to set parameters that are required to last beyond the unmounting of a tape. .Pp -.Pp The rewind devices automatically rewind when the last requested read, write or seek has finished, or the end of the tape has been reached. diff --git a/share/man/man4/mwl.4 b/share/man/man4/mwl.4 index 32138c89d2fe..1864647b1553 100644 --- a/share/man/man4/mwl.4 +++ b/share/man/man4/mwl.4 @@ -112,7 +112,6 @@ driver come in either Cardbus or mini-PCI packages. Wireless cards in Cardbus slots may be inserted and ejected on the fly. .Sh EXAMPLES Join an existing BSS network (ie: connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev mwl0 inet 192.168.0.20 \e netmask 0xffffff00" @@ -120,7 +119,6 @@ ifconfig wlan create wlandev mwl0 inet 192.168.0.20 \e .Pp Join a specific BSS network with network name .Dq Li my_net : -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev mwl0 inet 192.168.0.20 \e netmask 0xffffff00 ssid my_net" diff --git a/share/man/man4/netintro.4 b/share/man/man4/netintro.4 index 3e9894017777..c0629e1bba5e 100644 --- a/share/man/man4/netintro.4 +++ b/share/man/man4/netintro.4 @@ -409,7 +409,6 @@ struct ifaliasreq { struct sockaddr ifra_mask; }; .Ed -.Pp .Bd -literal /* * Structure used in SIOCGIFCONF request. @@ -427,7 +426,6 @@ struct ifconf { #define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */ }; .Ed -.Pp .Bd -literal /* Structure used in SIOCIFGCLONERS request. */ struct if_clonereq { diff --git a/share/man/man4/ng_UI.4 b/share/man/man4/ng_UI.4 index 0f48d4b7a9b7..2054d19ee1ad 100644 --- a/share/man/man4/ng_UI.4 +++ b/share/man/man4/ng_UI.4 @@ -65,7 +65,6 @@ will have a 0x03 byte prepended to them before being forwarded out on the hook. .Sh HOOKS This node type supports the following hooks: -.Pp .Bl -tag -width foobar .It Dv downstream Downstream connection. diff --git a/share/man/man4/ng_async.4 b/share/man/man4/ng_async.4 index 4f7a2e1eb1c7..bb6b0be929d5 100644 --- a/share/man/man4/ng_async.4 +++ b/share/man/man4/ng_async.4 @@ -88,7 +88,6 @@ Flag sharing between frames is disabled after one second of transmit idle time. .Sh HOOKS This node type supports the following hooks: -.Pp .Bl -tag -width foobar .It Dv async Asynchronous connection. diff --git a/share/man/man4/ng_cisco.4 b/share/man/man4/ng_cisco.4 index 2cccb76fddeb..d2b382f86132 100644 --- a/share/man/man4/ng_cisco.4 +++ b/share/man/man4/ng_cisco.4 @@ -114,7 +114,6 @@ understands the message. .Sh HOOKS This node type supports the following hooks: -.Pp .Bl -tag -width foobarbazio .It Dv downstream The connection to the synchronous line. diff --git a/share/man/man4/ng_frame_relay.4 b/share/man/man4/ng_frame_relay.4 index 79e18e6e2675..edc8a8ca3e14 100644 --- a/share/man/man4/ng_frame_relay.4 +++ b/share/man/man4/ng_frame_relay.4 @@ -63,7 +63,6 @@ through are available to connect to each of the DLCI channels. .Sh HOOKS This node type supports the following hooks: -.Pp .Bl -tag -width foobar .It Dv downstream The connection to the synchronous line. diff --git a/share/man/man4/ng_gif.4 b/share/man/man4/ng_gif.4 index 28a058897c95..6c4dad257d11 100644 --- a/share/man/man4/ng_gif.4 +++ b/share/man/man4/ng_gif.4 @@ -99,7 +99,6 @@ packet attached to the front. When no hooks are connected, packets flow normally upwards and downwards. .Sh HOOKS This node type supports the following hooks: -.Pp .Bl -tag -width ".Dv orphans" .It Dv lower Connection to the lower device link layer. diff --git a/share/man/man4/ng_iface.4 b/share/man/man4/ng_iface.4 index 90563b84dc8d..76ec47fc5b7d 100644 --- a/share/man/man4/ng_iface.4 +++ b/share/man/man4/ng_iface.4 @@ -83,7 +83,6 @@ The default mode is point-to-point. nodes support the Berkeley Packet Filter (BPF). .Sh HOOKS This node type supports the following hooks: -.Pp .Bl -tag -width foobar .It Dv inet Transmission and reception of IP packets. diff --git a/share/man/man4/ng_l2cap.4 b/share/man/man4/ng_l2cap.4 index bd050fc13c73..d4b7815f19a8 100644 --- a/share/man/man4/ng_l2cap.4 +++ b/share/man/man4/ng_l2cap.4 @@ -209,7 +209,6 @@ L2CAP does not support the concept of a global group name. .El .Sh HOOKS This node type supports the following hooks: -.Pp .Bl -tag -width indent .It Dv hci Bluetooth Host Controller Interface downstream hook. diff --git a/share/man/man4/ng_lmi.4 b/share/man/man4/ng_lmi.4 index 4dc7fdf6062b..a8fed52dbc0d 100644 --- a/share/man/man4/ng_lmi.4 +++ b/share/man/man4/ng_lmi.4 @@ -82,7 +82,6 @@ This node also supports the control message. .Sh HOOKS This node type supports the following hooks: -.Pp .Bl -tag -width foobarbaz .It Dv annexA ITU Annex A LMI hook. diff --git a/share/man/man4/ng_pppoe.4 b/share/man/man4/ng_pppoe.4 index fef3d2c5bfaf..32efa69ee7b8 100644 --- a/share/man/man4/ng_pppoe.4 +++ b/share/man/man4/ng_pppoe.4 @@ -67,7 +67,6 @@ the control message. .Sh HOOKS This node type supports the following hooks: -.Pp .Bl -tag -width [unspecified] .It Dv ethernet The hook that should normally be connected to an diff --git a/share/man/man4/ng_rfc1490.4 b/share/man/man4/ng_rfc1490.4 index 54b327ec04af..472b30871c47 100644 --- a/share/man/man4/ng_rfc1490.4 +++ b/share/man/man4/ng_rfc1490.4 @@ -78,7 +78,6 @@ hook of an node. .Sh HOOKS This node type supports the following hooks: -.Pp .Bl -tag -width foobarbazum .It Dv downstream Connects to the RFC 1490 peer entity. diff --git a/share/man/man4/ng_tee.4 b/share/man/man4/ng_tee.4 index a914ab54f796..84801b7ad38d 100644 --- a/share/man/man4/ng_tee.4 +++ b/share/man/man4/ng_tee.4 @@ -88,7 +88,6 @@ and respectively. .Sh HOOKS This node type supports the following hooks: -.Pp .Bl -tag -width foobarbarfoo .It Dv right The connection to the node on the right. diff --git a/share/man/man4/ng_tty.4 b/share/man/man4/ng_tty.4 index ec5b4c80dd6e..75e1b40a32fe 100644 --- a/share/man/man4/ng_tty.4 +++ b/share/man/man4/ng_tty.4 @@ -80,7 +80,6 @@ type node. The hot character has no effect on the transmission of data. .Sh HOOKS This node type supports the following hooks: -.Pp .Bl -tag -width foobar .It Dv hook .Xr tty 4 diff --git a/share/man/man4/ng_vjc.4 b/share/man/man4/ng_vjc.4 index da0c37b13064..714aa7e27323 100644 --- a/share/man/man4/ng_vjc.4 +++ b/share/man/man4/ng_vjc.4 @@ -103,7 +103,6 @@ and hooks, respectively. .Sh HOOKS This node type supports the following hooks: -.Pp .Bl -tag -width foobarbazi .It Dv ip Upstream (uncompressed) IP packets. diff --git a/share/man/man4/pcn.4 b/share/man/man4/pcn.4 index af0fdeee9d69..82720c925278 100644 --- a/share/man/man4/pcn.4 +++ b/share/man/man4/pcn.4 @@ -71,7 +71,6 @@ for the station address and a 64-bit multicast hash table. The .Nm driver supports the following media types: -.Pp .Bl -tag -width 10baseTXUTP .It autoselect Enable autoselection of the media type and options. @@ -103,7 +102,6 @@ modes. The .Nm driver supports the following media options: -.Pp .Bl -tag -width full-duplex .It full-duplex Force full duplex operation diff --git a/share/man/man4/psm.4 b/share/man/man4/psm.4 index ef23612ad886..9c10e23323ab 100644 --- a/share/man/man4/psm.4 +++ b/share/man/man4/psm.4 @@ -226,7 +226,6 @@ Set them in (see .Sx EXAMPLES below). -.Pp .Bl -tag -width MOUSE .It bit 0..3 RESOLUTION This flag specifies the resolution of the pointing device. diff --git a/share/man/man4/pt.4 b/share/man/man4/pt.4 index b45ae5ab6497..4400af91a10b 100644 --- a/share/man/man4/pt.4 +++ b/share/man/man4/pt.4 @@ -57,7 +57,6 @@ and the .Xr ioctl 2 calls described below. .Sh IOCTLS -.Bl -tag -width 012345678901234 The following .Xr ioctl 2 calls are supported by the @@ -65,7 +64,7 @@ calls are supported by the driver. They are defined in the header file .In sys/ptio.h . -.Pp +.Bl -tag -width 012345678901234 .It PTIOCGETTIMEOUT This ioctl allows userland applications to fetch the current .Nm diff --git a/share/man/man4/pts.4 b/share/man/man4/pts.4 index 88eb29c615b4..49e84efab707 100644 --- a/share/man/man4/pts.4 +++ b/share/man/man4/pts.4 @@ -139,7 +139,6 @@ should not be used directly. It is used to implement routines like .Sh FILES The files used by this pseudo-terminals implementation are: -.Pp .Bl -tag -width ".Pa /dev/pts/[num]" .It Pa /dev/pts/[num] Pseudo-terminal slave devices. diff --git a/share/man/man4/pty.4 b/share/man/man4/pty.4 index f72a8bee81c0..80b584f7629f 100644 --- a/share/man/man4/pty.4 +++ b/share/man/man4/pty.4 @@ -63,7 +63,6 @@ was being called. .Sh FILES The BSD-style compatibility pseudo-terminal driver uses the following device names: -.Pp .Bl -tag -width ".Pa /dev/pty[l-sL-S][0-9a-v]" .It Pa /dev/pty[l-sL-S][0-9a-v] Pseudo-terminal master devices. diff --git a/share/man/man4/ral.4 b/share/man/man4/ral.4 index 25fb343a0b42..0b13d0829f00 100644 --- a/share/man/man4/ral.4 +++ b/share/man/man4/ral.4 @@ -198,7 +198,6 @@ Join an existing BSS network (i.e., connect to an access point): .Pp Join a specific BSS network with network name .Dq Li my_net : -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev ral0 inet 192.168.0.20 \e netmask 0xffffff00 ssid my_net diff --git a/share/man/man4/random.4 b/share/man/man4/random.4 index cccd89c93bad..9ba00c043b0c 100644 --- a/share/man/man4/random.4 +++ b/share/man/man4/random.4 @@ -73,7 +73,6 @@ device, use the command line: .Dl sysctl kern.random .Pp which results in something like: -.Pp .Bd -literal -offset indent kern.random.sys.seeded: 1 kern.random.sys.harvest.ethernet: 1 diff --git a/share/man/man4/rl.4 b/share/man/man4/rl.4 index d88a25f45382..33db96665463 100644 --- a/share/man/man4/rl.4 +++ b/share/man/man4/rl.4 @@ -84,7 +84,6 @@ driver. The .Nm driver supports the following media types: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It autoselect Enable autoselection of the media type and options. @@ -118,7 +117,6 @@ modes. The .Nm driver supports the following media options: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It full-duplex Force full duplex operation diff --git a/share/man/man4/rum.4 b/share/man/man4/rum.4 index 82e25f5c3b94..fd407f8faae4 100644 --- a/share/man/man4/rum.4 +++ b/share/man/man4/rum.4 @@ -122,7 +122,6 @@ including: .El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev rum0 inet 192.168.0.20 \e netmask 0xffffff00 diff --git a/share/man/man4/run.4 b/share/man/man4/run.4 index 8f00eb248776..27a73934a1be 100644 --- a/share/man/man4/run.4 +++ b/share/man/man4/run.4 @@ -152,7 +152,6 @@ driver supports the following wireless adapters: .El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev run0 inet 192.168.0.20 \e netmask 0xffffff00 diff --git a/share/man/man4/screen.4 b/share/man/man4/screen.4 index 2f76f5937541..0b6ac2d93133 100644 --- a/share/man/man4/screen.4 +++ b/share/man/man4/screen.4 @@ -57,7 +57,6 @@ The console understands a subset of the ANSI x3.64 character sequences. For compatibility with the old pccons, the PC3 character sequences are also supported. -.Pp .Bd -literal ANSI Seq Function Termcap entry ======= ======= ===================================== ============== diff --git a/share/man/man4/send.4 b/share/man/man4/send.4 index 35ed77f1dd30..9cfcd530cb27 100644 --- a/share/man/man4/send.4 +++ b/share/man/man4/send.4 @@ -70,7 +70,6 @@ Struct sockaddr_send is defined in It defines the total length of the structure, the address family, packet's incoming or outgoing direction from the interface's point of view, and the interface index. -.Pp .Bd -literal struct sockaddr_send { unsigned char send_len; /* total length */ diff --git a/share/man/man4/ses.4 b/share/man/man4/ses.4 index 4070c89d753e..3d9528517bc7 100644 --- a/share/man/man4/ses.4 +++ b/share/man/man4/ses.4 @@ -79,7 +79,6 @@ devices. They are defined in the header file .In cam/scsi/scsi_ses.h (\fIq.v.\fR). -.Pp .Bl -tag -width SESIOC_GETENCSTAT .It Dv SESIOC_GETNOBJ Used to find out how many diff --git a/share/man/man4/sf.4 b/share/man/man4/sf.4 index ce943f8ad40f..80ba44e19bfe 100644 --- a/share/man/man4/sf.4 +++ b/share/man/man4/sf.4 @@ -81,7 +81,6 @@ driver. The .Nm driver supports the following media types: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It autoselect Enable autoselection of the media type and options. @@ -112,7 +111,6 @@ modes. The .Nm driver supports the following media options: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It full-duplex Force full duplex operation diff --git a/share/man/man4/sis.4 b/share/man/man4/sis.4 index a1e1db801235..365b0a250d11 100644 --- a/share/man/man4/sis.4 +++ b/share/man/man4/sis.4 @@ -80,7 +80,6 @@ by the same driver. The .Nm driver supports the following media types: -.Pp .Bl -tag -width 10baseTXUTP .It autoselect Enable autoselection of the media type and options. @@ -112,7 +111,6 @@ modes. The .Nm driver supports the following media options: -.Pp .Bl -tag -width full-duplex .It full-duplex Force full duplex operation diff --git a/share/man/man4/sk.4 b/share/man/man4/sk.4 index d25c439d1058..88a428609521 100644 --- a/share/man/man4/sk.4 +++ b/share/man/man4/sk.4 @@ -97,7 +97,6 @@ such as file transfers and data streaming. The .Nm driver supports the following media types: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It autoselect Enable autoselection of the media type and options. @@ -126,7 +125,6 @@ modes are supported. The .Nm driver supports the following media options: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It full-duplex Force full duplex operation @@ -137,7 +135,6 @@ Force half duplex operation. The .Nm driver also supports one special link option for 1000baseTX cards: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It link0 With 1000baseTX cards, establishing a link between two ports requires diff --git a/share/man/man4/smb.4 b/share/man/man4/smb.4 index 620b1023e76f..afe4605b449f 100644 --- a/share/man/man4/smb.4 +++ b/share/man/man4/smb.4 @@ -45,7 +45,6 @@ with the ioctls described below. Any of these ioctl commands takes a pointer to .Vt struct smbcmd as its argument. -.Pp .Bd -literal #include diff --git a/share/man/man4/snd_hda.4 b/share/man/man4/snd_hda.4 index cd78c0f8e9d9..93257883b76b 100644 --- a/share/man/man4/snd_hda.4 +++ b/share/man/man4/snd_hda.4 @@ -463,7 +463,6 @@ On headphones connection rear connectors will be muted. Depending on codec configuration, these controls and signal sources could be reported to .Xr sound 4 : -.Pp .Bl -tag -width ".Va speaker" -offset indent .It Va vol overall output level (volume) diff --git a/share/man/man4/ste.4 b/share/man/man4/ste.4 index fabef6d19842..02644ae32c05 100644 --- a/share/man/man4/ste.4 +++ b/share/man/man4/ste.4 @@ -71,7 +71,6 @@ using an MII transceiver. The .Nm driver supports the following media types: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It autoselect Enable autoselection of the media type and options. @@ -102,7 +101,6 @@ modes. The .Nm driver supports the following media options: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It full-duplex Force full duplex operation diff --git a/share/man/man4/sym.4 b/share/man/man4/sym.4 index 547d20595474..205fe8650563 100644 --- a/share/man/man4/sym.4 +++ b/share/man/man4/sym.4 @@ -225,7 +225,6 @@ The Symbios/Logic NVRAM layout and the Tekram NVRAM layout are currently supported. If the reading of the NVRAM succeeds, the following settings are taken into account and reported to CAM: -.Pp .Bl -column "SCSI parity checking" "Symbios" .It Em "Host settings Symbios Tekram" .It "SCSI parity checking Y N" @@ -254,7 +253,6 @@ command. .Pp The table below summarizes the main features and capabilities of the NCR/Symbios/LSI Logic 53C8XX family of PCI SCSI controllers. -.Pp .Bl -column sym53c1510d "80MHz" "Width" "SRAM" "PCI64" .It Em "Chip Sync Width SRAM PCI64 Supported" .It "sym53c810 10MHz 8Bit N N Y" diff --git a/share/man/man4/syscons.4 b/share/man/man4/syscons.4 index acc6c665ff05..7685c892d36a 100644 --- a/share/man/man4/syscons.4 +++ b/share/man/man4/syscons.4 @@ -466,7 +466,6 @@ As the .Nm driver requires the keyboard driver and the video card driver, the kernel configuration file should contain the following lines. -.Pp .Bd -literal -offset indent device atkbdc device atkbd diff --git a/share/man/man4/ti.4 b/share/man/man4/ti.4 index ba999e237fc4..269b6cf47ab4 100644 --- a/share/man/man4/ti.4 +++ b/share/man/man4/ti.4 @@ -116,7 +116,6 @@ man page for more details. The .Nm driver supports the following media types: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It autoselect Enable autoselection of the media type and options. @@ -152,7 +151,6 @@ mode is supported at this speed. The .Nm driver supports the following media options: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It full-duplex Force full duplex operation diff --git a/share/man/man4/tl.4 b/share/man/man4/tl.4 index 3dd4cbabc97b..eb8351d49bff 100644 --- a/share/man/man4/tl.4 +++ b/share/man/man4/tl.4 @@ -74,7 +74,6 @@ built-in PHY and the DP83840A also support autonegotiation. The .Nm driver supports the following media types: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It autoselect Enable autoselection of the media type and options. @@ -93,7 +92,6 @@ Enable AUI/BNC interface (useful only with the built-in PHY). The .Nm driver supports the following media options: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It full-duplex Force full duplex operation diff --git a/share/man/man4/tx.4 b/share/man/man4/tx.4 index f0cda0ed7ff9..2f7ea5986195 100644 --- a/share/man/man4/tx.4 +++ b/share/man/man4/tx.4 @@ -56,7 +56,6 @@ These are mostly SMC 9432 series cards. The .Nm driver supports the following media types (depending on card's capabilities): -.Pp .Bl -tag -width ".Cm 10baseT/UTP" .It Cm autoselect Enable autonegotiation (default). diff --git a/share/man/man4/uath.4 b/share/man/man4/uath.4 index 4ef898e6c4eb..ad118098f552 100644 --- a/share/man/man4/uath.4 +++ b/share/man/man4/uath.4 @@ -122,7 +122,6 @@ An up to date list can be found at .Pa http://customerproducts.atheros.com/customerproducts/default.asp . .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev uath0 inet 192.168.0.20 \e netmask 0xffffff00 diff --git a/share/man/man4/upgt.4 b/share/man/man4/upgt.4 index 06c5eb57f76a..7042dd7e7212 100644 --- a/share/man/man4/upgt.4 +++ b/share/man/man4/upgt.4 @@ -178,7 +178,6 @@ Spinnaker Proto Board .El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev upgt0 inet 192.168.0.20 \e netmask 0xffffff00 diff --git a/share/man/man4/ural.4 b/share/man/man4/ural.4 index 3825166ffa8f..4ae6c18ebcf7 100644 --- a/share/man/man4/ural.4 +++ b/share/man/man4/ural.4 @@ -105,7 +105,6 @@ An up to date list can be found at .Pa http://ralink.rapla.net/ . .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev ural0 inet 192.168.0.20 \e netmask 0xffffff00 diff --git a/share/man/man4/urtw.4 b/share/man/man4/urtw.4 index a3f27a017973..58f291ffcd45 100644 --- a/share/man/man4/urtw.4 +++ b/share/man/man4/urtw.4 @@ -83,7 +83,6 @@ driver supports Realtek RTL8187B/L based wireless network devices, including: .El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev urtw0 inet 192.168.0.20 \e netmask 0xffffff00 diff --git a/share/man/man4/vr.4 b/share/man/man4/vr.4 index 4839c30a3100..de65fe1a776f 100644 --- a/share/man/man4/vr.4 +++ b/share/man/man4/vr.4 @@ -77,7 +77,6 @@ They support both The .Nm driver supports the following media types: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It autoselect Enable autoselection of the media type and options. @@ -108,7 +107,6 @@ modes. The .Nm driver supports the following media options: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It full-duplex Force full duplex operation diff --git a/share/man/man4/wb.4 b/share/man/man4/wb.4 index 2dd51b6335cf..038af892f221 100644 --- a/share/man/man4/wb.4 +++ b/share/man/man4/wb.4 @@ -73,7 +73,6 @@ supports both 10 and 100Mbps speeds in either full or half duplex. The .Nm driver supports the following media types: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It autoselect Enable autoselection of the media type and options. @@ -107,7 +106,6 @@ modes. The .Nm driver supports the following media options: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It full-duplex Force full duplex operation diff --git a/share/man/man4/wi.4 b/share/man/man4/wi.4 index 1c43b373575d..115916791ea0 100644 --- a/share/man/man4/wi.4 +++ b/share/man/man4/wi.4 @@ -241,7 +241,6 @@ DLink DWL520 .El .Sh EXAMPLES Join an existing BSS network (ie: connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev wi0 inet 192.168.0.20 \e netmask 0xffffff00 @@ -249,7 +248,6 @@ ifconfig wlan create wlandev wi0 inet 192.168.0.20 \e .Pp Join a specific BSS network with network name .Dq Li my_net : -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev wi0 inet 192.168.0.20 \e netmask 0xffffff00 ssid my_net diff --git a/share/man/man4/wpi.4 b/share/man/man4/wpi.4 index 9932ff4072d3..3fc1b6d4a181 100644 --- a/share/man/man4/wpi.4 +++ b/share/man/man4/wpi.4 @@ -79,7 +79,6 @@ firmware license .El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan0 create wlandev wpi0 inet 192.168.0.20 \e netmask 0xffffff00 diff --git a/share/man/man4/xl.4 b/share/man/man4/xl.4 index 155273cdb5b4..9c8e8b0a5fdf 100644 --- a/share/man/man4/xl.4 +++ b/share/man/man4/xl.4 @@ -74,7 +74,6 @@ possible mode with a link partner. The .Nm driver supports the following media types: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It autoselect Enable autoselection of the media type and options. @@ -114,7 +113,6 @@ Enable BNC coax transceiver (available only on COMBO cards). The .Nm driver supports the following media options: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It full-duplex Force full duplex operation diff --git a/share/man/man5/elf.5 b/share/man/man5/elf.5 index c534e2e2f1eb..1d34dfe24914 100644 --- a/share/man/man5/elf.5 +++ b/share/man/man5/elf.5 @@ -134,7 +134,6 @@ typedef struct { Elf32_Half e_shstrndx; } Elf32_Ehdr; .Ed -.Pp .Bd -literal -offset indent typedef struct { unsigned char e_ident[EI_NIDENT]; @@ -429,7 +428,6 @@ and members. As with the Elf executable header, the program header also has different versions depending on the architecture: -.Pp .Bd -literal -offset indent typedef struct { Elf32_Word p_type; @@ -442,7 +440,6 @@ typedef struct { Elf32_Word p_align; } Elf32_Phdr; .Ed -.Pp .Bd -literal -offset indent typedef struct { Elf64_Word p_type; @@ -658,7 +655,6 @@ typedef struct { Elf32_Word sh_entsize; } Elf32_Shdr; .Ed -.Pp .Bd -literal -offset indent typedef struct { Elf64_Word sh_name; @@ -1088,7 +1084,6 @@ An object file's symbol table holds information needed to locate and relocate a program's symbolic definitions and references. A symbol table index is a subscript into this array. -.Pp .Bd -literal -offset indent typedef struct { Elf32_Word st_name; @@ -1099,7 +1094,6 @@ typedef struct { Elf32_Half st_shndx; } Elf32_Sym; .Ed -.Pp .Bd -literal -offset indent typedef struct { Elf64_Word st_name; @@ -1227,7 +1221,6 @@ program image. Relocation entries are these data. .Pp Relocation structures that do not need an addend: -.Pp .Bd -literal -offset indent typedef struct { Elf32_Addr r_offset; @@ -1242,7 +1235,6 @@ typedef struct { .Ed .Pp Relocation structures that need an addend: -.Pp .Bd -literal -offset indent typedef struct { Elf32_Addr r_offset; diff --git a/share/man/man5/link.5 b/share/man/man5/link.5 index 73f0a4555357..ca3e811fed9b 100644 --- a/share/man/man5/link.5 +++ b/share/man/man5/link.5 @@ -177,7 +177,6 @@ struct section_dispatch_table { long sdt_plt_sz; }; .Ed -.Pp .Bl -tag -width sdt_filler1 .It Fa sdt_loaded A pointer to the first link map loaded (see below). @@ -242,7 +241,6 @@ struct sod { long sod_next; }; .Ed -.Pp .Bl -tag -width sod_library .It Fa sod_name The offset in the text segment of a string describing this link object. @@ -356,7 +354,6 @@ struct rrs_hash { int rh_next; /* next hash entry */ }; .Ed -.Pp .Bl -tag -width rh_symbolnum .It Fa rh_symbolnum The index of the symbol in the shared object's symbol table (as given by the @@ -386,7 +383,6 @@ struct rt_symbol { struct so_map *rt_smp; }; .Ed -.Pp .Bl -tag -width rt_scraddr .It Fa rt_sp The symbol description. @@ -427,7 +423,6 @@ struct so_debug { struct rt_symbol *dd_cc; }; .Ed -.Pp .Bl -tag -width dd_in_debugger .It Fa dd_version Version number of this interface. @@ -563,7 +558,6 @@ Size of strings. .It Fa hh_ehints Maximum usable offset in hints file. .El -.Pp .Bd -literal -offset indent /* * Hash table element in hints file. diff --git a/share/man/man5/make.conf.5 b/share/man/man5/make.conf.5 index 9cc3c1d33013..0f9e70d3b848 100644 --- a/share/man/man5/make.conf.5 +++ b/share/man/man5/make.conf.5 @@ -148,7 +148,6 @@ settings suggested by .An "Bruce Evans" Aq bde@FreeBSD.org for developing and testing changes. They can be used, if set, by: -.Pp .Bd -literal -offset indent CFLAGS+=${BDECFLAGS} .Ed diff --git a/share/man/man5/passwd.5 b/share/man/man5/passwd.5 index 2acef5368819..8b8772efa0bf 100644 --- a/share/man/man5/passwd.5 +++ b/share/man/man5/passwd.5 @@ -72,7 +72,6 @@ records, one per user, containing ten colon separated fields. These fields are as follows: -.Pp .Bl -tag -width ".Ar password" -offset indent .It Ar name User's login name. diff --git a/share/man/man5/quota.user.5 b/share/man/man5/quota.user.5 index 010b99c8afc9..f502a51877dd 100644 --- a/share/man/man5/quota.user.5 +++ b/share/man/man5/quota.user.5 @@ -47,7 +47,6 @@ options in the .Xr fstab 5 file. .Pp -.Pp The data files contain the following information: .Pp .Bl -bullet -offset indent -compact @@ -69,7 +68,6 @@ Block grace time remaining if over the soft limit File grace time remaining if over the soft limit .El .Pp -.Pp See .Xr edquota 8 for an explanation on the various limits and grace periods. diff --git a/share/man/man5/resolver.5 b/share/man/man5/resolver.5 index 5c196f386d7f..cbbd34c2ab16 100644 --- a/share/man/man5/resolver.5 +++ b/share/man/man5/resolver.5 @@ -126,7 +126,6 @@ The syntax is where .Sy option is one of the following: -.Pp .Bl -tag -width no_tld_query .It Sy debug sets diff --git a/share/man/man7/firewall.7 b/share/man/man7/firewall.7 index 9760b9f39e2f..20108d22e96d 100644 --- a/share/man/man7/firewall.7 +++ b/share/man/man7/firewall.7 @@ -208,7 +208,6 @@ ip_portrange_first=4000 ip_portrange_last=5000 \&... .Ed -.Pp .Bd -literal # /etc/ipfw.conf # diff --git a/share/man/man7/sdoc.7 b/share/man/man7/sdoc.7 index 2a7e626e1a70..a3c000dff3cb 100644 --- a/share/man/man7/sdoc.7 +++ b/share/man/man7/sdoc.7 @@ -156,7 +156,6 @@ it may refer to a completely different resource and usage of the truncated resource could result in very incorrect behavior. Example: -.Pp .Bd -literal void foo(const char *arbitrary_string) diff --git a/share/man/man8/picobsd.8 b/share/man/man8/picobsd.8 index c6c6c948ea8e..21ddb71fb991 100644 --- a/share/man/man8/picobsd.8 +++ b/share/man/man8/picobsd.8 @@ -55,7 +55,6 @@ The most important options for common operations are .Fl init , .Fl n and .Fl v. -.Pp .Bl -tag -width indent .\" .It Fl -all_in_mfs diff --git a/share/man/man8/rc.8 b/share/man/man8/rc.8 index 4f24a3639807..82737d4201dd 100644 --- a/share/man/man8/rc.8 +++ b/share/man/man8/rc.8 @@ -326,7 +326,6 @@ section). .Pp The following key points apply to old-style scripts in .Pa /usr/local/etc/rc.d/ : -.Pp .Bl -bullet .It Scripts are only executed if their diff --git a/share/man/man8/rc.sendmail.8 b/share/man/man8/rc.sendmail.8 index 7b05ced128d0..14a30e4a7371 100644 --- a/share/man/man8/rc.sendmail.8 +++ b/share/man/man8/rc.sendmail.8 @@ -220,7 +220,6 @@ daemon. These variables are used to determine how the .Xr sendmail 8 daemons are started: -.Pp .Bd -literal -offset indent # MTA if (${sendmail_enable} == NONE) diff --git a/share/man/man9/DB_COMMAND.9 b/share/man/man9/DB_COMMAND.9 index 687a7e40e392..44fe32b0a604 100644 --- a/share/man/man9/DB_COMMAND.9 +++ b/share/man/man9/DB_COMMAND.9 @@ -88,7 +88,6 @@ command will display words in decimal form if it is passed the modifier "d". .El .Sh EXAMPLE In your module, the command is declared as: -.Pp .Bd -literal DB_COMMAND(mycmd, my_cmd_func) { @@ -98,7 +97,6 @@ DB_COMMAND(mycmd, my_cmd_func) .Ed .Pp Then, when in ddb: -.Pp .Bd -literal .Bf Sy db> mycmd 0x1000 diff --git a/share/man/man9/MD5.9 b/share/man/man9/MD5.9 index d51a9fc231fc..b2d257fbc261 100644 --- a/share/man/man9/MD5.9 +++ b/share/man/man9/MD5.9 @@ -51,7 +51,6 @@ The module implements the RSA Data Security, Inc.\& MD5 Message-Digest Algorithm (MD5). It produces 128-bit MD5 Digest of data. -.Pp .Bl -hang -width MD5Transformxxx .It Pa MD5Init must be called just before diff --git a/share/man/man9/VOP_READDIR.9 b/share/man/man9/VOP_READDIR.9 index 057600e914df..625f3c7158fe 100644 --- a/share/man/man9/VOP_READDIR.9 +++ b/share/man/man9/VOP_READDIR.9 @@ -89,7 +89,6 @@ The value of the cookie should be the offset within the directory where the on-disc version of the appropriate directory entry starts. Memory for the cookies should be allocated using: -.Pp .Bd -literal ...; *ncookies = number of entries read; diff --git a/share/man/man9/fail.9 b/share/man/man9/fail.9 index 8d1e59346586..e367effa257b 100644 --- a/share/man/man9/fail.9 +++ b/share/man/man9/fail.9 @@ -108,7 +108,6 @@ tree (referenced in code by .Sy DEBUG_FP ) . .Pp The sysctl variable may be set using the following grammar: -.Pp .Bd -literal :: ( "->" )* diff --git a/share/man/man9/ieee80211_ddb.9 b/share/man/man9/ieee80211_ddb.9 index 93bee7e4c28b..8deaee73c815 100644 --- a/share/man/man9/ieee80211_ddb.9 +++ b/share/man/man9/ieee80211_ddb.9 @@ -35,7 +35,6 @@ .Bd -ragged .Cd options DDB .Ed -.Pp .Bd -ragged .Cd show vap [addr] .Cd show all vaps diff --git a/share/man/man9/ieee80211_radiotap.9 b/share/man/man9/ieee80211_radiotap.9 index f9f6250f9453..8d44a4785c24 100644 --- a/share/man/man9/ieee80211_radiotap.9 +++ b/share/man/man9/ieee80211_radiotap.9 @@ -104,7 +104,6 @@ this is checked with one of and .Fn ieee80211_radiotap_active . In the transmit path capture work looks like this: -.Pp .Bd -literal -offset indent if (ieee80211_radiotap_active_vap(vap)) { ... /* record transmit state */ @@ -115,7 +114,6 @@ if (ieee80211_radiotap_active_vap(vap)) { While in the receive path capture is handled in .Nm net80211 but state must be captured before dispatching a frame: -.Pp .Bd -literal -offset indent if (ieee80211_radiotap_active(ic)) { ... /* record receive state */ diff --git a/share/man/man9/mbuf.9 b/share/man/man9/mbuf.9 index 8b8d08068952..2cc15c277a38 100644 --- a/share/man/man9/mbuf.9 +++ b/share/man/man9/mbuf.9 @@ -171,7 +171,6 @@ is a constant defined in The .Vt mbuf header includes: -.Pp .Bl -tag -width "m_nextpkt" -offset indent .It Va m_next .Pq Vt struct mbuf * diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index c3382d780ee7..a033f7c2d09f 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -679,7 +679,6 @@ might not be in scope.) Test pointers against .Dv NULL , e.g., use: -.Pp .Bd -literal (p = f()) == NULL .Ed diff --git a/share/man/man9/timeout.9 b/share/man/man9/timeout.9 index 971c8e7b590c..36731c8a2bed 100644 --- a/share/man/man9/timeout.9 +++ b/share/man/man9/timeout.9 @@ -50,7 +50,6 @@ .Sh SYNOPSIS .In sys/types.h .In sys/systm.h -.Pp .Bd -literal typedef void timeout_t (void *); .Ed @@ -58,7 +57,6 @@ typedef void timeout_t (void *); .Fn timeout "timeout_t *func" "void *arg" "int ticks" .Ft void .Fn callout_handle_init "struct callout_handle *handle" -.Pp .Bd -literal struct callout_handle handle = CALLOUT_HANDLE_INITIALIZER(&handle) .Ed diff --git a/share/man/man9/uio.9 b/share/man/man9/uio.9 index 2e79f9cca9fb..fb27c9ce9982 100644 --- a/share/man/man9/uio.9 +++ b/share/man/man9/uio.9 @@ -35,7 +35,6 @@ .Sh SYNOPSIS .In sys/types.h .In sys/uio.h -.Pp .Bd -literal struct uio { struct iovec *uio_iov; /* scatter/gather list */ diff --git a/share/termcap/termcap.5 b/share/termcap/termcap.5 index 11374db49b12..fefc59276809 100644 --- a/share/termcap/termcap.5 +++ b/share/termcap/termcap.5 @@ -106,7 +106,6 @@ Therefore, a in 132-column mode would be .Dq vt100-w . The following suffixes should be used where possible: -.Pp .Bl -column indent "With automatic margins (usually default)xx" -offset indent .Sy "Suffix Meaning Example" -w Wide mode (more than 80 columns) vt100-w @@ -121,7 +120,6 @@ The following suffixes should be used where possible: The description field attempts to convey the semantics of the capability. You may find some codes in the description field: -.Pp .Bl -tag -width #[1-9] .It (P) indicates that padding may be specified. @@ -714,7 +712,6 @@ The following entry, which describes the Concept\-100, is among the more complex entries in the .Nm file as of this writing. -.Pp .Bd -literal ca\||\|concept100\||\|c100\||\|concept\||\|c104\||\|concept100-4p\||\|HDS Concept\-100:\e :al=3*\eE^R:am:bl=^G:cd=16*\eE^C:ce=16\eE^U:cl=2*^L:cm=\eEa%+ %+ :\e diff --git a/sys/boot/common/loader.8 b/sys/boot/common/loader.8 index 2490e3dcdbea..7ccd184a6aaf 100644 --- a/sys/boot/common/loader.8 +++ b/sys/boot/common/loader.8 @@ -643,7 +643,6 @@ by it as arguments, and it is processed by a special parser which is not used for regular Forth commands. .Pp This special parser applies the following rules to the parsed text: -.Pp .Bl -enum .It All backslash characters are preprocessed. diff --git a/usr.bin/chat/chat.8 b/usr.bin/chat/chat.8 index ecc733d1ce7b..ed908b97f1fd 100644 --- a/usr.bin/chat/chat.8 +++ b/usr.bin/chat/chat.8 @@ -392,7 +392,6 @@ ABORT "NO CARRIER" ogin:--BREAK--ogin: real_account .br \fIetc ...\fR -.LP .SH TIMEOUT The initial timeout value is 45 seconds. This may be changed using the \fB-t\fR diff --git a/usr.bin/cksum/cksum.1 b/usr.bin/cksum/cksum.1 index d4a0ee7d3ed2..3ababd61b3d9 100644 --- a/usr.bin/cksum/cksum.1 +++ b/usr.bin/cksum/cksum.1 @@ -122,7 +122,6 @@ in the networking standard The .Tn CRC checksum encoding is defined by the generating polynomial: -.Pp .Bd -unfilled -offset indent G(x) = x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1 diff --git a/usr.bin/colldef/colldef.1 b/usr.bin/colldef/colldef.1 index fafa74db460d..b541cd9a7277 100644 --- a/usr.bin/colldef/colldef.1 +++ b/usr.bin/colldef/colldef.1 @@ -128,7 +128,6 @@ SPACE characters. Symbol-value can be specified in a hexadecimal (\ex\fI??\fR) or octal (\e\fI???\fR) representation, and can be only one character in length. -.Pp .Bd -literal -offset indent symbol-name1 symbol-value1 symbol-name2 symbol-value2 @@ -142,7 +141,6 @@ fields. The .Ar charmap statement is optional. -.Pp .Bd -literal -offset indent substitute "symbol" with "repl_string" .Ed diff --git a/usr.bin/csup/cpasswd.1 b/usr.bin/csup/cpasswd.1 index e0b6e3fb167a..2563251a01bc 100644 --- a/usr.bin/csup/cpasswd.1 +++ b/usr.bin/csup/cpasswd.1 @@ -102,7 +102,6 @@ Authentication password file. .Xr csup 1 , .Xr cvsup 1 , .Xr cvsupd 8 . -.Pp .Bd -literal http://www.cvsup.org/ .Ed diff --git a/usr.bin/gencat/gencat.1 b/usr.bin/gencat/gencat.1 index eed676428487..59f614dc35d0 100644 --- a/usr.bin/gencat/gencat.1 +++ b/usr.bin/gencat/gencat.1 @@ -60,7 +60,6 @@ Note that the fields of a message text source line are separated by a single space character: any other space characters are considered to be part of the field contents. -.Pp .Bl -tag -width 3n .It Li $set Ar n comment This line specifies the set identifier of the following messages until diff --git a/usr.bin/getopt/getopt.1 b/usr.bin/getopt/getopt.1 index eafdce1bc45a..c57b19c6402c 100644 --- a/usr.bin/getopt/getopt.1 +++ b/usr.bin/getopt/getopt.1 @@ -50,7 +50,6 @@ and and the option .Fl o , which requires an argument. -.Pp .Bd -literal -offset indent args=\`getopt abo: $*\` # you should not use \`getopt abo: "$@"\` since that would parse @@ -83,7 +82,6 @@ echo oarg is "'"$oarg"'" .Ed .Pp This code will accept any of the following as equivalent: -.Pp .Bd -literal -offset indent cmd \-aoarg file file cmd \-a \-o arg file file diff --git a/usr.bin/nl/nl.1 b/usr.bin/nl/nl.1 index 064971a46d50..554e18d241d0 100644 --- a/usr.bin/nl/nl.1 +++ b/usr.bin/nl/nl.1 @@ -90,7 +90,6 @@ independently available for header, body and footer sections. .Pp The starts of logical page sections are signalled by input lines containing nothing but one of the following sequences of delimiter characters: -.Pp .Bl -column "\e:\e:\e:" "Start of" -offset indent .Em "Line Start of" .It "\e:\e:\e: header" diff --git a/usr.bin/vmstat/vmstat.8 b/usr.bin/vmstat/vmstat.8 index 81a590673294..c1235ef22d5f 100644 --- a/usr.bin/vmstat/vmstat.8 +++ b/usr.bin/vmstat/vmstat.8 @@ -221,7 +221,6 @@ by zone. By default, .Nm displays the following information: -.Pp .Bl -tag -width indent .It procs Information about the numbers of processes in various states. diff --git a/usr.sbin/burncd/burncd.8 b/usr.sbin/burncd/burncd.8 index a9c53e627748..e2996ba35a4e 100644 --- a/usr.sbin/burncd/burncd.8 +++ b/usr.sbin/burncd/burncd.8 @@ -46,7 +46,6 @@ The utility is used to burn CD-R/RW media using the ATAPI cd driver. .Pp Available options and operands: -.Pp .Bl -tag -width XXXXXXXXXXXX .It Fl d burn the CD-R/RW in DAO (disk at once) mode. @@ -80,7 +79,6 @@ verbose, print extra progress messages. .Pp .Ar command may be one of: -.Pp .Bl -tag -width XXXXXXXXXXXX .It Cm msinfo Show the first LBA of the last track on the media diff --git a/usr.sbin/ckdist/ckdist.1 b/usr.sbin/ckdist/ckdist.1 index 91a809160213..86175c996307 100644 --- a/usr.sbin/ckdist/ckdist.1 +++ b/usr.sbin/ckdist/ckdist.1 @@ -110,7 +110,6 @@ or The .Nm utility exits with one of the following values: -.Pp .Bl -tag -width indent .It 0 No errors were detected. diff --git a/usr.sbin/crunch/crunchgen/crunchgen.1 b/usr.sbin/crunch/crunchgen/crunchgen.1 index 5dfd0a9fbfba..66fe8f3f6df2 100644 --- a/usr.sbin/crunch/crunchgen/crunchgen.1 +++ b/usr.sbin/crunch/crunchgen/crunchgen.1 @@ -384,7 +384,6 @@ Here is an example .Nm input conf file, named .Dq Pa kcopy.conf : -.Pp .Bd -literal -offset indent srcdirs /usr/src/bin /usr/src/sbin @@ -419,7 +418,6 @@ are added to all build targets. The crunched binary .Dq Pa kcopy can be built as follows: -.Pp .Bd -literal -offset indent % crunchgen -m Makefile kcopy.conf # gen Makefile and kcopy.c % make objs # build the component programs' .o files diff --git a/usr.sbin/dconschat/dconschat.8 b/usr.sbin/dconschat/dconschat.8 index 525dbc7e7635..4f8dcd459803 100644 --- a/usr.sbin/dconschat/dconschat.8 +++ b/usr.sbin/dconschat/dconschat.8 @@ -124,7 +124,6 @@ Suspend the dconschat process. .El .Pp The following options are supported. -.Pp .Bl -tag -width indent .It Fl b Translate Ctrl-C to ALT_BREAK (CR + diff --git a/usr.sbin/flowctl/flowctl.8 b/usr.sbin/flowctl/flowctl.8 index 75304c45910f..cf1396ba3e2f 100644 --- a/usr.sbin/flowctl/flowctl.8 +++ b/usr.sbin/flowctl/flowctl.8 @@ -54,7 +54,6 @@ debugging level to Currently, .Nm supports only one command. -.Pp .Bl -tag -width ".Cm show" .It Cm show This command is the analog of the diff --git a/usr.sbin/freebsd-update/freebsd-update.8 b/usr.sbin/freebsd-update/freebsd-update.8 index 87f786a2c814..1943a538276b 100644 --- a/usr.sbin/freebsd-update/freebsd-update.8 +++ b/usr.sbin/freebsd-update/freebsd-update.8 @@ -103,7 +103,6 @@ command, if any, to The .Cm command can be any one of the following: -.Pp .Bl -tag -width "-f conffile" .It Cm fetch Based on the currently installed world and the configuration diff --git a/usr.sbin/i2c/i2c.8 b/usr.sbin/i2c/i2c.8 index ac560a490d22..dab26ea3b0ad 100644 --- a/usr.sbin/i2c/i2c.8 +++ b/usr.sbin/i2c/i2c.8 @@ -114,7 +114,6 @@ talks to this I2C slave device again, the commands and other control info it sends are treated by the slave device as data or offset it was waiting for, and there's great potential for corruption if such a write is performed. .Sh EXAMPLES -.Pp .Bl -bullet .It Scan the default bus (/dev/iic0) for devices: diff --git a/usr.sbin/jail/jail.8 b/usr.sbin/jail/jail.8 index a8056ba170b6..893efd84da56 100644 --- a/usr.sbin/jail/jail.8 +++ b/usr.sbin/jail/jail.8 @@ -563,7 +563,6 @@ inside the jail; others apply both for constraining a particular application or for running a virtual server. .Pp Start a shell in the jail: -.Pp .Bd -literal -offset indent jail -c path=/data/jail/192.0.2.100 host.hostname=testhostname \\ ip4.addr=192.0.2.100 command=/bin/sh @@ -691,7 +690,6 @@ cannot be used successfully within the jail. To kill all processes in a jail, you may log into the jail and, as root, use one of the following commands, depending on what you want to accomplish: -.Pp .Bd -literal -offset indent kill -TERM -1 kill -KILL -1 diff --git a/usr.sbin/lpr/lpq/lpq.1 b/usr.sbin/lpr/lpq/lpq.1 index 3678256bb38d..7d682f3ea5b8 100644 --- a/usr.sbin/lpr/lpq/lpq.1 +++ b/usr.sbin/lpr/lpq/lpq.1 @@ -58,7 +58,6 @@ utility invoked without any arguments reports on any jobs currently in the queue. .Pp Options: -.Pp .Bl -tag -width indent .It Fl P Specify a particular printer, otherwise the default diff --git a/usr.sbin/lpr/lprm/lprm.1 b/usr.sbin/lpr/lprm/lprm.1 index a19461448a81..6f9d03d0101e 100644 --- a/usr.sbin/lpr/lprm/lprm.1 +++ b/usr.sbin/lpr/lprm/lprm.1 @@ -84,7 +84,6 @@ A user may dequeue an individual job by specifying its job number. This number may be obtained from the .Xr lpq 1 program, e.g.\& -.Pp .Bd -literal -offset indent \&% lpq \-l diff --git a/usr.sbin/mergemaster/mergemaster.8 b/usr.sbin/mergemaster/mergemaster.8 index 27157918326b..ab33b31eb974 100644 --- a/usr.sbin/mergemaster/mergemaster.8 +++ b/usr.sbin/mergemaster/mergemaster.8 @@ -328,7 +328,6 @@ overrides .Pa /etc/mergemaster.rc . Here is an example with all values commented out: -.Pp .Bd -literal # These are options for mergemaster, with their default values listed # The following options have command line overrides diff --git a/usr.sbin/mixer/mixer.8 b/usr.sbin/mixer/mixer.8 index c7b58d5dfb41..b31b326d2384 100644 --- a/usr.sbin/mixer/mixer.8 +++ b/usr.sbin/mixer/mixer.8 @@ -71,7 +71,6 @@ It may also be used to start and stop recording from the soundcard. The list of mixer devices that may be modified are: -.Pp .Bd -ragged -offset indent vol, bass, treble, synth, pcm, speaker, line, mic, cd, mix, pcm2, rec, igain, ogain, line1, line2, line3, dig1, dig2, dig3, diff --git a/usr.sbin/mlxcontrol/mlxcontrol.8 b/usr.sbin/mlxcontrol/mlxcontrol.8 index 542f9948b4d7..4ad6b63b8c6c 100644 --- a/usr.sbin/mlxcontrol/mlxcontrol.8 +++ b/usr.sbin/mlxcontrol/mlxcontrol.8 @@ -71,7 +71,6 @@ where N is the unit number of the controller. Drive names are of the form "mlxdN" where N is the unit number of the drive. Do not specify the path to a device node. -.Pp .Bl -tag -width rebuild .It status Print the status of controllers and system drives. diff --git a/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 b/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 index a015c8286ed7..c3eef64d276f 100644 --- a/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 +++ b/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 @@ -53,7 +53,6 @@ Perform an installation as directed by The .Cm command can be any one of the following: -.Pp .Bl -tag -width indent .It help Display a list of all commands. diff --git a/usr.sbin/portsnap/portsnap/portsnap.8 b/usr.sbin/portsnap/portsnap/portsnap.8 index b04171a5bd33..0d9c2612a1e2 100644 --- a/usr.sbin/portsnap/portsnap/portsnap.8 +++ b/usr.sbin/portsnap/portsnap/portsnap.8 @@ -115,7 +115,6 @@ sysutils/portupgrade, etc.) The .Cm command can be any one of the following: -.Pp .Bl -tag -width "-f conffile" .It fetch Fetch a compressed snapshot of the ports tree, or update diff --git a/usr.sbin/pw/pw.8 b/usr.sbin/pw/pw.8 index 428705589a80..6e79d564be86 100644 --- a/usr.sbin/pw/pw.8 +++ b/usr.sbin/pw/pw.8 @@ -245,7 +245,6 @@ id as an alternative to using the options. .Pp The following flags are common to most or all modes of operation: -.Pp .Bl -tag -width "-G grouplist" .It Fl V Ar etcdir This flag sets an alternate location for the password, group and configuration files, @@ -319,7 +318,6 @@ The following options apply to the and .Ar usermod commands: -.Pp .Bl -tag -width "-G grouplist" .It Fl n Ar name Specify the user/account name. @@ -353,7 +351,6 @@ or .Fl u options. .El -.Pp .Bl -tag -width "-G grouplist" .It Fl c Ar comment This field sets the contents of the passwd GECOS field, which normally contains up @@ -802,7 +799,6 @@ There is rarely any need to duplicate a group id. The .Ar groupmod command adds one additional option: -.Pp .Bl -tag -width "-m newmembers" .It Fl l Ar name This option allows changing of an existing group name to diff --git a/usr.sbin/sysinstall/sysinstall.8 b/usr.sbin/sysinstall/sysinstall.8 index 64df1bb8494c..eccb1823cd8b 100644 --- a/usr.sbin/sysinstall/sysinstall.8 +++ b/usr.sbin/sysinstall/sysinstall.8 @@ -187,7 +187,6 @@ When and where a function depends on the settings of one or more variables will be noted in the following table: .Pp .Sy "Function Glossary" : -.Pp .Bl -tag -width indent .It configAnonFTP Invoke the Anonymous FTP configuration menu. diff --git a/usr.sbin/vidcontrol/vidcontrol.1 b/usr.sbin/vidcontrol/vidcontrol.1 index cb545eeda92f..a36d3780c8b7 100644 --- a/usr.sbin/vidcontrol/vidcontrol.1 +++ b/usr.sbin/vidcontrol/vidcontrol.1 @@ -327,7 +327,6 @@ In each tuple, the first byte will be the character code, and the second byte is the character's color attribute. .Pp The VGA color attribute byte looks like this: -.Pp .Bl -column "X:X" "<00000000>" "width" "bright foreground color" .Sy "bits# width meaning" .Li "7 1 character blinking" -- cgit v1.3 From ab05568beb985e7949c87e0a1a1dff7afca056c9 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Wed, 20 Oct 2010 19:52:27 +0000 Subject: Correct typos. --- sys/boot/common/gpt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/common/gpt.c b/sys/boot/common/gpt.c index 62e86ddded8b..9c0098008e30 100644 --- a/sys/boot/common/gpt.c +++ b/sys/boot/common/gpt.c @@ -49,7 +49,7 @@ static int curent, bootonce; /* * Buffer below 64kB passed on gptread(), which can hold at least - * one sector od data (512 bytes). + * one sector of data (512 bytes). */ static char *secbuf; @@ -62,7 +62,7 @@ gptupdate(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, /* * We need to update the following for both primary and backup GPT: - * 1. Sector on disk that contains curent partition. + * 1. Sector on disk that contains current partition. * 2. Partition table checksum. * 3. Header checksum. * 4. Header on disk. -- cgit v1.3 From 104d506dddcaaa08161cb4c5b43606d82403ba1c Mon Sep 17 00:00:00 2001 From: Roman Divacky Date: Fri, 22 Oct 2010 18:07:21 +0000 Subject: Avoid using memcpy() for copying 32bit chunks. This shrinks the resulting code a little. Approved by: rpaulo (mentor) Reviewed by: jhb --- sys/boot/i386/boot2/boot2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c index f521fd7e071a..307d4c5df087 100644 --- a/sys/boot/i386/boot2/boot2.c +++ b/sys/boot/i386/boot2/boot2.c @@ -348,7 +348,7 @@ load(void) return; p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); bootinfo.bi_symtab = VTOP(p); - memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); + *(uint32_t*)p = hdr.ex.a_syms; p += sizeof(hdr.ex.a_syms); if (hdr.ex.a_syms) { if (xfsread(ino, p, hdr.ex.a_syms)) @@ -385,7 +385,7 @@ load(void) if (xfsread(ino, &es, sizeof(es))) return; for (i = 0; i < 2; i++) { - memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size)); + *(Elf32_Word *)p = es[i].sh_size; p += sizeof(es[i].sh_size); fs_off = es[i].sh_offset; if (xfsread(ino, p, es[i].sh_size)) -- cgit v1.3 From 6d6f51376332aeee5c2d77cf2019daf01d84ff16 Mon Sep 17 00:00:00 2001 From: Yoshihiro Takahashi Date: Sun, 24 Oct 2010 02:59:02 +0000 Subject: MFi386: revision 214210 Avoid using memcpy() for copying 32bit chunks. This shrinks the resulting code a little. --- sys/boot/pc98/boot2/boot2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/pc98/boot2/boot2.c b/sys/boot/pc98/boot2/boot2.c index 54082ad207fa..259d5de93fe3 100644 --- a/sys/boot/pc98/boot2/boot2.c +++ b/sys/boot/pc98/boot2/boot2.c @@ -485,7 +485,7 @@ load(void) return; p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); bootinfo.bi_symtab = VTOP(p); - memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); + *(uint32_t*)p = hdr.ex.a_syms; p += sizeof(hdr.ex.a_syms); if (hdr.ex.a_syms) { if (xfsread(ino, p, hdr.ex.a_syms)) @@ -522,7 +522,7 @@ load(void) if (xfsread(ino, &es, sizeof(es))) return; for (i = 0; i < 2; i++) { - memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size)); + *(Elf32_Word *)p = es[i].sh_size; p += sizeof(es[i].sh_size); fs_off = es[i].sh_offset; if (xfsread(ino, p, es[i].sh_size)) -- cgit v1.3