summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2017-01-30 12:39:01 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2017-01-30 12:39:01 +0000
commit65823f66c8745c2c8da123b632a68cabacd94799 (patch)
treed780d32246f985232d74cb167c84c8855f013448 /usr/src
parent0b44c32f7e92c1e380acd2dfa7cace0bba0b8294 (diff)
parent5799076e1f3af0000bc13f34bd0b894d098fb1dc (diff)
downloadillumos-joyent-65823f66c8745c2c8da123b632a68cabacd94799.tar.gz
[illumos-gate merge]
commit d4c899ee65547db6d0866332c5ef4c59cae9c2c2 7756 dis can't handle x86 SSE 3 instructions 7757 want avx2 disasm tests 7758 want SSE 4.1 disasm tests commit d276822b493d80b000f6ff4070a500e9e5d0f6bd 7817 loader: remove left over pc98 bits commit 46d46cd4fa12218e54fa3d73a9be825ed504cabb 7803 want devid_str_from_path(3devid) commit 8b65a70b763232c90a91f31eb2010314c02ed338 7541 zpool import/tryimport ioctl returns ENOMEM because provided buffer is too small for config commit 898c3fec4c1cbcd45754042f6635b76a9067abd6 7770 uts: move font sources to uts/common/font Conflicts: usr/src/test/util-tests/tests/dis/Makefile
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/boot/sys/boot/common/Makefile.inc2
-rw-r--r--usr/src/boot/sys/boot/common/isapnp.h7
-rw-r--r--usr/src/boot/sys/boot/forth/frames.4th64
-rw-r--r--usr/src/head/devid.h2
-rw-r--r--usr/src/lib/libdevid/deviceid.c33
-rw-r--r--usr/src/lib/libdevid/mapfile-vers7
-rw-r--r--usr/src/lib/libzfs/common/libzfs_impl.h2
-rw-r--r--usr/src/lib/libzfs/common/libzfs_import.c38
-rw-r--r--usr/src/man/man3devid/devid_get.3devid720
-rw-r--r--usr/src/pkg/manifests/system-test-utiltest.mf12
-rw-r--r--usr/src/uts/common/Makefile.files3
-rw-r--r--usr/src/uts/common/Makefile.rules3
-rw-r--r--usr/src/uts/common/font/12x22.c (renamed from usr/src/uts/common/io/12x22.c)0
-rw-r--r--usr/src/uts/common/font/6x10.c (renamed from usr/src/uts/common/io/6x10.c)0
-rw-r--r--usr/src/uts/common/font/7x14.c (renamed from usr/src/uts/common/io/7x14.c)0
-rw-r--r--usr/src/uts/common/font/8859-1.bdf (renamed from usr/src/uts/intel/io/vgatext/8859-1.bdf)1
-rw-r--r--usr/src/uts/common/font/bdf_to_c.awk (renamed from usr/src/uts/intel/io/vgatext/bdf_to_c.awk)0
-rw-r--r--usr/src/uts/common/font/font.c258
-rw-r--r--usr/src/uts/common/io/tem_safe.c262
-rw-r--r--usr/src/uts/common/sys/font.h29
-rw-r--r--usr/src/uts/common/sys/tem_impl.h1
-rw-r--r--usr/src/uts/i86pc/Makefile.files3
-rw-r--r--usr/src/uts/i86pc/Makefile.rules40
-rw-r--r--usr/src/uts/i86pc/gfx_private/Makefile16
-rw-r--r--usr/src/uts/i86pc/io/gfx_private/gfxp_vgatext.c1
-rw-r--r--usr/src/uts/i86pc/unix/Makefile4
-rw-r--r--usr/src/uts/i86xpv/Makefile.files3
-rw-r--r--usr/src/uts/i86xpv/Makefile.rules15
-rw-r--r--usr/src/uts/i86xpv/gfx_private/Makefile14
-rw-r--r--usr/src/uts/i86xpv/unix/Makefile4
-rw-r--r--usr/src/uts/intel/io/vgatext/vgatext.c1
-rw-r--r--usr/src/uts/intel/vgatext/Makefile17
-rw-r--r--usr/src/uts/sparc/tem/Makefile25
33 files changed, 923 insertions, 664 deletions
diff --git a/usr/src/boot/sys/boot/common/Makefile.inc b/usr/src/boot/sys/boot/common/Makefile.inc
index bce0eb5902..a02ef4732e 100644
--- a/usr/src/boot/sys/boot/common/Makefile.inc
+++ b/usr/src/boot/sys/boot/common/Makefile.inc
@@ -7,8 +7,6 @@ SRCS+= module.c panic.c
.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_CPUARCH} == "aarch64"
SRCS+= load_elf64.c reloc_elf64.c
.elif ${MACHINE_CPUARCH} == "arm"
diff --git a/usr/src/boot/sys/boot/common/isapnp.h b/usr/src/boot/sys/boot/common/isapnp.h
index 0f9956c4f1..595cbf0fee 100644
--- a/usr/src/boot/sys/boot/common/isapnp.h
+++ b/usr/src/boot/sys/boot/common/isapnp.h
@@ -28,8 +28,6 @@
* 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 _I386_ISA_PNP_H_
@@ -45,15 +43,10 @@
/* Static ports to access PnP state machine */
#ifndef _KERNEL
-#ifdef PC98
/* pnp.h is included from pnpinfo.c. */
-#define _PNP_ADDRESS 0x259
-#define _PNP_WRITE_DATA 0xa59
-#else
#define _PNP_ADDRESS 0x279
#define _PNP_WRITE_DATA 0xa79
#endif
-#endif
/* PnP Registers. Write to ADDRESS and then use WRITE/READ_DATA */
#define SET_RD_DATA 0x00
diff --git a/usr/src/boot/sys/boot/forth/frames.4th b/usr/src/boot/sys/boot/forth/frames.4th
index 0f8d460aa7..db42f72d0b 100644
--- a/usr/src/boot/sys/boot/forth/frames.4th
+++ b/usr/src/boot/sys/boot/forth/frames.4th
@@ -23,7 +23,6 @@
\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
\ SUCH DAMAGE.
\
-\ $FreeBSD$
marker task-frames.4th
@@ -46,49 +45,26 @@ variable fill
124 constant ascii_pipe
43 constant ascii_plus
-s" arch-pc98" environment? [if]
- \ Single frames
- 149 constant sh_el
- 150 constant sv_el
- 152 constant slt_el
- 154 constant slb_el
- 153 constant srt_el
- 155 constant srb_el
- \ Double frames
- 149 constant dh_el
- 150 constant dv_el
- 152 constant dlt_el
- 154 constant dlb_el
- 153 constant drt_el
- 155 constant drb_el
- \ Fillings
- 0 constant fill_none
- 32 constant fill_blank
- 135 constant fill_dark
- 135 constant fill_med
- 135 constant fill_bright
-[else]
- \ Single frames
- 196 constant sh_el
- 179 constant sv_el
- 218 constant slt_el
- 192 constant slb_el
- 191 constant srt_el
- 217 constant srb_el
- \ Double frames
- 205 constant dh_el
- 186 constant dv_el
- 201 constant dlt_el
- 200 constant dlb_el
- 187 constant drt_el
- 188 constant drb_el
- \ Fillings
- 0 constant fill_none
- 32 constant fill_blank
- 176 constant fill_dark
- 177 constant fill_med
- 178 constant fill_bright
-[then]
+\ Single frames
+196 constant sh_el
+179 constant sv_el
+218 constant slt_el
+192 constant slb_el
+191 constant srt_el
+217 constant srb_el
+\ Double frames
+205 constant dh_el
+186 constant dv_el
+201 constant dlt_el
+200 constant dlb_el
+187 constant drt_el
+188 constant drb_el
+\ Fillings
+0 constant fill_none
+32 constant fill_blank
+176 constant fill_dark
+177 constant fill_med
+178 constant fill_bright
only forth definitions also frame-drawing
diff --git a/usr/src/head/devid.h b/usr/src/head/devid.h
index b8129d1da0..7ea92df26e 100644
--- a/usr/src/head/devid.h
+++ b/usr/src/head/devid.h
@@ -22,6 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2017 Nexenta Systems, Inc.
*/
#ifndef _DEVID_H
@@ -55,6 +56,7 @@ extern char *devid_str_encode(ddi_devid_t devid, char *minor_name);
extern int devid_str_decode(char *devidstr,
ddi_devid_t *retdevid, char **retminor_name);
extern void devid_str_free(char *devidstr);
+extern char *devid_str_from_path(const char *path);
#ifdef __cplusplus
}
diff --git a/usr/src/lib/libdevid/deviceid.c b/usr/src/lib/libdevid/deviceid.c
index 840c32c23c..67f185fe69 100644
--- a/usr/src/lib/libdevid/deviceid.c
+++ b/usr/src/lib/libdevid/deviceid.c
@@ -19,11 +19,12 @@
*
* CDDL HEADER END
*/
+
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2017 Nexenta Systems, Inc.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
#include <unistd.h>
#include <stdlib.h>
@@ -120,6 +121,29 @@ devid_get_minor_name(int fd, char **minor_namep)
return (0);
}
+char *
+devid_str_from_path(const char *path)
+{
+ int fd;
+ ddi_devid_t devid;
+ char *minor, *ret = NULL;
+
+ if ((fd = open(path, O_RDONLY)) < 0)
+ return (NULL);
+
+ if (devid_get(fd, &devid) == 0) {
+ if (devid_get_minor_name(fd, &minor) != 0)
+ minor = NULL;
+ ret = devid_str_encode(devid, minor);
+ if (minor != NULL)
+ devid_str_free(minor);
+ devid_free(devid);
+ }
+ (void) close(fd);
+
+ return (ret);
+}
+
/* list element of devid_nmlist_t information */
struct nmlist {
struct nmlist *nl_next;
@@ -216,11 +240,8 @@ static di_devlink_handle_t devid_deviceid_to_nmlist_dlh = NULL; /* SLINK */
* the specified search path to avoid attaching all devices.
*/
int
-devid_deviceid_to_nmlist(
- char *search_path,
- ddi_devid_t devid,
- char *minor_name,
- devid_nmlist_t **retlist)
+devid_deviceid_to_nmlist(char *search_path, ddi_devid_t devid, char *minor_name,
+ devid_nmlist_t **retlist)
{
char *cp;
int dev;
diff --git a/usr/src/lib/libdevid/mapfile-vers b/usr/src/lib/libdevid/mapfile-vers
index f91b5d92ca..5d9516181a 100644
--- a/usr/src/lib/libdevid/mapfile-vers
+++ b/usr/src/lib/libdevid/mapfile-vers
@@ -18,8 +18,10 @@
#
# CDDL HEADER END
#
+
#
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 Nexenta Systems, Inc.
#
#
@@ -38,6 +40,11 @@
$mapfile_version 2
+SYMBOL_VERSION ILLUMOS_0.1 {
+ global:
+ devid_str_from_path;
+} SUNW_1.2;
+
SYMBOL_VERSION SUNW_1.2 {
global:
devid_str_decode;
diff --git a/usr/src/lib/libzfs/common/libzfs_impl.h b/usr/src/lib/libzfs/common/libzfs_impl.h
index c99a8324df..1581fa656a 100644
--- a/usr/src/lib/libzfs/common/libzfs_impl.h
+++ b/usr/src/lib/libzfs/common/libzfs_impl.h
@@ -132,6 +132,8 @@ typedef enum {
SHARED_SMB = 0x4
} zfs_share_type_t;
+#define CONFIG_BUF_MINSIZE 65536
+
int zfs_error(libzfs_handle_t *, int, const char *);
int zfs_error_fmt(libzfs_handle_t *, int, const char *, ...);
void zfs_error_aux(libzfs_handle_t *, const char *, ...);
diff --git a/usr/src/lib/libzfs/common/libzfs_import.c b/usr/src/lib/libzfs/common/libzfs_import.c
index 3b6a6d468e..496ba2c321 100644
--- a/usr/src/lib/libzfs/common/libzfs_import.c
+++ b/usr/src/lib/libzfs/common/libzfs_import.c
@@ -21,9 +21,9 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2016 by Delphix. All rights reserved.
* Copyright 2015 RackTop Systems.
- * Copyright 2016 Nexenta Systems, Inc.
+ * Copyright 2017 Nexenta Systems, Inc.
*/
/*
@@ -95,31 +95,6 @@ typedef struct pool_list {
name_entry_t *names;
} pool_list_t;
-static char *
-get_devid(const char *path)
-{
- int fd;
- ddi_devid_t devid;
- char *minor, *ret;
-
- if ((fd = open(path, O_RDONLY)) < 0)
- return (NULL);
-
- minor = NULL;
- ret = NULL;
- if (devid_get(fd, &devid) == 0) {
- if (devid_get_minor_name(fd, &minor) == 0)
- ret = devid_str_encode(devid, minor);
- if (minor != NULL)
- devid_str_free(minor);
- devid_free(devid);
- }
- (void) close(fd);
-
- return (ret);
-}
-
-
/*
* Go through and fix up any path and/or devid information for the given vdev
* configuration.
@@ -195,7 +170,7 @@ fix_paths(nvlist_t *nv, name_entry_t *names)
if (nvlist_add_string(nv, ZPOOL_CONFIG_PATH, best->ne_name) != 0)
return (-1);
- if ((devid = get_devid(best->ne_name)) == NULL) {
+ if ((devid = devid_str_from_path(best->ne_name)) == NULL) {
(void) nvlist_remove_all(nv, ZPOOL_CONFIG_DEVID);
} else {
if (nvlist_add_string(nv, ZPOOL_CONFIG_DEVID, devid) != 0) {
@@ -380,13 +355,14 @@ refresh_config(libzfs_handle_t *hdl, nvlist_t *config)
{
nvlist_t *nvl;
zfs_cmd_t zc = { 0 };
- int err;
+ int err, dstbuf_size;
if (zcmd_write_conf_nvlist(hdl, &zc, config) != 0)
return (NULL);
- if (zcmd_alloc_dst_nvlist(hdl, &zc,
- zc.zc_nvlist_conf_size * 2) != 0) {
+ dstbuf_size = MAX(CONFIG_BUF_MINSIZE, zc.zc_nvlist_conf_size * 4);
+
+ if (zcmd_alloc_dst_nvlist(hdl, &zc, dstbuf_size) != 0) {
zcmd_free_nvlists(&zc);
return (NULL);
}
diff --git a/usr/src/man/man3devid/devid_get.3devid b/usr/src/man/man3devid/devid_get.3devid
index d0a006377a..66d8a7d70d 100644
--- a/usr/src/man/man3devid/devid_get.3devid
+++ b/usr/src/man/man3devid/devid_get.3devid
@@ -1,249 +1,426 @@
-'\" te
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
+.\"
+.\" The contents of this file are subject to the terms of the
+.\" Common Development and Distribution License (the "License").
+.\" You may not use this file except in compliance with the License.
+.\"
+.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+.\" or http://www.opensolaris.org/os/licensing.
+.\" See the License for the specific language governing permissions
+.\" and limitations under the License.
+.\"
+.\" When distributing Covered Code, include this CDDL HEADER in each
+.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+.\" If applicable, add the following below this CDDL HEADER, with the
+.\" fields enclosed by brackets "[]" replaced with your own identifying
+.\" information: Portions Copyright [yyyy] [name of copyright owner]
.\"
.\"
-.\" Copyright 2015 Nexenta Systems, Inc. All rights reserved.
.\" Copyright (c) 1999, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright 2017 Nexenta Systems, Inc.
.\"
-.TH DEVID_GET 3DEVID "Jan 12, 2015"
-.SH NAME
-devid_get, devid_compare, devid_deviceid_to_nmlist, devid_free,
-devid_free_nmlist, devid_get_minor_name, devid_sizeof, devid_str_decode,
-devid_str_free, devid_str_encode, devid_valid \- device ID interfaces for user
-applications
-.SH SYNOPSIS
-.LP
-.nf
-\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-ldevid\fR [ \fIlibrary\fR... ]
-#include <devid.h>
-
-\fBint\fR \fBdevid_get\fR(\fBint\fR \fIfd\fR, \fBddi_devid_t *\fR\fIretdevid\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBdevid_free\fR(\fBddi_devid_t\fR \fIdevid\fR);
-.fi
-
-.LP
-.nf
-\fBint\fR \fBdevid_get_minor_name\fR(\fBint\fR \fIfd\fR, \fBchar **\fR\fIretminor_name\fR);
-.fi
-
-.LP
-.nf
-\fBint\fR \fBdevid_deviceid_to_nmlist\fR(\fBchar *\fR\fIsearch_path\fR, \fBddi_devid_t\fR \fIdevid\fR,
- \fBchar *\fR\fIminor_name\fR, \fBdevid_nmlist_t **\fR\fIretlist\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBdevid_free_nmlist\fR(\fBdevid_nmlist_t *\fR\fIlist\fR);
-.fi
-
-.LP
-.nf
-\fBint\fR \fBdevid_compare\fR(\fBddi_devid_t\fR \fIdevid1\fR, \fBddi_devid_t\fR \fIdevid2\fR);
-.fi
-
-.LP
-.nf
-\fBsize_t\fR \fBdevid_sizeof\fR(\fBddi_devid_t\fR \fIdevid\fR);
-.fi
-
-.LP
-.nf
-\fBint\fR \fBdevid_valid\fR(\fBddi_devid_t\fR \fIdevid\fR);
-.fi
-
-.LP
-.nf
-\fBchar *\fR\fBdevid_str_encode\fR(\fBddi_devid_t\fR \fIdevid\fR, \fBchar *\fR\fIminor_name\fR);
-.fi
-
-.LP
-.nf
-\fBint\fR \fBdevid_str_decode\fR(\fBchar *\fR\fIdevidstr\fR, \fBddi_devid_t *\fR\fIretdevid\fR,
- \fBchar **\fR\fIretminor_name\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBdevid_str_free\fR(\fBchar *\fR\fIstr\fR);
-.fi
-
-.SH DESCRIPTION
-.LP
-These functions provide unique identifiers (device \fBID\fRs) for devices.
+.Dd January 25, 2017
+.Dt DEVID_GET 3DEVID
+.Os
+.Sh NAME
+.Nm devid_get ,
+.Nm devid_free ,
+.Nm devid_get_minor_name ,
+.Nm devid_deviceid_to_nmlist ,
+.Nm devid_free_nmlist ,
+.Nm devid_compare ,
+.Nm devid_sizeof ,
+.Nm devid_valid ,
+.Nm devid_str_encode ,
+.Nm devid_str_decode ,
+.Nm devid_str_from_path ,
+.Nm devid_str_free
+.Nd device ID interfaces for user applications
+.Sh SYNOPSIS
+.Lb libdevid
+.In devid.h
+.Ft int
+.Fo devid_get
+.Fa "int fd"
+.Fa "ddi_devid_t *retdevid"
+.Fc
+.Ft void
+.Fo devid_free
+.Fa "ddi_devid_t devid"
+.Fc
+.Ft int
+.Fo devid_get_minor_name
+.Fa "int fd"
+.Fa "char **retminor_name"
+.Fc
+.Ft int
+.Fo devid_deviceid_to_nmlist
+.Fa "char *search_path"
+.Fa "ddi_devid_t devid"
+.Fa "char *minor_name"
+.Fa "devid_nmlist_t **retlist"
+.Fc
+.Ft void
+.Fo devid_free_nmlist
+.Fa "devid_nmlist_t *list"
+.Fc
+.Ft int
+.Fo devid_compare
+.Fa "ddi_devid_t devid1"
+.Fa "ddi_devid_t devid2"
+.Fc
+.Ft size_t
+.Fo devid_sizeof
+.Fa "ddi_devid_t devid"
+.Fc
+.Ft int
+.Fo devid_valid
+.Fa "ddi_devid_t devid"
+.Fc
+.Ft char *
+.Fo devid_str_encode
+.Fa "ddi_devid_t devid"
+.Fa "char *minor_name"
+.Fc
+.Ft int
+.Fo devid_str_decode
+.Fa "char *devidstr"
+.Fa "ddi_devid_t *retdevid"
+.Fa "char **retminor_name"
+.Fc
+.Ft char *
+.Fo devid_str_from_path
+.Fa "const char *path"
+.Fc
+.Ft void
+.Fo devid_str_free
+.Fa "char *str"
+.Fc
+.Sh DESCRIPTION
+These functions provide unique identifiers
+.Pq device ID
+for devices.
Applications and device drivers use these functions to identify and locate
devices, independent of the device's physical connection or its logical device
name or number.
-.sp
-.LP
-The \fBdevid_get()\fR function returns in \fIretdevid\fR the device \fBID\fR
-for the device associated with the open file descriptor \fIfd\fR, which refers
-to any device. It returns an error if the device does not have an associated
-device \fBID\fR. The caller must free the memory allocated for \fIretdevid\fR
-using the \fBdevid_free()\fR function.
-.sp
-.LP
-The \fBdevid_free()\fR function frees the space that was allocated for the
-returned \fIdevid\fR by \fBdevid_get()\fR and \fBdevid_str_decode()\fR.
-.sp
-.LP
-The \fBdevid_get_minor_name()\fR function returns the minor name, in
-\fIretminor_name\fR, for the device associated with the open file descriptor
-\fIfd\fR. This name is specific to the particular minor number, but is
-"instance number" specific. The caller of this function must free the memory
-allocated for the returned \fIretminor_name\fR string using
-\fBdevid_str_free()\fR.
-.sp
-.LP
-The \fBdevid_deviceid_to_nmlist()\fR function returns an array of
-\fIdevid_nmlist\fR structures, where each entry matches the \fIdevid\fR and
-\fIminor_name\fR passed in. If the \fIminor_name\fR specified is one of the
-special values (\fBDEVID_MINOR_NAME_ALL\fR, \fBDEVID_MINOR_NAME_ALL_CHR\fR, or
-\fBDEVID_MINOR_NAME_ALL_BLK\fR), then all minor names associated with
-\fIdevid\fR which also meet the special \fIminor_name\fR filtering requirements
-are returned. The \fIdevid_nmlist\fR structure contains the device name and
-device number. The last entry of the array contains a null pointer for the
-\fIdevname\fR and \fBNODEV\fR for the device number. This function traverses
-the file tree, starting at \fIsearch_path\fR. For each device with a matching
-device \fBID\fR and minor name tuple, a device name and device number are added
-to the \fIretlist\fR. If no matches are found, an error is returned. The caller
-of this function must free the memory allocated for the returned array with the
-\fBdevid_free_nmlist()\fR function. This function may take a long time to
-complete if called with the device ID of an unattached device.
-.sp
-.LP
-The \fBdevid_free_nmlist()\fR function frees the memory allocated by the
-\fBdevid_deviceid_to_nmlist()\fR function and returned in the \fIretlist\fR.
-.sp
-.LP
-The \fBdevid_compare()\fR function compares two device \fBID\fRs and determines
-both equality and sort order. The function returns an integer greater than 0 if
-the device \fBID\fR pointed to by \fIdevid1\fR is greater than the device
-\fBID\fR pointed to by \fIdevid2\fR. It returns 0 if the device \fBID\fR
-pointed to by \fIdevid1\fR is equal to the device \fBID\fR pointed to by
-\fIdevid2\fR. It returns an integer less than 0 if the device \fBID\fR pointed
-to by \fIdevid1\fR is less than the device \fBID\fR pointed to by
-\fIdevid2\fR. This function is the only valid mechanism to determine the
-equality of two devids. This function may indicate equality for arguments which
-by simple inspection appear different.
-.sp
-.LP
-The \fBdevid_sizeof()\fR function returns the size of \fIdevid\fR in bytes.
-.sp
-.LP
-The \fBdevid_valid()\fR function validates the format of a \fIdevid\fR. It
-returns 1 if the format is valid, and 0 if invalid. This check may not be as
-complete as the corresponding kernel function \fBddi_devid_valid()\fR (see
-\fBddi_devid_compare\fR(9F)).
-.sp
-.LP
-The \fBdevid_str_encode()\fR function encodes a \fIdevid\fR and
-\fIminor_name\fR into a null-terminated ASCII string, returning a pointer to
-that string. To avoid shell conflicts, the \fIdevid\fR portion of the string is
-limited to uppercase and lowercase letters, digits, and the plus (+), minus
-(-), period (.), equals (=), underscore (_), tilde (~), and comma (,)
-characters. If there is an \fBASCII\fR quote character in the binary form of a
-\fIdevid\fR, the string representation will be in \fBhex_id\fR form, not
-\fBascii_id\fR form. The comma (,) character is added for "id1," at the head of
-the string \fIdevid\fR. If both a \fIdevid\fR and a \fIminor_name\fR are
-non-null, a slash (/)is used to separate the \fIdevid\fR from the
-\fIminor_name\fR in the encoded string. If \fIminor_name\fR is null, only the
-\fIdevid\fR is encoded. If the \fIdevid\fR is null then the special string
-"id0" is returned. Note that you cannot compare the returned string against
-another string with \fBstrcmp\fR(3C) to determine devid equality. The string
-returned must be freed by calling \fBdevid_str_free()\fR.
-.sp
-.LP
-The \fBdevid_str_decode()\fR function takes a string previously produced by the
-\fBdevid_str_encode()\fR or \fBddi_devid_str_encode()\fR (see
-\fBddi_devid_compare\fR(9F)) function and decodes the contained device ID and
-minor name, allocating and returning pointers to the extracted parts via the
-\fIretdevid\fR and \fIretminor_name\fR arguments. If the special \fIdevidstr\fR
-"id0" was specified, the returned device ID and minor name will both be null. A
-non-null returned devid must be freed by the caller by the \fBdevid_free()\fR
-function. A non-null returned minor name must be freed by calling
-\fBdevid_str_free()\fR.
-.sp
-.LP
-The \fBdevid_str_free()\fR function frees the character string returned by
-\fBdevid_str_encode()\fR and the \fIretminor_name\fR argument returned by
-\fBdevid_str_decode()\fR and \fBdevid_get_minor_name()\fR.
-.SH RETURN VALUES
-.LP
-Upon successful completion, the \fBdevid_get()\fR,
-\fBdevid_get_minor_name()\fR, \fBdevid_str_decode()\fR, and
-\fBdevid_deviceid_to_nmlist()\fR functions return \fB0\fR. Otherwise, they
-return \fB\(mi1\fR\&.
-.sp
-.LP
-The \fBdevid_compare()\fR function returns the following values:
-.sp
-.ne 2
-.na
-\fB\fB\(mi1\fR\fR
-.ad
-.RS 9n
-The device ID pointed to by \fIdevid1\fR is less than the device ID pointed to
-by \fIdevid2\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB0\fR\fR
-.ad
-.RS 9n
-The device ID pointed to by \fIdevid1\fR is equal to the device ID pointed to
-by \fIdevid2\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB1\fR\fR
-.ad
-.RS 9n
-The device ID pointed to by \fIdevid1\fR is greater than the device ID pointed
-to by \fIdevid2\fR.
-.RE
-
-.sp
-.LP
-The \fBdevid_sizeof()\fR function returns the size of \fIdevid\fR in bytes. If
-\fIdevid\fR is null, the number of bytes that must be allocated and initialized
-to determine the size of a complete device ID is returned.
-.sp
-.LP
-The \fBdevid_valid()\fR function returns 1 if the \fIdevid\fR is valid and 0 if
-the \fIdevid\fR is invalid.
-.sp
-.LP
-The \fBdevid_str_encode()\fR function returns \fINULL\fR to indicate failure.
-Failure may be caused by attempting to encode an invalid string. If the return
-value is non-null, the caller must free the returned string by using the
-\fBdevid_str_free()\fR function.
-.SH EXAMPLES
-.LP
-\fBExample 1 \fRUsing \fBdevid_get()\fR, \fBdevid_get_minor_name()\fR, and
-\fBdevid_str_encode()\fR
-.sp
-.LP
-The following example shows the proper use of \fBdevid_get()\fR,
-\fBdevid_get_minor_name()\fR, and \fBdevid_str_encode()\fR to free the space
-allocated for \fIdevid\fR, \fIminor_name\fR and encoded \fIdevid\fR.
-
-.sp
-.in +2
-.nf
+.Pp
+The
+.Fn devid_get
+function returns in
+.Fa retdevid
+the device ID for the device associated with the open file descriptor
+.Fa fd ,
+which refers to any device.
+It returns an error if the device does not have an associated device ID.
+The caller must free the memory allocated for
+.Fa retdevid
+using the
+.Fn devid_free
+function.
+.Pp
+The
+.Fn devid_free
+function frees the space that was allocated for the returned
+.Fa devid
+by
+.Fn devid_get
+and
+.Fn devid_str_decode .
+.Pp
+The
+.Fn devid_get_minor_name
+function returns the minor name, in
+.Fa retminor_name ,
+for the device associated with the open file descriptor
+.Fa fd .
+This name is specific to the particular minor number, but is
+.Qq instance number
+specific.
+The caller of this function must free the memory allocated for the returned
+.Fa retminor_name
+string using
+.Fn devid_str_free .
+.Pp
+The
+.Fn devid_deviceid_to_nmlist
+function returns an array of
+.Fa devid_nmlist
+structures, where each entry matches the
+.Fa devid
+and
+.Fa minor_name
+passed in.
+If the
+.Fa minor_name
+specified is one of the special values
+.Po
+.Dv DEVID_MINOR_NAME_ALL ,
+.Dv DEVID_MINOR_NAME_ALL_CHR ,
+or
+.Dv DEVID_MINOR_NAME_ALL_BLK
+.Pc ,
+then all minor names associated with
+.Fa devid
+which also meet the special
+.Fa minor_name
+filtering requirements are returned.
+The
+.Fa devid_nmlist
+structure contains the device name and device number.
+The last entry of the array contains a null pointer for the
+.Fa devname
+and
+.Dv NODEV
+for the device number.
+This function traverses the file tree, starting at
+.Fa search_path .
+For each device with a matching device ID and minor name tuple, a device name
+and device number are added to the
+.Fa retlist .
+If no matches are found, an error is returned.
+The caller of this function must free the memory allocated for the returned
+array with the
+.Fn devid_free_nmlist
+function.
+This function may take a long time to complete if called with the device ID of
+an unattached device.
+.Pp
+The
+.Fn devid_free_nmlist
+function frees the memory allocated by the
+.Fn devid_deviceid_to_nmlist
+function and returned in the
+.Fa retlist .
+.Pp
+The
+.Fn devid_compare
+function compares two device IDs and determines both equality and sort order.
+The function returns an integer greater than 0 if the device ID pointed to by
+.Fa devid1
+is greater than the device ID pointed to by
+.Fa devid2 .
+It returns 0 if the device ID pointed to by
+.Fa devid1
+is equal to the device ID pointed to by
+.Fa devid2 .
+It returns an integer less than 0 if the device ID pointed to by
+.Fa devid1
+is less than the device ID pointed to by
+.Fa devid2 .
+This function is the only valid mechanism to determine the equality of two
+devids.
+This function may indicate equality for arguments which by simple inspection
+appear different.
+.Pp
+The
+.Fn devid_sizeof
+function returns the size of
+.Fa devid
+in bytes.
+.Pp
+The
+.Fn devid_valid
+function validates the format of a
+.Fa devid .
+It returns 1 if the format is valid, and 0 if invalid.
+This check may not be as complete as the corresponding kernel function
+.Fn ddi_devid_valid
+.Po see
+.Xr ddi_devid_compare 9F
+.Pc .
+.Pp
+The
+.Fn devid_str_encode
+function encodes a
+.Fa devid
+and
+.Fa minor_name
+into a null-terminated ASCII string, returning a pointer to that string.
+To avoid shell conflicts, the
+.Fa devid
+portion of the string is limited to uppercase and lowercase letters, digits, and
+the plus
+.Pq Qq Sy \&+ ,
+minus
+.Pq Qq Sy \&- ,
+period
+.Pq Qq Sy \&. ,
+equals
+.Pq Qq Sy \&= ,
+underscore
+.Pq Qq Sy \&_ ,
+tilde
+.Pq Qq Sy \&~ ,
+and comma
+.Pq Qq Sy \&,
+characters.
+If there is an ASCII quote character in the binary form of a
+.Fa devid ,
+the string representation will be in hex_id form, not ascii_id form.
+The comma
+.Pq Qq Sy \&,
+character is added for
+.Qq id1,
+at the head of the string
+.Fa devid .
+If both a
+.Fa devid
+and a
+.Fa minor_name
+are non-null, a slash
+.Pq Qq Sy \&/
+is used to separate the
+.Fa devid
+from the
+.Fa minor_name
+in the encoded string.
+If
+.Fa minor_name
+is null, only the
+.Fa devid
+is encoded.
+If the
+.Fa devid
+is null then the special string
+.Qq id0
+is returned.
+Note that you cannot compare the returned string against another string with
+.Xr strcmp 3C
+to determine devid equality.
+The string returned must be freed by calling
+.Fn devid_str_free .
+.Pp
+The
+.Fn devid_str_from_path
+is similar to
+.Fn devid_str_encode ,
+but takes a
+.Fa path
+argument instead.
+If
+.Fa path
+includes the minor name, it will be encoded as well.
+The string returned must be freed by calling
+.Fn devid_str_free .
+.Pp
+The
+.Fn devid_str_decode
+function takes a string previously produced by the
+.Fn devid_str_encode
+or
+.Fn ddi_devid_str_encode
+.Po see
+.Xr ddi_devid_compare 9F
+.Pc
+function and decodes the contained device ID and minor name, allocating and
+returning pointers to the extracted parts via the
+.Fa retdevid
+and
+.Fa retminor_name
+arguments.
+If the special
+.Fa devidstr
+.Qq id0
+was specified, the returned device ID and minor name will both be null.
+A non-null returned devid must be freed by the caller by the
+.Fn devid_free
+function.
+A non-null returned minor name must be freed by calling
+.Fn devid_str_free .
+.Pp
+The
+.Fn devid_str_free
+function frees the character string returned by
+.Fn devid_str_encode
+and the
+.Fa retminor_name
+argument returned by
+.Fn devid_str_decode
+and
+.Fn devid_get_minor_name .
+.Sh RETURN VALUES
+Upon successful completion, the
+.Fn devid_get ,
+.Fn devid_get_minor_name ,
+.Fn devid_str_decode ,
+and
+.Fn devid_deviceid_to_nmlist
+functions return 0.
+Otherwise, they return -1.
+.Pp
+The
+.Fn devid_compare
+function returns the following values:
+.Bl -tag -width Ds
+.It Sy -1
+The device ID pointed to by
+.Fa devid1
+is less than the device ID pointed to by
+.Fa devid2 .
+.It Sy 0
+The device ID pointed to by
+.Fa devid1
+is equal to the device ID pointed to by
+.Fa devid2 .
+.It Sy 1
+The device ID pointed to by
+.Fa devid1
+is greater than the device ID pointed to by
+.Fa devid2 .
+.El
+.Pp
+The
+.Fn devid_sizeof
+function returns the size of
+.Fa devid
+in bytes.
+If
+.Fa devid
+is null, the number of bytes that must be allocated and initialized to determine
+the size of a complete device ID is returned.
+.Pp
+The
+.Fn devid_valid
+function returns 1 if the
+.Fa devid
+is valid and 0 if the
+.Fa devid
+is invalid.
+.Pp
+The
+.Fn devid_str_encode
+and
+.Fn devid_str_from_path
+functions return NULL to indicate failure.
+Failure may be caused by attempting to encode an invalid string.
+If the return value is non-null, the caller must free the returned string by
+using the
+.Fn devid_str_free
+function.
+.Sh EXAMPLES
+.Bl -tag -width Ds
+.It Xo
+.Sy Example 1
+Using
+.Fn devid_get ,
+.Fn devid_get_minor_name ,
+and
+.Fn devid_str_encode
+.Xc
+The following example shows the proper use of
+.Fn devid_get ,
+.Fn devid_get_minor_name ,
+and
+.Fn devid_str_encode
+to free the space allocated for
+.Fa devid ,
+.Fa minor_name
+and encoded
+.Fa devid .
+.Bd -literal
int fd;
-ddi_devid_t devid;
-char *minor_name, *devidstr;
+ddi_devid_t devid;
+char *minor_name, *devidstr;
+
if ((fd = open("/dev/dsk/c0t3d0s0", O_RDONLY|O_NDELAY)) < 0) {
...
}
@@ -260,48 +437,35 @@ printf("devid %s\en", devidstr);
devid_str_free(devidstr);
devid_free(devid);
devid_str_free(minor_name);
-.fi
-.in -2
-
-.LP
-\fBExample 2 \fRUsing \fBdevid_deviceid_to_nmlist()\fR and
-\fBdevid_free_nmlist()\fR
-.sp
-.LP
-The following example shows the proper use of \fBdevid_deviceid_to_nmlist()\fR
-and \fBdevid_free_nmlist()\fR:
+.Ed
+.It Xo
+.Sy Example 2
+Using
+.Fn devid_deviceid_to_nmlist
+and
+.Fn devid_free_nmlist
+.Xc
+The following example shows the proper use of
+.Fn devid_deviceid_to_nmlist
+and
+.Fn devid_free_nmlist :
+.Bd -literal
+devid_nmlist_t *list = NULL;
+int err;
-.sp
-.in +2
-.nf
-devid_nmlist_t *list = NULL;
-int err;
if (devid_deviceid_to_nmlist("/dev/rdsk", devid,
minor_name, &list))
- return (-1);
+ return (-1);
/* loop through list and process device names and numbers */
devid_free_nmlist(list);
-.fi
-.in -2
-
-.SH ATTRIBUTES
-.LP
-See \fBattributes\fR(5) for description of the following attributes:
-.sp
-
-.sp
-.TS
-box;
-c | c
-l | l .
-ATTRIBUTE TYPE ATTRIBUTE VALUE
-_
-MT-Level MT\(miSafe
-_
-Interface Stability Stable
-.TE
-
-.SH SEE ALSO
-.LP
-\fBfree\fR(3C), \fBlibdevid\fR(3LIB), \fBattributes\fR(5),
-\fBddi_devid_compare\fR(9F)
+.Ed
+.El
+.Sh MT-LEVEL
+.Sy MT-Safe
+.Sh INTERFACE STABILITY
+.Sy Stable
+.Sh SEE ALSO
+.Xr free 3C ,
+.Xr libdevid 3LIB ,
+.Xr attributes 5 ,
+.Xr ddi_devid_compare 9F
diff --git a/usr/src/pkg/manifests/system-test-utiltest.mf b/usr/src/pkg/manifests/system-test-utiltest.mf
index bd977ecd6f..c0f900c31b 100644
--- a/usr/src/pkg/manifests/system-test-utiltest.mf
+++ b/usr/src/pkg/manifests/system-test-utiltest.mf
@@ -38,6 +38,8 @@ file path=opt/util-tests/tests/dis/i386/32.adx.out mode=0555
file path=opt/util-tests/tests/dis/i386/32.adx.s mode=0555
file path=opt/util-tests/tests/dis/i386/32.aes.out mode=0555
file path=opt/util-tests/tests/dis/i386/32.aes.s mode=0555
+file path=opt/util-tests/tests/dis/i386/32.avx2.out mode=0555
+file path=opt/util-tests/tests/dis/i386/32.avx2.s mode=0555
file path=opt/util-tests/tests/dis/i386/32.bmi1.out mode=0555
file path=opt/util-tests/tests/dis/i386/32.bmi1.s mode=0555
file path=opt/util-tests/tests/dis/i386/32.bmi2.out mode=0555
@@ -56,6 +58,10 @@ file path=opt/util-tests/tests/dis/i386/32.popcnt.out mode=0555
file path=opt/util-tests/tests/dis/i386/32.popcnt.s mode=0555
file path=opt/util-tests/tests/dis/i386/32.sha.out mode=0555
file path=opt/util-tests/tests/dis/i386/32.sha.s mode=0555
+file path=opt/util-tests/tests/dis/i386/32.sse-3.out mode=0555
+file path=opt/util-tests/tests/dis/i386/32.sse-3.s mode=0555
+file path=opt/util-tests/tests/dis/i386/32.sse-4.1.out mode=0555
+file path=opt/util-tests/tests/dis/i386/32.sse-4.1.s mode=0555
file path=opt/util-tests/tests/dis/i386/32.sse-4.2.out mode=0555
file path=opt/util-tests/tests/dis/i386/32.sse-4.2.s mode=0555
file path=opt/util-tests/tests/dis/i386/32.ssse3.out mode=0555
@@ -66,6 +72,8 @@ file path=opt/util-tests/tests/dis/i386/64.adx.out mode=0555
file path=opt/util-tests/tests/dis/i386/64.adx.s mode=0555
file path=opt/util-tests/tests/dis/i386/64.aes.out mode=0555
file path=opt/util-tests/tests/dis/i386/64.aes.s mode=0555
+file path=opt/util-tests/tests/dis/i386/64.avx2.out mode=0555
+file path=opt/util-tests/tests/dis/i386/64.avx2.s mode=0555
file path=opt/util-tests/tests/dis/i386/64.bmi1.out mode=0555
file path=opt/util-tests/tests/dis/i386/64.bmi1.s mode=0555
file path=opt/util-tests/tests/dis/i386/64.bmi2.out mode=0555
@@ -88,6 +96,10 @@ file path=opt/util-tests/tests/dis/i386/64.random.out mode=0555
file path=opt/util-tests/tests/dis/i386/64.random.s mode=0555
file path=opt/util-tests/tests/dis/i386/64.sha.out mode=0555
file path=opt/util-tests/tests/dis/i386/64.sha.s mode=0555
+file path=opt/util-tests/tests/dis/i386/64.sse-3.out mode=0555
+file path=opt/util-tests/tests/dis/i386/64.sse-3.s mode=0555
+file path=opt/util-tests/tests/dis/i386/64.sse-4.1.out mode=0555
+file path=opt/util-tests/tests/dis/i386/64.sse-4.1.s mode=0555
file path=opt/util-tests/tests/dis/i386/64.sse-4.2.out mode=0555
file path=opt/util-tests/tests/dis/i386/64.sse-4.2.s mode=0555
file path=opt/util-tests/tests/dis/i386/64.ssse3.out mode=0555
diff --git a/usr/src/uts/common/Makefile.files b/usr/src/uts/common/Makefile.files
index a18d021dd6..e6f085938c 100644
--- a/usr/src/uts/common/Makefile.files
+++ b/usr/src/uts/common/Makefile.files
@@ -1665,7 +1665,8 @@ CONSCONFIG_OBJS += consconfig.o
CONSCONFIG_DACF_OBJS += consconfig_dacf.o consplat.o
-TEM_OBJS += tem.o tem_safe.o 6x10.o 7x14.o 12x22.o
+TEM_OBJS += tem.o tem_safe.o
+FONT_OBJS += font.o 6x10.o 7x14.o 8x16.o 12x22.o
KBTRANS_OBJS += \
kbtrans.o \
diff --git a/usr/src/uts/common/Makefile.rules b/usr/src/uts/common/Makefile.rules
index 1af39fe6e7..af7f4ce04b 100644
--- a/usr/src/uts/common/Makefile.rules
+++ b/usr/src/uts/common/Makefile.rules
@@ -2041,6 +2041,9 @@ $(LINTS_DIR)/%.ln: $(UTSBASE)/common/inet/dlpistub/%.c
$(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
+$(LINTS_DIR)/%.ln: $(UTSBASE)/common/font/%.c
+ @($(LHEAD) $(LINT.c) $< $(LTAIL))
+
$(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/1394/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
diff --git a/usr/src/uts/common/io/12x22.c b/usr/src/uts/common/font/12x22.c
index 43c5683e34..43c5683e34 100644
--- a/usr/src/uts/common/io/12x22.c
+++ b/usr/src/uts/common/font/12x22.c
diff --git a/usr/src/uts/common/io/6x10.c b/usr/src/uts/common/font/6x10.c
index efafb9c2c2..efafb9c2c2 100644
--- a/usr/src/uts/common/io/6x10.c
+++ b/usr/src/uts/common/font/6x10.c
diff --git a/usr/src/uts/common/io/7x14.c b/usr/src/uts/common/font/7x14.c
index afc7b6f237..afc7b6f237 100644
--- a/usr/src/uts/common/io/7x14.c
+++ b/usr/src/uts/common/font/7x14.c
diff --git a/usr/src/uts/intel/io/vgatext/8859-1.bdf b/usr/src/uts/common/font/8859-1.bdf
index 435acde1c6..eb917bdea7 100644
--- a/usr/src/uts/intel/io/vgatext/8859-1.bdf
+++ b/usr/src/uts/common/font/8859-1.bdf
@@ -1,4 +1,3 @@
-COMMENT #pragma ident "%Z%%M% %I% %E% SMI"
COMMENT
COMMENT Copyright 2005 Sun Microsystems, Inc. All rights reserved.
COMMENT Use is subject to license terms.
diff --git a/usr/src/uts/intel/io/vgatext/bdf_to_c.awk b/usr/src/uts/common/font/bdf_to_c.awk
index 5365d41bce..5365d41bce 100644
--- a/usr/src/uts/intel/io/vgatext/bdf_to_c.awk
+++ b/usr/src/uts/common/font/bdf_to_c.awk
diff --git a/usr/src/uts/common/font/font.c b/usr/src/uts/common/font/font.c
new file mode 100644
index 0000000000..c27001131c
--- /dev/null
+++ b/usr/src/uts/common/font/font.c
@@ -0,0 +1,258 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright 2017 Toomas Soome <tsoome@me.com>
+ */
+
+/*
+ * Generic font related data and functions shared by early boot console
+ * in dboot, kernel startup and full kernel.
+ */
+#include <sys/types.h>
+#include <sys/systm.h>
+#include <sys/font.h>
+#include <sys/sysmacros.h>
+
+/*
+ * Fonts are statically linked with this module. At some point an
+ * RFE might be desireable to allow dynamic font loading. The
+ * original intention to facilitate dynamic fonts can be seen
+ * by examining the data structures and set_font(). As much of
+ * the original code is retained but modified to be suited for
+ * traversing a list of static fonts.
+ */
+
+/*
+ * Must be sorted by font size in descending order
+ */
+struct fontlist fonts[] = {
+ { &font_data_12x22, NULL },
+ { &font_data_8x16, NULL },
+ { &font_data_7x14, NULL },
+ { &font_data_6x10, NULL },
+ { NULL, NULL }
+};
+
+void
+set_font(struct font *f, short *rows, short *cols, short height, short width)
+{
+ bitmap_data_t *font_selected = NULL;
+ struct fontlist *fl;
+ int i;
+
+ /*
+ * Find best font for these dimensions, or use default
+ *
+ * A 1 pixel border is the absolute minimum we could have
+ * as a border around the text window (BORDER_PIXELS = 2),
+ * however a slightly larger border not only looks better
+ * but for the fonts currently statically built into the
+ * emulator causes much better font selection for the
+ * normal range of screen resolutions.
+ */
+ for (fl = fonts; fl->data; fl++) {
+ if ((((*rows * fl->data->height) + BORDER_PIXELS) <= height) &&
+ (((*cols * fl->data->width) + BORDER_PIXELS) <= width)) {
+ font_selected = fl->data;
+ break;
+ }
+ }
+ /*
+ * The minus 2 is to make sure we have at least a 1 pixel
+ * border around the entire screen.
+ */
+ if (font_selected == NULL) {
+ if (((*rows * DEFAULT_FONT_DATA.height) > height) ||
+ ((*cols * DEFAULT_FONT_DATA.width) > width)) {
+ *rows = (height - 2) / DEFAULT_FONT_DATA.height;
+ *cols = (width - 2) / DEFAULT_FONT_DATA.width;
+ }
+ font_selected = &DEFAULT_FONT_DATA;
+ }
+
+ f->width = font_selected->width;
+ f->height = font_selected->height;
+
+ for (i = 0; i < ENCODED_CHARS; i++)
+ f->char_ptr[i] = font_selected->encoding[i];
+
+ f->image_data = font_selected->image;
+
+}
+
+/*
+ * bit_to_pix4 is for 4-bit frame buffers. It will write one output byte
+ * for each 2 bits of input bitmap. It inverts the input bits before
+ * doing the output translation, for reverse video.
+ *
+ * Assuming foreground is 0001 and background is 0000...
+ * An input data byte of 0x53 will output the bit pattern
+ * 00000001 00000001 00000000 00010001.
+ */
+
+void
+font_bit_to_pix4(
+ struct font *f,
+ uint8_t *dest,
+ uint8_t c,
+ uint8_t fg_color,
+ uint8_t bg_color)
+{
+ int row;
+ int byte;
+ int i;
+ uint8_t *cp;
+ uint8_t data;
+ uint8_t nibblett;
+ int bytes_wide;
+
+ cp = f->char_ptr[c];
+ bytes_wide = (f->width + 7) / 8;
+
+ for (row = 0; row < f->height; row++) {
+ for (byte = 0; byte < bytes_wide; byte++) {
+ data = *cp++;
+ for (i = 0; i < 4; i++) {
+ nibblett = (data >> ((3-i) * 2)) & 0x3;
+ switch (nibblett) {
+ case 0x0:
+ *dest++ = bg_color << 4 | bg_color;
+ break;
+ case 0x1:
+ *dest++ = bg_color << 4 | fg_color;
+ break;
+ case 0x2:
+ *dest++ = fg_color << 4 | bg_color;
+ break;
+ case 0x3:
+ *dest++ = fg_color << 4 | fg_color;
+ break;
+ }
+ }
+ }
+ }
+}
+
+/*
+ * bit_to_pix8 is for 8-bit frame buffers. It will write one output byte
+ * for each bit of input bitmap. It inverts the input bits before
+ * doing the output translation, for reverse video.
+ *
+ * Assuming foreground is 00000001 and background is 00000000...
+ * An input data byte of 0x53 will output the bit pattern
+ * 0000000 000000001 00000000 00000001 00000000 00000000 00000001 00000001.
+ */
+
+void
+font_bit_to_pix8(
+ struct font *f,
+ uint8_t *dest,
+ uint8_t c,
+ uint8_t fg_color,
+ uint8_t bg_color)
+{
+ int row;
+ int byte;
+ int i;
+ uint8_t *cp;
+ uint8_t data;
+ int bytes_wide;
+ uint8_t mask;
+ int bitsleft, nbits;
+
+ cp = f->char_ptr[c];
+ bytes_wide = (f->width + 7) / 8;
+
+ for (row = 0; row < f->height; row++) {
+ bitsleft = f->width;
+ for (byte = 0; byte < bytes_wide; byte++) {
+ data = *cp++;
+ mask = 0x80;
+ nbits = MIN(8, bitsleft);
+ bitsleft -= nbits;
+ for (i = 0; i < nbits; i++) {
+ *dest++ = (data & mask ? fg_color: bg_color);
+ mask = mask >> 1;
+ }
+ }
+ }
+}
+
+/*
+ * bit_to_pix24 is for 24-bit frame buffers. It will write four output bytes
+ * for each bit of input bitmap. It inverts the input bits before
+ * doing the output translation, for reverse video. Note that each
+ * 24-bit RGB value is finally stored in a 32-bit unsigned int, with the
+ * high-order byte set to zero.
+ *
+ * Assuming foreground is 00000000 11111111 11111111 11111111
+ * and background is 00000000 00000000 00000000 00000000
+ * An input data byte of 0x53 will output the bit pattern
+ *
+ * 00000000 00000000 00000000 00000000
+ * 00000000 11111111 11111111 11111111
+ * 00000000 00000000 00000000 00000000
+ * 00000000 11111111 11111111 11111111
+ * 00000000 00000000 00000000 00000000
+ * 00000000 00000000 00000000 00000000
+ * 00000000 11111111 11111111 11111111
+ * 00000000 11111111 11111111 11111111
+ *
+ */
+
+void
+font_bit_to_pix24(
+ struct font *f,
+ uint32_t *dest,
+ uint8_t c,
+ uint32_t fg_color32,
+ uint32_t bg_color32)
+{
+ int row;
+ int byte;
+ int i;
+ uint8_t *cp;
+ uint32_t data;
+ int bytes_wide;
+ int bitsleft, nbits;
+
+ cp = f->char_ptr[c];
+ bytes_wide = (f->width + 7) / 8;
+
+ for (row = 0; row < f->height; row++) {
+ bitsleft = f->width;
+ for (byte = 0; byte < bytes_wide; byte++) {
+ data = *cp++;
+ nbits = MIN(8, bitsleft);
+ bitsleft -= nbits;
+ for (i = 0; i < nbits; i++) {
+ *dest++ = ((data << i) & 0x80 ?
+ fg_color32 : bg_color32);
+ }
+ }
+ }
+}
diff --git a/usr/src/uts/common/io/tem_safe.c b/usr/src/uts/common/io/tem_safe.c
index 63dfe52a34..3540cb085d 100644
--- a/usr/src/uts/common/io/tem_safe.c
+++ b/usr/src/uts/common/io/tem_safe.c
@@ -171,36 +171,11 @@ text_cmap_t cmap4_to_24 = {
/* END CSTYLED */
};
-#define PIX4TO32(pix4) (pixel32_t)( \
+#define PIX4TO32(pix4) (uint32_t)( \
cmap4_to_24.red[pix4] << 16 | \
cmap4_to_24.green[pix4] << 8 | \
cmap4_to_24.blue[pix4])
-/*
- * Fonts are statically linked with this module. At some point an
- * RFE might be desireable to allow dynamic font loading. The
- * original intention to facilitate dynamic fonts can be seen
- * by examining the data structures and set_font(). As much of
- * the original code is retained but modified to be suited to
- * traversing a list of static fonts.
- */
-extern struct fontlist fonts[];
-
-#define DEFAULT_FONT_DATA font_data_12x22
-
-extern bitmap_data_t font_data_12x22;
-extern bitmap_data_t font_data_7x14;
-extern bitmap_data_t font_data_6x10;
-/*
- * Must be sorted by font size in descending order
- */
-struct fontlist fonts[] = {
- { &font_data_12x22, NULL },
- { &font_data_7x14, NULL },
- { &font_data_6x10, NULL },
- { NULL, NULL }
-};
-
#define INVERSE(ch) (ch ^ 0xff)
#define tem_safe_callback_display (*tems.ts_callbacks->tsc_display)
@@ -313,10 +288,8 @@ tem_safe_terminal_emulate(
* from quiesced or normal (ie. use polled I/O vs. layered ioctls)
*/
static void
-tems_safe_display(
- struct vis_consdisplay *pda,
- cred_t *credp,
- enum called_from called_from)
+tems_safe_display(struct vis_consdisplay *pda, cred_t *credp,
+ enum called_from called_from)
{
if (called_from == CALLED_FROM_STANDALONE)
tems.ts_fb_polledio->display(tems.ts_fb_polledio->arg, pda);
@@ -330,10 +303,8 @@ tems_safe_display(
* from, quiesced or normal (ie. use polled I/O vs. layered ioctls)
*/
void
-tems_safe_copy(
- struct vis_conscopy *pca,
- cred_t *credp,
- enum called_from called_from)
+tems_safe_copy(struct vis_conscopy *pca, cred_t *credp,
+ enum called_from called_from)
{
if (called_from == CALLED_FROM_STANDALONE)
tems.ts_fb_polledio->copy(tems.ts_fb_polledio->arg, pca);
@@ -348,10 +319,8 @@ tems_safe_copy(
* normal (ie. use polled I/O vs. layered ioctls).
*/
static void
-tems_safe_cursor(
- struct vis_conscursor *pca,
- cred_t *credp,
- enum called_from called_from)
+tems_safe_cursor(struct vis_conscursor *pca, cred_t *credp,
+ enum called_from called_from)
{
if (called_from == CALLED_FROM_STANDALONE)
tems.ts_fb_polledio->cursor(tems.ts_fb_polledio->arg, pca);
@@ -365,11 +334,8 @@ tems_safe_cursor(
*/
static void
-tem_safe_control(
- struct tem_vt_state *tem,
- uchar_t ch,
- cred_t *credp,
- enum called_from called_from)
+tem_safe_control(struct tem_vt_state *tem, uchar_t ch, cred_t *credp,
+ enum called_from called_from)
{
tem->tvs_state = A_STATE_START;
switch (ch) {
@@ -585,11 +551,8 @@ tem_safe_selgraph(struct tem_vt_state *tem)
* It assumes that the next lower level will do so.
*/
static void
-tem_safe_chkparam(
- struct tem_vt_state *tem,
- uchar_t ch,
- cred_t *credp,
- enum called_from called_from)
+tem_safe_chkparam(struct tem_vt_state *tem, uchar_t ch, cred_t *credp,
+ enum called_from called_from)
{
int i;
int row;
@@ -1420,8 +1383,6 @@ tem_safe_text_cls(struct tem_vt_state *tem,
tems_safe_display(&da, credp, called_from);
}
-
-
void
tem_safe_pix_display(struct tem_vt_state *tem,
uchar_t *string, int count,
@@ -1974,214 +1935,35 @@ tem_safe_pix_cursor(struct tem_vt_state *tem, short action,
tems_safe_cursor(&ca, credp, called_from);
}
-#define BORDER_PIXELS 10
-void
-set_font(struct font *f, short *rows, short *cols, short height, short width)
-{
- bitmap_data_t *font_selected = NULL;
- struct fontlist *fl;
-
- /*
- * Find best font for these dimensions, or use default
- *
- * A 1 pixel border is the absolute minimum we could have
- * as a border around the text window (BORDER_PIXELS = 2),
- * however a slightly larger border not only looks better
- * but for the fonts currently statically built into the
- * emulator causes much better font selection for the
- * normal range of screen resolutions.
- */
- for (fl = fonts; fl->data; fl++) {
- if ((((*rows * fl->data->height) + BORDER_PIXELS) <= height) &&
- (((*cols * fl->data->width) + BORDER_PIXELS) <= width)) {
- font_selected = fl->data;
- break;
- }
- }
- /*
- * The minus 2 is to make sure we have at least a 1 pixel
- * boarder around the entire screen.
- */
- if (font_selected == NULL) {
- if (((*rows * DEFAULT_FONT_DATA.height) > height) ||
- ((*cols * DEFAULT_FONT_DATA.width) > width)) {
- *rows = (height - 2) / DEFAULT_FONT_DATA.height;
- *cols = (width - 2) / DEFAULT_FONT_DATA.width;
- }
- font_selected = &DEFAULT_FONT_DATA;
- }
-
- f->width = font_selected->width;
- f->height = font_selected->height;
- bcopy((caddr_t)font_selected->encoding, (caddr_t)f->char_ptr,
- sizeof (f->char_ptr));
- f->image_data = font_selected->image;
-
-}
-
-/*
- * bit_to_pix4 is for 4-bit frame buffers. It will write one output byte
- * for each 2 bits of input bitmap. It inverts the input bits before
- * doing the output translation, for reverse video.
- *
- * Assuming foreground is 0001 and background is 0000...
- * An input data byte of 0x53 will output the bit pattern
- * 00000001 00000001 00000000 00010001.
- */
-
static void
-bit_to_pix4(
- struct tem_vt_state *tem,
- uchar_t c,
- text_color_t fg_color,
+bit_to_pix4(struct tem_vt_state *tem, uchar_t c, text_color_t fg_color,
text_color_t bg_color)
{
- int row;
- int byte;
- int i;
- uint8_t *cp;
- uint8_t data;
- uint8_t nibblett;
- int bytes_wide;
- uint8_t *dest;
-
- dest = (uint8_t *)tem->tvs_pix_data;
-
- cp = tems.ts_font.char_ptr[c];
- bytes_wide = (tems.ts_font.width + 7) / 8;
-
- for (row = 0; row < tems.ts_font.height; row++) {
- for (byte = 0; byte < bytes_wide; byte++) {
- data = *cp++;
- for (i = 0; i < 4; i++) {
- nibblett = (data >> ((3-i) * 2)) & 0x3;
- switch (nibblett) {
- case 0x0:
- *dest++ = bg_color << 4 | bg_color;
- break;
- case 0x1:
- *dest++ = bg_color << 4 | fg_color;
- break;
- case 0x2:
- *dest++ = fg_color << 4 | bg_color;
- break;
- case 0x3:
- *dest++ = fg_color << 4 | fg_color;
- break;
- }
- }
- }
- }
+ uint8_t *dest = (uint8_t *)tem->tvs_pix_data;
+ font_bit_to_pix4(&tems.ts_font, dest, c, fg_color, bg_color);
}
-/*
- * bit_to_pix8 is for 8-bit frame buffers. It will write one output byte
- * for each bit of input bitmap. It inverts the input bits before
- * doing the output translation, for reverse video.
- *
- * Assuming foreground is 00000001 and background is 00000000...
- * An input data byte of 0x53 will output the bit pattern
- * 0000000 000000001 00000000 00000001 00000000 00000000 00000001 00000001.
- */
-
static void
-bit_to_pix8(
- struct tem_vt_state *tem,
- uchar_t c,
- text_color_t fg_color,
+bit_to_pix8(struct tem_vt_state *tem, uchar_t c, text_color_t fg_color,
text_color_t bg_color)
{
- int row;
- int byte;
- int i;
- uint8_t *cp;
- uint8_t data;
- int bytes_wide;
- uint8_t mask;
- int bitsleft, nbits;
- uint8_t *dest;
-
- dest = (uint8_t *)tem->tvs_pix_data;
-
- cp = tems.ts_font.char_ptr[c];
- bytes_wide = (tems.ts_font.width + 7) / 8;
-
- for (row = 0; row < tems.ts_font.height; row++) {
- bitsleft = tems.ts_font.width;
- for (byte = 0; byte < bytes_wide; byte++) {
- data = *cp++;
- mask = 0x80;
- nbits = MIN(8, bitsleft);
- bitsleft -= nbits;
- for (i = 0; i < nbits; i++) {
- *dest++ = (data & mask ? fg_color: bg_color);
- mask = mask >> 1;
- }
- }
- }
+ uint8_t *dest = (uint8_t *)tem->tvs_pix_data;
+ font_bit_to_pix8(&tems.ts_font, dest, c, fg_color, bg_color);
}
-/*
- * bit_to_pix24 is for 24-bit frame buffers. It will write four output bytes
- * for each bit of input bitmap. It inverts the input bits before
- * doing the output translation, for reverse video. Note that each
- * 24-bit RGB value is finally stored in a 32-bit unsigned int, with the
- * high-order byte set to zero.
- *
- * Assuming foreground is 00000000 11111111 11111111 11111111
- * and background is 00000000 00000000 00000000 00000000
- * An input data byte of 0x53 will output the bit pattern
- *
- * 00000000 00000000 00000000 00000000
- * 00000000 11111111 11111111 11111111
- * 00000000 00000000 00000000 00000000
- * 00000000 11111111 11111111 11111111
- * 00000000 00000000 00000000 00000000
- * 00000000 00000000 00000000 00000000
- * 00000000 11111111 11111111 11111111
- * 00000000 11111111 11111111 11111111
- *
- */
-typedef uint32_t pixel32_t;
-
static void
-bit_to_pix24(
- struct tem_vt_state *tem,
- uchar_t c,
- text_color_t fg_color4,
- text_color_t bg_color4)
+bit_to_pix24(struct tem_vt_state *tem, uchar_t c, text_color_t fg_color4,
+ text_color_t bg_color4)
{
- int row;
- int byte;
- int i;
- uint8_t *cp;
- uint8_t data;
- int bytes_wide;
- int bitsleft, nbits;
-
- pixel32_t fg_color32, bg_color32, *destp;
+ uint32_t fg_color32, bg_color32, *dest;
ASSERT(fg_color4 < 16 && bg_color4 < 16);
fg_color32 = PIX4TO32(fg_color4);
bg_color32 = PIX4TO32(bg_color4);
- destp = (pixel32_t *)tem->tvs_pix_data;
- cp = tems.ts_font.char_ptr[c];
- bytes_wide = (tems.ts_font.width + 7) / 8;
-
- for (row = 0; row < tems.ts_font.height; row++) {
- bitsleft = tems.ts_font.width;
- for (byte = 0; byte < bytes_wide; byte++) {
- data = *cp++;
- nbits = MIN(8, bitsleft);
- bitsleft -= nbits;
- for (i = 0; i < nbits; i++) {
- *destp++ = ((data << i) & 0x80 ?
- fg_color32 : bg_color32);
- }
- }
- }
+ dest = (uint32_t *)tem->tvs_pix_data;
+ font_bit_to_pix24(&tems.ts_font, dest, c, fg_color32, bg_color32);
}
static text_color_t
diff --git a/usr/src/uts/common/sys/font.h b/usr/src/uts/common/sys/font.h
index 11b0dc51d2..c4de4e9ddf 100644
--- a/usr/src/uts/common/sys/font.h
+++ b/usr/src/uts/common/sys/font.h
@@ -27,16 +27,22 @@
#ifndef _SYS_FONT_H
#define _SYS_FONT_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#ifdef __cplusplus
extern "C" {
#endif
+/*
+ * Number of chars encoded in font data. Bundled fonts are generated
+ * from bdf files and this constant depends on the data in the bdf file.
+ * If more entries are added to the bdf files, then this number must be
+ * increased.
+ */
+#define ENCODED_CHARS 256
+
struct font {
short width;
short height;
- uchar_t *char_ptr[256];
+ uchar_t *char_ptr[ENCODED_CHARS];
void *image_data;
};
@@ -52,6 +58,23 @@ struct fontlist {
bitmap_data_t *(*fontload)(char *);
};
+extern struct fontlist fonts[];
+
+#define DEFAULT_FONT_DATA font_data_12x22
+#define BORDER_PIXELS 10 /* space from screen border */
+/*
+ * Built in fonts.
+ */
+extern bitmap_data_t font_data_12x22;
+extern bitmap_data_t font_data_8x16;
+extern bitmap_data_t font_data_7x14;
+extern bitmap_data_t font_data_6x10;
+
+void set_font(struct font *, short *, short *, short, short);
+void font_bit_to_pix4(struct font *, uint8_t *, uchar_t, uint8_t, uint8_t);
+void font_bit_to_pix8(struct font *, uint8_t *, uchar_t, uint8_t, uint8_t);
+void font_bit_to_pix24(struct font *, uint32_t *, uchar_t, uint32_t, uint32_t);
+
#ifdef __cplusplus
}
#endif
diff --git a/usr/src/uts/common/sys/tem_impl.h b/usr/src/uts/common/sys/tem_impl.h
index fb982645f4..a5a65e4a52 100644
--- a/usr/src/uts/common/sys/tem_impl.h
+++ b/usr/src/uts/common/sys/tem_impl.h
@@ -292,7 +292,6 @@ void tem_safe_pix_clear_entire_screen(struct tem_vt_state *,
void tem_safe_get_color(struct tem_vt_state *, text_color_t *,
text_color_t *, uint8_t);
-void set_font(struct font *, short *, short *, short, short);
void tem_safe_blank_screen(struct tem_vt_state *, cred_t *,
enum called_from);
diff --git a/usr/src/uts/i86pc/Makefile.files b/usr/src/uts/i86pc/Makefile.files
index f118c9e331..7e782f3f61 100644
--- a/usr/src/uts/i86pc/Makefile.files
+++ b/usr/src/uts/i86pc/Makefile.files
@@ -138,7 +138,8 @@ BOOT_DRIVER_OBJS = \
boot_keyboard.o \
boot_keyboard_table.o \
boot_vga.o \
- boot_mmu.o
+ boot_mmu.o \
+ $(FONT_OBJS)
CORE_OBJS += $(BOOT_DRIVER_OBJS)
diff --git a/usr/src/uts/i86pc/Makefile.rules b/usr/src/uts/i86pc/Makefile.rules
index 5d8c84a25e..b8357fc567 100644
--- a/usr/src/uts/i86pc/Makefile.rules
+++ b/usr/src/uts/i86pc/Makefile.rules
@@ -84,6 +84,9 @@ DRMACH_IO = $(UTSBASE)/i86pc/io/acpi/drmach_acpi
DRMACH_GENERR = $(DRMACH_IO)/sbdgenerr
DR_IO = $(UTSBASE)/i86pc/io/dr
DR_GENERR = $(DR_IO)/sbdgenerr
+VGATEXT_FONT = 8x16
+VGATEXT_FONT_SRC= 8859-1
+VGATEXT_FONT_DIR= $(UTSBASE)/common/font
$(DRMACH_GENERR): $(DR_IO)/sbdgenerr.pl
$(RM) $@
@@ -183,6 +186,19 @@ $(OBJS_DIR)/%.o: $(UTSBASE)/common/io/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
+$(OBJS_DIR)/%.o: $(UTSBASE)/common/font/%.c
+ $(COMPILE.c) -o $@ $<
+ $(CTFCONVERT_O)
+
+$(OBJS_DIR)/$(VGATEXT_FONT).c: $(VGATEXT_FONT_DIR)/$(VGATEXT_FONT_SRC).bdf \
+ $(VGATEXT_FONT_DIR)/bdf_to_c.awk
+ $(AWK) -f $(VGATEXT_FONT_DIR)/bdf_to_c.awk \
+ $(VGATEXT_FONT_DIR)/$(VGATEXT_FONT_SRC).bdf > $@
+
+$(OBJS_DIR)/%.o: $(OBJS_DIR)/%.c
+ $(COMPILE.c) -o $@ $<
+ $(CTFCONVERT_O)
+
$(OBJS_DIR)/%.o: $(UTSBASE)/common/io/ppm/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
@@ -243,9 +259,24 @@ $(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86pc/dboot/%.c
$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/intel/ia32/%.s
$(DBOOT_AS) -P -D_ASM $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
+$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/common/font/%.c
+ $(i386_CC) $(DBOOT_FLAGS) -O $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
+
+$(DBOOT_OBJS_DIR)/$(VGATEXT_FONT).c: \
+ $(VGATEXT_FONT_DIR)/$(VGATEXT_FONT_SRC).bdf \
+ $(VGATEXT_FONT_DIR)/bdf_to_c.awk
+ $(AWK) -f $(VGATEXT_FONT_DIR)/bdf_to_c.awk \
+ $(VGATEXT_FONT_DIR)/$(VGATEXT_FONT_SRC).bdf > $@
+
+$(DBOOT_OBJS_DIR)/%.o: $(DBOOT_OBJS_DIR)/%.c
+ $(i386_CC) $(DBOOT_FLAGS) -O $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
+
$(DBOOT_OBJS_DIR)/%.o: $(COMMONBASE)/crypto/sha1/%.c
$(i386_CC) $(DBOOT_FLAGS) -O $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
+$(DBOOT_OBJS_DIR)/%.o: $(DBOOT_OBJS_DIR)/%.c
+ $(i386_CC) $(DBOOT_FLAGS) -O $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
+
$(DBOOT_OBJS_DIR)/%.o: $(COMMONBASE)/util/%.c
$(i386_CC) $(DBOOT_FLAGS) -O $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
@@ -410,6 +441,9 @@ $(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/boot/%.c
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/vm/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
+$(LINTS_DIR)/%.ln: $(UTSBASE)/common/font/%.c
+ @($(LHEAD) $(LINT.c) $< $(LTAIL))
+
$(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
@@ -460,6 +494,12 @@ $(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/dboot/%.c
$(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/dboot/%.s
@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
+$(DBOOT_LINTS_DIR)/%.ln: $(DBOOT_LINTS_DIR)/%.c
+ @($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
+
+$(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/common/font/%.c
+ @($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
+
$(DBOOT_LINTS_DIR)/%.ln: $(COMMONBASE)/crypto/sha1/%.c
@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
diff --git a/usr/src/uts/i86pc/gfx_private/Makefile b/usr/src/uts/i86pc/gfx_private/Makefile
index be3b8777e6..a4c82da1bf 100644
--- a/usr/src/uts/i86pc/gfx_private/Makefile
+++ b/usr/src/uts/i86pc/gfx_private/Makefile
@@ -38,11 +38,9 @@ UTSBASE = ../..
# Define the module and object file sets.
#
MODULE = gfx_private
-OBJECTS = $(GFX_PRIVATE_OBJS:%=$(OBJS_DIR)/%) $(OBJS_DIR)/$(VGATEXT_FONT).o
+OBJECTS = $(GFX_PRIVATE_OBJS:%=$(OBJS_DIR)/%)
LINTS = $(GFX_PRIVATE_OBJS:%.o=$(LINTS_DIR)/%.ln)
ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE)
-VGATEXT_FONT = 8859-1
-VGATEXT_SRC = $(UTSBASE)/intel/io/vgatext
GFXP_VGATEXT = gfxp_vgatext
GFXP_VGATEXT_SRC = $(UTSBASE)/i86pc/io/gfx_private
@@ -75,8 +73,6 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
CERRWARN += -_gcc=-Wno-uninitialized
CERRWARN += -_gcc=-Wno-parentheses
-CLOBBERFILES += $(OBJS_DIR)/$(VGATEXT_FONT).c
-
#
# Default build targets.
#
@@ -98,16 +94,6 @@ clean.lint: $(CLEAN_LINT_DEPS)
install: $(INSTALL_DEPS)
-# Custom targets and rules
-
-$(OBJS_DIR)/$(VGATEXT_FONT).c: $(VGATEXT_SRC)/$(VGATEXT_FONT).bdf
- $(AWK) -f $(VGATEXT_SRC)/bdf_to_c.awk \
- $(VGATEXT_SRC)/$(VGATEXT_FONT).bdf > $@
-
-$(OBJS_DIR)/$(VGATEXT_FONT).o: $(OBJS_DIR)/$(VGATEXT_FONT).c
- $(COMPILE.c) -o $@ $<
- $(CTFCONVERT_O)
-
#
# Include common targets.
#
diff --git a/usr/src/uts/i86pc/io/gfx_private/gfxp_vgatext.c b/usr/src/uts/i86pc/io/gfx_private/gfxp_vgatext.c
index c445062abd..c22ce8b5ff 100644
--- a/usr/src/uts/i86pc/io/gfx_private/gfxp_vgatext.c
+++ b/usr/src/uts/i86pc/io/gfx_private/gfxp_vgatext.c
@@ -1182,7 +1182,6 @@ vgatext_init_graphics(struct vgatext_softc *softc)
static void
vgatext_setfont(struct vgatext_softc *softc)
{
- extern bitmap_data_t font_data_8x16;
unsigned char *from;
unsigned char *to;
int i;
diff --git a/usr/src/uts/i86pc/unix/Makefile b/usr/src/uts/i86pc/unix/Makefile
index 2b3eeb8c8b..f5f68fbf65 100644
--- a/usr/src/uts/i86pc/unix/Makefile
+++ b/usr/src/uts/i86pc/unix/Makefile
@@ -112,6 +112,10 @@ CLEANFILES += \
$(DBOOT_BIN)
CLEANFILES += \
+ $(DBOOT_OBJS_DIR)/$(VGATEXT_FONT).c \
+ $(OBJS_DIR)/$(VGATEXT_FONT).c
+
+CLEANFILES += \
$(OBJS_DIR)/fb_swtch_src.o \
$(OBJS_DIR)/fb_swtch_src \
$(OBJS_DIR)/fb_swtch.s
diff --git a/usr/src/uts/i86xpv/Makefile.files b/usr/src/uts/i86xpv/Makefile.files
index bf2ccf8f18..1da8a3813c 100644
--- a/usr/src/uts/i86xpv/Makefile.files
+++ b/usr/src/uts/i86xpv/Makefile.files
@@ -118,7 +118,8 @@ BOOT_DRIVER_OBJS = \
boot_keyboard_table.o \
boot_mmu.o \
boot_vga.o \
- boot_xconsole.o
+ boot_xconsole.o \
+ $(FONT_OBJS)
CORE_OBJS += $(BOOT_DRIVER_OBJS)
diff --git a/usr/src/uts/i86xpv/Makefile.rules b/usr/src/uts/i86xpv/Makefile.rules
index 0dcc4d72d0..a7be74569c 100644
--- a/usr/src/uts/i86xpv/Makefile.rules
+++ b/usr/src/uts/i86xpv/Makefile.rules
@@ -196,6 +196,12 @@ DBOOT_LINTFLAGS_i86xpv = $(LINTFLAGS_i386_$(CLASS)) $(LINTTAGS_i386_$(CLASS))
$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/common/xen/os/%.c
$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
+$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/common/font/%.c
+ $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
+
+$(DBOOT_OBJS_DIR)/%.o: $(DBOOT_OBJS_DIR)/%.c
+ $(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
+
$(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86xpv/boot/%.c
$(CC) $(DBOOT_CFLAGS) $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
@@ -230,6 +236,9 @@ DBOOT_DEFS += -D__xpv
$(LINTS_DIR)/%.ln: $(UTSBASE)/common/cpr/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
+$(LINTS_DIR)/%.ln: $(UTSBASE)/common/font/%.c
+ @($(LHEAD) $(LINT.c) $< $(LTAIL))
+
$(LINTS_DIR)/%.ln: $(UTSBASE)/i86pc/io/ioat/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
@@ -260,6 +269,12 @@ $(LINTS_DIR)/%.ln: $(UTSBASE)/common/xen/os/%.c
$(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/intel/ia32/ml/%.s
@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
+$(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/common/font/%.c
+ @($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
+
+$(DBOOT_LINTS_DIR)/%.ln: $(DBOOT_LINTS_DIR)/%.c
+ @($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
+
$(DBOOT_LINTS_DIR)/%.ln: $(UTSBASE)/common/xen/os/%.c
@($(LHEAD) $(DBOOT_LINT) $(DBOOT_LOCAL_LINTFLAGS) $< $(LTAIL))
diff --git a/usr/src/uts/i86xpv/gfx_private/Makefile b/usr/src/uts/i86xpv/gfx_private/Makefile
index ece55461b3..647f30b48e 100644
--- a/usr/src/uts/i86xpv/gfx_private/Makefile
+++ b/usr/src/uts/i86xpv/gfx_private/Makefile
@@ -41,11 +41,9 @@ UTSBASE = ../..
# Define the module and object file sets.
#
MODULE = gfx_private
-OBJECTS = $(GFX_PRIVATE_OBJS:%=$(OBJS_DIR)/%) $(OBJS_DIR)/$(VGATEXT_FONT).o
+OBJECTS = $(GFX_PRIVATE_OBJS:%=$(OBJS_DIR)/%)
LINTS = $(GFX_PRIVATE_OBJS:%.o=$(LINTS_DIR)/%.ln)
ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE)
-VGATEXT_FONT = 8859-1
-VGATEXT_SRC = $(UTSBASE)/intel/io/vgatext
#
# dependency
@@ -94,16 +92,6 @@ clean.lint: $(CLEAN_LINT_DEPS)
install: $(INSTALL_DEPS)
-# Custom targets and rules
-
-$(OBJS_DIR)/$(VGATEXT_FONT).c: $(VGATEXT_SRC)/$(VGATEXT_FONT).bdf
- $(AWK) -f $(VGATEXT_SRC)/bdf_to_c.awk \
- $(VGATEXT_SRC)/$(VGATEXT_FONT).bdf > $@
-
-$(OBJS_DIR)/$(VGATEXT_FONT).o: $(OBJS_DIR)/$(VGATEXT_FONT).c
- $(COMPILE.c) -o $@ $<
- $(CTFCONVERT_O)
-
#
# Include common targets.
#
diff --git a/usr/src/uts/i86xpv/unix/Makefile b/usr/src/uts/i86xpv/unix/Makefile
index e9ce16af05..b244c02387 100644
--- a/usr/src/uts/i86xpv/unix/Makefile
+++ b/usr/src/uts/i86xpv/unix/Makefile
@@ -106,6 +106,10 @@ CLEANFILES += \
$(DBOOT_BIN)
CLEANFILES += \
+ $(DBOOT_OBJS_DIR)/$(VGATEXT_FONT).c \
+ $(OBJS_DIR)/$(VGATEXT_FONT).c
+
+CLEANFILES += \
$(OBJS_DIR)/fb_swtch_src.o \
$(OBJS_DIR)/fb_swtch_src \
$(OBJS_DIR)/fb_swtch.s
diff --git a/usr/src/uts/intel/io/vgatext/vgatext.c b/usr/src/uts/intel/io/vgatext/vgatext.c
index 8d1a90ffd0..569135c0f5 100644
--- a/usr/src/uts/intel/io/vgatext/vgatext.c
+++ b/usr/src/uts/intel/io/vgatext/vgatext.c
@@ -1313,7 +1313,6 @@ vgatext_setfont(struct vgatext_softc *softc)
{
static uchar_t fsreg[8] = {0x0, 0x30, 0x5, 0x35, 0xa, 0x3a, 0xf, 0x3f};
- extern bitmap_data_t font_data_8x16;
uchar_t *from;
uchar_t volatile *to;
int i, j, s;
diff --git a/usr/src/uts/intel/vgatext/Makefile b/usr/src/uts/intel/vgatext/Makefile
index ce5e4d33cc..694b672be0 100644
--- a/usr/src/uts/intel/vgatext/Makefile
+++ b/usr/src/uts/intel/vgatext/Makefile
@@ -40,11 +40,9 @@ UTSBASE = ../..
# Define the module and object file sets.
#
MODULE = vgatext
-OBJECTS = $(VGATEXT_OBJS:%=$(OBJS_DIR)/%) $(OBJS_DIR)/$(VGATEXT_FONT).o
+OBJECTS = $(VGATEXT_OBJS:%=$(OBJS_DIR)/%)
LINTS = $(VGATEXT_OBJS:%.o=$(LINTS_DIR)/%.ln)
ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE)
-VGATEXT_FONT = 8859-1
-VGATEXT_SRC = $(UTSBASE)/intel/io/vgatext
LDFLAGS += -dy -Nmisc/agpmaster
#
@@ -91,20 +89,7 @@ clean.lint: $(CLEAN_LINT_DEPS)
install: $(INSTALL_DEPS)
-# Custom targets and rules
-
-$(OBJS_DIR)/$(VGATEXT_FONT).c: $(VGATEXT_SRC)/$(VGATEXT_FONT).bdf \
- $(VGATEXT_SRC)/bdf_to_c.awk
- $(AWK) -f $(VGATEXT_SRC)/bdf_to_c.awk \
- $(VGATEXT_SRC)/$(VGATEXT_FONT).bdf > $@
-
-$(OBJS_DIR)/$(VGATEXT_FONT).o: $(OBJS_DIR)/$(VGATEXT_FONT).c
- $(COMPILE.c) -o $@ $<
- $(CTFCONVERT_O)
-
#
# Include common targets.
#
include $(UTSBASE)/intel/Makefile.targ
-
-CLEANFILES += $(OBJS_DIR)/$(VGATEXT_FONT).c
diff --git a/usr/src/uts/sparc/tem/Makefile b/usr/src/uts/sparc/tem/Makefile
index 0a825020d6..83f29673eb 100644
--- a/usr/src/uts/sparc/tem/Makefile
+++ b/usr/src/uts/sparc/tem/Makefile
@@ -39,11 +39,12 @@ UTSBASE = ../..
# Define the module and object file sets.
#
MODULE = tem
-OBJECTS = $(TEM_OBJS:%=$(OBJS_DIR)/%)
+OBJECTS = $(TEM_OBJS:%=$(OBJS_DIR)/%) $(FONT_OBJS:%=$(OBJS_DIR)/%)
LINTS = $(TEM_OBJS:%.o=$(LINTS_DIR)/%.ln)
+LINTS += $(FONT_OBJS:%.o=$(LINTS_DIR)/%.ln)
ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE)
-WARLOCK_OUT = $(TEM_OBJS:%.o=%.ll)
+WARLOCK_OUT = $(TEM_OBJS:%.o=%.ll) $(FONT_OBJS:%.o=%.ll)
WARLOCK_OK = $(MODULE).ok
WLCMD_DIR = $(UTSBASE)/common/io/warlock
@@ -100,6 +101,26 @@ install: $(INSTALL_DEPS)
include $(UTSBASE)/sparc/Makefile.targ
#
+# Font data for generated 8x16 font
+#
+VGATEXT_FONT = 8x16
+VGATEXT_FONT_SRC= 8859-1
+VGATEXT_FONT_DIR= $(UTSBASE)/common/font
+
+$(OBJS_DIR)/$(VGATEXT_FONT).c: $(VGATEXT_FONT_DIR)/$(VGATEXT_FONT_SRC).bdf \
+ $(VGATEXT_FONT_DIR)/bdf_to_c.awk
+ $(AWK) -f $(VGATEXT_FONT_DIR)/bdf_to_c.awk \
+ $(VGATEXT_FONT_DIR)/$(VGATEXT_FONT_SRC).bdf > $@
+
+$(OBJS_DIR)/$(VGATEXT_FONT).o: $(OBJS_DIR)/$(VGATEXT_FONT).c
+ $(COMPILE.c) -o $@ $<
+ $(CTFCONVERT_O)
+
+CLOBBERFILES += \
+ $(OBJS_DIR)/$(VGATEXT_FONT).o \
+ $(OBJS_DIR)/$(VGATEXT_FONT).c
+
+#
# Defines for local commands
#
TEST = test