PERFORCE change 139997 for review
Warner Losh
imp at FreeBSD.org
Sun Apr 13 21:54:49 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=139997
Change 139997 by imp at imp_paco-paco on 2008/04/13 21:54:29
IFC @139995
Affected files ...
.. //depot/projects/arm/src/sbin/geom/class/part/geom_part.c#4 integrate
.. //depot/projects/mips2/src/lib/libc/stdlib/strfmon.c#2 integrate
.. //depot/projects/mips2/src/sbin/geom/class/journal/gjournal.8#3 integrate
.. //depot/projects/mips2/src/sbin/geom/class/part/geom_part.c#3 integrate
.. //depot/projects/mips2/src/sys/conf/files#24 integrate
.. //depot/projects/mips2/src/sys/conf/files.pc98#8 integrate
.. //depot/projects/mips2/src/sys/conf/options#18 integrate
.. //depot/projects/mips2/src/sys/dev/acpi_support/acpi_asus.c#5 integrate
.. //depot/projects/mips2/src/sys/dev/ata/ata-all.h#10 integrate
.. //depot/projects/mips2/src/sys/dev/ata/ata-raid.c#7 integrate
Differences ...
==== //depot/projects/arm/src/sbin/geom/class/part/geom_part.c#4 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sbin/geom/class/part/geom_part.c,v 1.4 2007/11/04 00:32:53 marcel Exp $");
+__FBSDID("$FreeBSD: src/sbin/geom/class/part/geom_part.c,v 1.5 2008/04/13 19:54:54 marcel Exp $");
#include <stdio.h>
#include <stdint.h>
@@ -39,6 +39,7 @@
#include <paths.h>
#include <errno.h>
#include <assert.h>
+#include <sys/stat.h>
#include "core/geom.h"
#include "misc/subr.h"
@@ -55,7 +56,8 @@
static char optional[] = "";
static char flags[] = "C";
-static void gpart_show(struct gctl_req *, unsigned);
+static void gpart_bootcode(struct gctl_req *, unsigned int);
+static void gpart_show(struct gctl_req *, unsigned int);
struct g_command PUBSYM(class_commands)[] = {
{ "add", 0, NULL, {
@@ -66,7 +68,13 @@
{ 'l', "label", optional, G_TYPE_STRING },
{ 'f', "flags", flags, G_TYPE_STRING },
G_OPT_SENTINEL },
- "geom", NULL,
+ "geom", NULL
+ },
+ { "bootcode", 0, gpart_bootcode, {
+ { 'b', "bootcode", NULL, G_TYPE_STRING },
+ { 'f', "flags", flags, G_TYPE_STRING },
+ G_OPT_SENTINEL },
+ "geom", NULL
},
{ "commit", 0, NULL, G_NULL_OPTS, "geom", NULL },
{ "create", 0, NULL, {
@@ -241,7 +249,7 @@
}
static void
-gpart_show(struct gctl_req *req, unsigned fl __unused)
+gpart_show(struct gctl_req *req, unsigned int fl __unused)
{
struct gmesh mesh;
struct gclass *classp;
@@ -277,3 +285,39 @@
}
geom_deletetree(&mesh);
}
+
+static void
+gpart_bootcode(struct gctl_req *req, unsigned int fl __unused)
+{
+ struct stat sb;
+ const char *bootfile;
+ void *code;
+ int error, fd, size;
+
+ bootfile = gctl_get_ascii(req, "bootcode");
+ if (bootfile == NULL)
+ errx(EXIT_FAILURE, "Missing bootfile argument");
+
+ error = stat(bootfile, &sb);
+ if (error)
+ errx(EXIT_FAILURE, "%s: not found", bootfile);
+ if (!S_ISREG(sb.st_mode))
+ errx(EXIT_FAILURE, "%s: not a regular file", bootfile);
+ if (sb.st_size >= 1024*1024)
+ errx(EXIT_FAILURE, "%s: file too big", bootfile);
+
+ size = sb.st_size;
+
+ fd = open(bootfile, O_RDONLY);
+ if (fd == -1)
+ errx(EXIT_FAILURE, "%s: unable to open", bootfile);
+ code = malloc(size);
+ if (code == NULL)
+ errx(EXIT_FAILURE, "out of memory");
+ if (read(fd, code, size) != size)
+ errx(EXIT_FAILURE, "%s: unable to read", bootfile);
+ close(fd);
+
+ gctl_change_param(req, "bootcode", size, code);
+ gctl_issue(req);
+}
==== //depot/projects/mips2/src/lib/libc/stdlib/strfmon.c#2 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdlib/strfmon.c,v 1.15 2005/09/12 19:52:42 stefanf Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdlib/strfmon.c,v 1.16 2008/04/13 08:05:08 delphij Exp $");
#include <sys/types.h>
#include <ctype.h>
@@ -535,12 +535,11 @@
/* make sure that we've enough space for result string */
bufsize = strlen(avalue)*2+1;
- rslt = malloc(bufsize);
+ rslt = calloc(1, bufsize);
if (rslt == NULL) {
free(avalue);
return (NULL);
}
- memset(rslt, 0, bufsize);
bufend = rslt + bufsize - 1; /* reserve space for trailing '\0' */
/* skip spaces at beggining */
==== //depot/projects/mips2/src/sbin/geom/class/journal/gjournal.8#3 (text+ko) ====
@@ -22,9 +22,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/sbin/geom/class/journal/gjournal.8,v 1.3 2007/11/15 06:31:18 ru Exp $
+.\" $FreeBSD: src/sbin/geom/class/journal/gjournal.8,v 1.5 2008/04/13 11:05:59 remko Exp $
.\"
-.Dd November 14, 2007
+.Dd April 13, 2008
.Dt GJOURNAL 8
.Os
.Sh NAME
@@ -219,7 +219,7 @@
.Bd -literal -offset indent
umount /dev/da0s1d
gjournal label da0s1d da0s1e && \e
- tunefs -J enable -n disable && \e
+ tunefs -J enable -n disable da01sd.journal && \e
mount -o async /dev/da0s1d.journal /mnt || \e
mount /dev/da0s1d /mnt
.Ed
==== //depot/projects/mips2/src/sbin/geom/class/part/geom_part.c#3 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sbin/geom/class/part/geom_part.c,v 1.4 2007/11/04 00:32:53 marcel Exp $");
+__FBSDID("$FreeBSD: src/sbin/geom/class/part/geom_part.c,v 1.5 2008/04/13 19:54:54 marcel Exp $");
#include <stdio.h>
#include <stdint.h>
@@ -39,6 +39,7 @@
#include <paths.h>
#include <errno.h>
#include <assert.h>
+#include <sys/stat.h>
#include "core/geom.h"
#include "misc/subr.h"
@@ -55,7 +56,8 @@
static char optional[] = "";
static char flags[] = "C";
-static void gpart_show(struct gctl_req *, unsigned);
+static void gpart_bootcode(struct gctl_req *, unsigned int);
+static void gpart_show(struct gctl_req *, unsigned int);
struct g_command PUBSYM(class_commands)[] = {
{ "add", 0, NULL, {
@@ -66,7 +68,13 @@
{ 'l', "label", optional, G_TYPE_STRING },
{ 'f', "flags", flags, G_TYPE_STRING },
G_OPT_SENTINEL },
- "geom", NULL,
+ "geom", NULL
+ },
+ { "bootcode", 0, gpart_bootcode, {
+ { 'b', "bootcode", NULL, G_TYPE_STRING },
+ { 'f', "flags", flags, G_TYPE_STRING },
+ G_OPT_SENTINEL },
+ "geom", NULL
},
{ "commit", 0, NULL, G_NULL_OPTS, "geom", NULL },
{ "create", 0, NULL, {
@@ -241,7 +249,7 @@
}
static void
-gpart_show(struct gctl_req *req, unsigned fl __unused)
+gpart_show(struct gctl_req *req, unsigned int fl __unused)
{
struct gmesh mesh;
struct gclass *classp;
@@ -277,3 +285,39 @@
}
geom_deletetree(&mesh);
}
+
+static void
+gpart_bootcode(struct gctl_req *req, unsigned int fl __unused)
+{
+ struct stat sb;
+ const char *bootfile;
+ void *code;
+ int error, fd, size;
+
+ bootfile = gctl_get_ascii(req, "bootcode");
+ if (bootfile == NULL)
+ errx(EXIT_FAILURE, "Missing bootfile argument");
+
+ error = stat(bootfile, &sb);
+ if (error)
+ errx(EXIT_FAILURE, "%s: not found", bootfile);
+ if (!S_ISREG(sb.st_mode))
+ errx(EXIT_FAILURE, "%s: not a regular file", bootfile);
+ if (sb.st_size >= 1024*1024)
+ errx(EXIT_FAILURE, "%s: file too big", bootfile);
+
+ size = sb.st_size;
+
+ fd = open(bootfile, O_RDONLY);
+ if (fd == -1)
+ errx(EXIT_FAILURE, "%s: unable to open", bootfile);
+ code = malloc(size);
+ if (code == NULL)
+ errx(EXIT_FAILURE, "out of memory");
+ if (read(fd, code, size) != size)
+ errx(EXIT_FAILURE, "%s: unable to read", bootfile);
+ close(fd);
+
+ gctl_change_param(req, "bootcode", size, code);
+ gctl_issue(req);
+}
==== //depot/projects/mips2/src/sys/conf/files#24 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1288 2008/04/03 20:58:18 jfv Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1289 2008/04/13 05:45:13 qingli Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -1673,6 +1673,7 @@
net/ppp_tty.c optional ppp
net/pfil.c optional ether | inet
net/radix.c standard
+net/radix_mpath.c standard
net/raw_cb.c standard
net/raw_usrreq.c standard
net/route.c standard
==== //depot/projects/mips2/src/sys/conf/files.pc98#8 (text+ko) ====
@@ -3,7 +3,7 @@
#
# modified for PC-9801/PC-9821
#
-# $FreeBSD: src/sys/conf/files.pc98,v 1.359 2007/12/03 11:38:28 rwatson Exp $
+# $FreeBSD: src/sys/conf/files.pc98,v 1.360 2008/04/13 06:18:34 nyan Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -314,8 +314,10 @@
i4b/layer1/itjc/i4b_itjc_l1.c optional itjc
i4b/layer1/itjc/i4b_itjc_l1fsm.c optional itjc
#
+kern/clock_if.m standard
kern/imgact_aout.c optional compat_aout
kern/imgact_gzip.c optional gzip
+kern/subr_rtc.c standard
libkern/divdi3.c standard
libkern/ffsl.c standard
libkern/flsl.c standard
==== //depot/projects/mips2/src/sys/conf/options#18 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options,v 1.624 2008/04/05 20:13:14 jhb Exp $
+# $FreeBSD: src/sys/conf/options,v 1.625 2008/04/13 05:45:13 qingli Exp $
#
# On the handling of kernel options
#
@@ -393,6 +393,7 @@
PPP_BSDCOMP opt_ppp.h
PPP_DEFLATE opt_ppp.h
PPP_FILTER opt_ppp.h
+RADIX_MPATH opt_mpath.h
SLIP_IFF_OPTS opt_slip.h
TCPDEBUG
TCP_SIGNATURE opt_inet.h
==== //depot/projects/mips2/src/sys/dev/acpi_support/acpi_asus.c#5 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpi_support/acpi_asus.c,v 1.31 2008/04/10 15:17:41 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpi_support/acpi_asus.c,v 1.32 2008/04/13 14:40:02 rpaulo Exp $");
/*
* Driver for extra ACPI-controlled gadgets (hotkeys, leds, etc) found on
@@ -375,6 +375,20 @@
{ .name = NULL }
};
+/*
+ * EeePC have an Asus ASUS010 gadget interface,
+ * but they can't be probed quite the same way as Asus laptops.
+ */
+static struct acpi_asus_model acpi_eeepc_models[] = {
+ {
+ .name = "EEE",
+ .brn_get = "\\_SB.ATKD.PBLG",
+ .brn_set = "\\_SB.ATKD.PBLS"
+ },
+
+ { .name = NULL }
+};
+
static struct {
char *name;
char *description;
@@ -444,13 +458,17 @@
ACPI_BUFFER Buf;
ACPI_OBJECT Arg, *Obj;
ACPI_OBJECT_LIST Args;
- static char *asus_ids[] = { "ATK0100", NULL };
+ static char *asus_ids[] = { "ATK0100", "ASUS010", NULL };
+ char *rstr;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
- if (acpi_disabled("asus") ||
- ACPI_ID_PROBE(device_get_parent(dev), dev, asus_ids) == NULL)
+ if (acpi_disabled("asus"))
+ return (ENXIO);
+ rstr = ACPI_ID_PROBE(device_get_parent(dev), dev, asus_ids);
+ if (rstr == NULL) {
return (ENXIO);
+ }
sc = device_get_softc(dev);
sc->dev = dev;
@@ -489,6 +507,14 @@
AcpiOsFree(Buf.Pointer);
return (0);
}
+
+ /* if EeePC */
+ if(strncmp("ASUS010", rstr, 7) == 0) {
+ sc->model = &acpi_eeepc_models[0];
+ device_set_desc(dev, "ASUS EeePC");
+ AcpiOsFree(Buf.Pointer);
+ return (0);
+ }
}
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
==== //depot/projects/mips2/src/sys/dev/ata/ata-all.h#10 (text+ko) ====
@@ -23,7 +23,7 @@
* (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: src/sys/dev/ata/ata-all.h,v 1.130 2008/04/11 11:30:27 sos Exp $
+ * $FreeBSD: src/sys/dev/ata/ata-all.h,v 1.131 2008/04/13 16:05:34 sos Exp $
*/
/* ATA register defines */
@@ -301,7 +301,7 @@
#define ATA_PC98_CTLADDR_RID 8
#define ATA_PC98_BANKADDR_RID 9
#define ATA_IRQ_RID 0
-#define ATA_DEV(unit) ((unit == ATA_ATA_SLAVE) ? 0x10 : 0)
+#define ATA_DEV(unit) ((unit > 0) ? 0x10 : 0)
#define ATA_CFA_MAGIC1 0x844A
#define ATA_CFA_MAGIC2 0x848A
#define ATA_CFA_MAGIC3 0x8400
==== //depot/projects/mips2/src/sys/dev/ata/ata-raid.c#7 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.128 2008/04/11 11:30:27 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.129 2008/04/13 16:05:34 sos Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -1669,9 +1669,8 @@
if (be32toh(meta->generation) >= raid->generation) {
struct ata_device *atadev = device_get_softc(parent);
struct ata_channel *ch = device_get_softc(GRANDPARENT(dev));
- int disk_number = (ch->unit << !(ch->flags & ATA_NO_SLAVE)) +
- ATA_DEV(atadev->unit);
-
+ int disk_number =
+ (ch->unit << !(ch->flags & ATA_NO_SLAVE)) + atadev->unit;
raid->disks[disk_number].dev = parent;
raid->disks[disk_number].sectors =
be32toh(meta->configs[disk_number + 1].sectors);
@@ -2303,7 +2302,7 @@
bcopy(atadev->param.serial, meta->disk[disk].serial,
sizeof(rdp->disks[disk].serial));
meta->disk[disk].sectors = rdp->disks[disk].sectors;
- meta->disk[disk].id = (ch->unit << 16) | ATA_DEV(atadev->unit);
+ meta->disk[disk].id = (ch->unit << 16) | atadev->unit;
}
else
meta->disk[disk].sectors = rdp->total_sectors / rdp->width;
@@ -3328,7 +3327,7 @@
device_get_softc(device_get_parent(rdp->disks[disk].dev));
meta->raid.channel = ch->unit;
- meta->raid.device = ATA_DEV(atadev->unit);
+ meta->raid.device = atadev->unit;
meta->raid.disk_sectors = rdp->disks[disk].sectors;
meta->raid.disk_offset = rdp->offset_sectors;
}
@@ -3416,7 +3415,7 @@
device_get_softc(rdp->disks[drive].dev);
meta->raid.disk[drive].channel = ch->unit;
- meta->raid.disk[drive].device = ATA_DEV(atadev->unit);
+ meta->raid.disk[drive].device = atadev->unit;
}
meta->raid.disk[drive].magic_0 =
PR_MAGIC0(meta->raid.disk[drive]) | timestamp.tv_sec;
@@ -3742,7 +3741,7 @@
struct ata_channel *ch =
device_get_softc(device_get_parent(rdp->disks[disk].dev));
struct ata_device *atadev = device_get_softc(rdp->disks[disk].dev);
- int disk_number = 1 + ATA_DEV(atadev->unit) + (ch->unit << 1);
+ int disk_number = 1 + atadev->unit + (ch->unit << 1);
meta->disks |= disk_number << ((1 - disk) << 2);
}
@@ -3780,7 +3779,7 @@
bcopy(atadev->param.model, meta->model, sizeof(meta->model));
/* XXX SOS if total_disks > 2 this may not float */
- meta->disk_number = 1 + ATA_DEV(atadev->unit) + (ch->unit << 1);
+ meta->disk_number = 1 + atadev->unit + (ch->unit << 1);
if (testing || bootverbose)
ata_raid_sis_print_meta(meta);
More information about the p4-projects
mailing list