PERFORCE change 93185 for review
Marcel Moolenaar
marcel at FreeBSD.org
Sun Mar 12 09:21:35 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=93185
Change 93185 by marcel at marcel_nfs on 2006/03/12 07:30:28
IFC @93181
Affected files ...
.. //depot/projects/uart/alpha/alpha/clock.c#8 integrate
.. //depot/projects/uart/alpha/include/pcpu.h#3 integrate
.. //depot/projects/uart/amd64/amd64/mp_machdep.c#11 integrate
.. //depot/projects/uart/amd64/linux32/linux32_machdep.c#6 integrate
.. //depot/projects/uart/arm/arm/in_cksum.c#6 integrate
.. //depot/projects/uart/arm/include/in_cksum.h#4 integrate
.. //depot/projects/uart/boot/i386/libi386/Makefile#6 integrate
.. //depot/projects/uart/boot/i386/libi386/libi386.h#7 integrate
.. //depot/projects/uart/boot/i386/libi386/smbios.c#3 integrate
.. //depot/projects/uart/compat/freebsd32/freebsd32_misc.c#13 integrate
.. //depot/projects/uart/conf/files#51 integrate
.. //depot/projects/uart/contrib/pf/net/if_pflog.h#5 integrate
.. //depot/projects/uart/ddb/db_command.c#9 integrate
.. //depot/projects/uart/ddb/ddb.h#8 integrate
.. //depot/projects/uart/dev/aic7xxx/aic79xx_osm.c#7 integrate
.. //depot/projects/uart/dev/ata/ata-all.c#19 integrate
.. //depot/projects/uart/dev/ata/ata-all.h#13 integrate
.. //depot/projects/uart/dev/ata/ata-disk.c#13 integrate
.. //depot/projects/uart/dev/ata/ata-queue.c#16 integrate
.. //depot/projects/uart/dev/ata/ata-raid.c#11 integrate
.. //depot/projects/uart/dev/ata/ata-usb.c#1 branch
.. //depot/projects/uart/dev/ata/atapi-cd.c#17 integrate
.. //depot/projects/uart/dev/ata/atapi-fd.c#9 integrate
.. //depot/projects/uart/dev/ath/ath_rate/sample/sample.c#7 integrate
.. //depot/projects/uart/dev/cs/if_cs.c#8 integrate
.. //depot/projects/uart/dev/exca/exca.c#11 integrate
.. //depot/projects/uart/dev/hwpmc/hwpmc_logging.c#3 integrate
.. //depot/projects/uart/dev/hwpmc/hwpmc_mod.c#5 integrate
.. //depot/projects/uart/dev/ieee488/upd7210.c#4 integrate
.. //depot/projects/uart/dev/iwi/if_iwi.c#6 integrate
.. //depot/projects/uart/dev/iwi/if_iwireg.h#5 integrate
.. //depot/projects/uart/dev/iwi/if_iwivar.h#4 integrate
.. //depot/projects/uart/dev/mpt/mpt.c#10 integrate
.. //depot/projects/uart/dev/mpt/mpt.h#7 integrate
.. //depot/projects/uart/dev/mpt/mpt_cam.c#7 integrate
.. //depot/projects/uart/dev/ral/rt2661.c#2 integrate
.. //depot/projects/uart/dev/sound/pci/ich.c#18 integrate
.. //depot/projects/uart/fs/nullfs/null_vnops.c#10 integrate
.. //depot/projects/uart/geom/mirror/g_mirror.c#11 integrate
.. //depot/projects/uart/geom/mirror/g_mirror_ctl.c#6 integrate
.. //depot/projects/uart/geom/raid3/g_raid3_ctl.c#6 integrate
.. //depot/projects/uart/gnu/fs/xfs/FreeBSD/support/kdb.c#2 integrate
.. //depot/projects/uart/i386/i386/mp_machdep.c#20 integrate
.. //depot/projects/uart/i386/i386/vm_machdep.c#14 integrate
.. //depot/projects/uart/kern/kern_environment.c#8 integrate
.. //depot/projects/uart/kern/kern_exec.c#16 integrate
.. //depot/projects/uart/kern/kern_mbuf.c#9 integrate
.. //depot/projects/uart/kern/kern_resource.c#10 integrate
.. //depot/projects/uart/kern/kern_sig.c#26 integrate
.. //depot/projects/uart/kern/kern_tc.c#13 integrate
.. //depot/projects/uart/kern/subr_prf.c#9 integrate
.. //depot/projects/uart/kern/uipc_mbuf.c#11 integrate
.. //depot/projects/uart/kern/vfs_mount.c#19 integrate
.. //depot/projects/uart/kern/vfs_subr.c#23 integrate
.. //depot/projects/uart/kern/vfs_vnops.c#14 integrate
.. //depot/projects/uart/modules/ata/atausb/Makefile#1 branch
.. //depot/projects/uart/modules/pf/Makefile#6 integrate
.. //depot/projects/uart/modules/pflog/Makefile#2 integrate
.. //depot/projects/uart/net/if_vlan.c#14 integrate
.. //depot/projects/uart/net80211/ieee80211_input.c#16 integrate
.. //depot/projects/uart/net80211/ieee80211_proto.c#12 integrate
.. //depot/projects/uart/netinet/if_ether.c#12 integrate
.. //depot/projects/uart/nfsclient/nfs_vnops.c#14 integrate
.. //depot/projects/uart/nfsserver/nfs_serv.c#10 integrate
.. //depot/projects/uart/nfsserver/nfs_srvsock.c#8 integrate
.. //depot/projects/uart/sys/disk.h#3 integrate
.. //depot/projects/uart/sys/mount.h#15 integrate
.. //depot/projects/uart/sys/proc.h#21 integrate
.. //depot/projects/uart/sys/vnode.h#17 integrate
.. //depot/projects/uart/ufs/ffs/ffs_extern.h#9 integrate
.. //depot/projects/uart/ufs/ffs/ffs_snapshot.c#12 integrate
.. //depot/projects/uart/ufs/ffs/ffs_softdep.c#16 integrate
.. //depot/projects/uart/ufs/ffs/ffs_vfsops.c#17 integrate
.. //depot/projects/uart/ufs/ufs/ufs_inode.c#9 integrate
.. //depot/projects/uart/ufs/ufs/ufs_lookup.c#7 integrate
.. //depot/projects/uart/ufs/ufs/ufs_quota.c#10 integrate
.. //depot/projects/uart/ufs/ufs/ufsmount.h#7 integrate
.. //depot/projects/uart/vm/swap_pager.c#21 integrate
.. //depot/projects/uart/vm/vm_contig.c#16 integrate
.. //depot/projects/uart/vm/vm_fault.c#14 integrate
.. //depot/projects/uart/vm/vm_map.c#19 integrate
.. //depot/projects/uart/vm/vm_page.c#19 integrate
.. //depot/projects/uart/vm/vm_pageq.c#7 integrate
Differences ...
==== //depot/projects/uart/alpha/alpha/clock.c#8 (text+ko) ====
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/clock.c,v 1.42 2005/12/22 22:16:04 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/clock.c,v 1.44 2006/03/07 22:12:09 jhb Exp $");
#include "opt_clock.h"
@@ -49,6 +49,7 @@
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/queue.h>
+#include <sys/smp.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/bus.h>
@@ -89,8 +90,6 @@
device_t clockdev;
int clockinitted;
-int tickfix;
-int tickfixinterval;
int adjkerntz; /* local offset from GMT in seconds */
int disable_rtc_set; /* disable resettodr() if != 0 */
int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
@@ -103,15 +102,8 @@
#define TIMER_FREQ 1193182
#endif
u_int32_t timer_freq = TIMER_FREQ;
-int timer0_max_count;
-
-static u_int32_t i8254_lastcount;
-static u_int32_t i8254_offset;
-static int i8254_ticked;
-static int clkintr_pending = 0;
extern int cycles_per_sec;
-extern int ncpus;
static timecounter_get_t i8254_get_timecount;
static timecounter_get_t alpha_get_timecount;
@@ -128,7 +120,7 @@
static struct timecounter i8254_timecounter = {
i8254_get_timecount, /* get_timecount */
0, /* no poll_pps */
- ~0u, /* counter_mask */
+ 0xffff, /* counter_mask */
0, /* frequency */
"i8254" /* name */
};
@@ -142,25 +134,10 @@
/* static u_char timer0_state; */
static u_char timer2_state;
-/*
- * Algorithm for missed clock ticks from Linux/alpha.
- */
-
-/*
- * Shift amount by which scaled_ticks_per_cycle is scaled. Shifting
- * by 48 gives us 16 bits for HZ while keeping the accuracy good even
- * for large CPU clock rates.
- */
-#define FIX_SHIFT 48
-
-static u_int64_t scaled_ticks_per_cycle;
-static u_int32_t max_cycles_per_tick;
-static u_int32_t last_time;
-
-static void handleclock(int usermode, uintfptr_t pc);
static void calibrate_clocks(u_int32_t firmware_freq, u_int32_t *pcc,
u_int32_t *timer);
static void set_timer_freq(u_int freq, int intr_freq);
+static uint64_t read_cycle_count(void);
void
clockattach(device_t dev)
@@ -176,6 +153,7 @@
calibrate_clocks(cycles_per_sec, &pcc, &freq);
cycles_per_sec = pcc;
+ set_cputicker(read_cycle_count, cycles_per_sec, 0);
/*
* XXX: TurboLaser doesn't have an i8254 counter.
@@ -206,7 +184,6 @@
freq, timer_freq);
}
set_timer_freq(timer_freq, hz);
- i8254_timecounter.tc_frequency = timer_freq;
out:
#ifdef EVCNT_COUNTERS
@@ -235,21 +212,12 @@
void
cpu_initclocks()
{
- u_int32_t freq;
if (clockdev == NULL)
panic("cpu_initclocks: no clock attached");
tick = 1000000 / hz; /* number of microseconds between interrupts */
- tickfix = 1000000 - (hz * tick);
- if (tickfix) {
- int ftp;
- ftp = min(ffs(tickfix), ffs(hz));
- tickfix >>= (ftp - 1);
- tickfixinterval = hz >> (ftp - 1);
- }
-
/*
* Establish the clock interrupt; it's a special case.
*
@@ -262,24 +230,18 @@
* hardclock, which would then fall over because p->p_stats
* isn't set at that time.
*/
- freq = cycles_per_sec;
- last_time = alpha_rpcc();
- scaled_ticks_per_cycle = ((u_int64_t)hz << FIX_SHIFT) / freq;
- max_cycles_per_tick = 2*freq / hz;
/*
* XXX: TurboLaser doesn't have an i8254 counter.
* XXX: A replacement is needed, and another method
* XXX: of determining this would be nice.
*/
- if (hwrpb->rpb_type != ST_DEC_21000) {
+ if (hwrpb->rpb_type != ST_DEC_21000)
tc_init(&i8254_timecounter);
- platform.clockintr = handleclock;
- } else
- platform.clockintr = hardclock;
+ platform.clockintr = hardclock;
- if (ncpus == 1) {
- alpha_timecounter.tc_frequency = freq;
+ if (mp_ncpus == 1) {
+ alpha_timecounter.tc_frequency = cycles_per_sec;
tc_init(&alpha_timecounter);
}
@@ -375,7 +337,7 @@
if (count == 0)
goto fail;
if (count > prev_count)
- tot_count += prev_count - (count - timer0_max_count);
+ tot_count += prev_count - (count - 0xffff);
else
tot_count += prev_count - count;
prev_count = count;
@@ -410,40 +372,16 @@
static void
set_timer_freq(u_int freq, int intr_freq)
{
- int new_timer0_max_count;
mtx_lock_spin(&clock_lock);
timer_freq = freq;
- new_timer0_max_count = TIMER_DIV(intr_freq);
- if (new_timer0_max_count != timer0_max_count) {
- timer0_max_count = new_timer0_max_count;
- outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
- outb(TIMER_CNTR0, timer0_max_count & 0xff);
- outb(TIMER_CNTR0, timer0_max_count >> 8);
- }
+ i8254_timecounter.tc_frequency = timer_freq;
+ outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
+ outb(TIMER_CNTR0, 0);
+ outb(TIMER_CNTR0, 0);
mtx_unlock_spin(&clock_lock);
}
-static void
-handleclock(int usermode, uintfptr_t pc)
-{
-
- KASSERT(hwrpb->rpb_type != ST_DEC_21000,
- ("custom clock handler called on TurboLaser"));
- if (timecounter->tc_get_timecount == i8254_get_timecount) {
- mtx_lock_spin(&clock_lock);
- if (i8254_ticked)
- i8254_ticked = 0;
- else {
- i8254_offset += timer0_max_count;
- i8254_lastcount = 0;
- }
- clkintr_pending = 0;
- mtx_unlock_spin(&clock_lock);
- }
- hardclock(usermode, pc);
-}
-
void
cpu_startprofclock(void)
{
@@ -609,29 +547,8 @@
static unsigned
i8254_get_timecount(struct timecounter *tc)
{
- u_int count;
- u_int high, low;
- mtx_lock_spin(&clock_lock);
-
- /* Select timer0 and latch counter value. */
- outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH);
-
- low = inb(TIMER_CNTR0);
- high = inb(TIMER_CNTR0);
- count = timer0_max_count - ((high << 8) | low);
- if (count < i8254_lastcount ||
- (!i8254_ticked && (clkintr_pending ||
- ((count < 20) && (inb(IO_ICU1) & 1)))
- )) {
- i8254_ticked = 1;
- i8254_offset += timer0_max_count;
- }
- i8254_lastcount = count;
- count += i8254_offset;
-
- mtx_unlock_spin(&clock_lock);
- return (count);
+ return (0xffff - get_8254_ctr());
}
static unsigned
@@ -640,6 +557,30 @@
return alpha_rpcc();
}
+/*
+ * The RPCC register actually consists of two halves. The lower half
+ * is a raw 32-bit counter that wraps. The upper half is defined in
+ * the Digital UNIX PAL as being a raw per-process cycle count mod 2^32
+ * that is updated on each call to swpctx. In order to produce a 64-bit
+ * counter, we just use the lower half and simulate the upper 32-bits.
+ * The architecture guarantees that there will always be at least one
+ * clock interrupt in between overlaps in the lower half, so as long as
+ * we call this function every clock interrupt we should not miss any
+ * overlaps.
+ */
+uint64_t
+read_cycle_count(void)
+{
+ unsigned pcc_cnt;
+
+ /* Assert a critical section? */
+ pcc_cnt = alpha_rpcc() & 0xffffffff;
+ if (pcc_cnt < PCPU_GET(last_pcc_cnt))
+ PCPU_SET(pcc_base, PCPU_GET(pcc_base) + 1);
+ PCPU_SET(last_pcc_cnt, pcc_cnt);
+ return (pcc_cnt | ((uint64_t)PCPU_GET(pcc_base) << 32));
+}
+
int
acquire_timer2(int mode)
{
==== //depot/projects/uart/alpha/include/pcpu.h#3 (text+ko) ====
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/alpha/include/pcpu.h,v 1.15 2004/11/05 19:16:44 jhb Exp $
+ * $FreeBSD: src/sys/alpha/include/pcpu.h,v 1.16 2006/03/07 22:12:09 jhb Exp $
*/
#ifndef _MACHINE_PCPU_H_
@@ -38,7 +38,9 @@
u_int64_t pc_idlepcbphys; /* pa of pc_idlepcb */ \
u_int64_t pc_pending_ipis; /* pending IPI's */ \
u_int32_t pc_next_asn; /* next ASN to alloc */ \
- u_int32_t pc_current_asngen /* ASN rollover check */
+ u_int32_t pc_current_asngen; /* ASN rollover check */ \
+ u_int32_t pc_last_pcc_cnt; /* Previous PCC_CNT value */ \
+ u_int32_t pc_pcc_base /* Hi word of cycle count. */
struct pcpu;
==== //depot/projects/uart/amd64/amd64/mp_machdep.c#11 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.269 2006/02/28 22:24:54 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.270 2006/03/09 16:38:52 jhb Exp $");
#include "opt_cpu.h"
#include "opt_kstack_pages.h"
@@ -612,12 +612,12 @@
continue;
if (cpu_info[apic_id].cpu_bsp)
continue;
-#if 0
+
/* Don't let hyperthreads service interrupts. */
if (hyperthreading_cpus > 1 &&
apic_id % hyperthreading_cpus != 0)
continue;
-#endif
+
intr_add_cpu(apic_id);
}
}
==== //depot/projects/uart/amd64/linux32/linux32_machdep.c#6 (text+ko) ====
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.11 2006/02/06 22:06:53 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.12 2006/03/08 20:21:53 ups Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -130,7 +130,7 @@
copystr(fname, args->fname, PATH_MAX, &length) :
copyinstr(fname, args->fname, PATH_MAX, &length);
if (error != 0)
- return (error);
+ goto err_exit;
/*
* extract arguments first
@@ -139,16 +139,16 @@
for (;;) {
error = copyin(p32++, &arg, sizeof(arg));
if (error)
- return (error);
+ goto err_exit;
if (arg == 0)
break;
argp = PTRIN(arg);
error = copyinstr(argp, args->endp, args->stringspace, &length);
if (error) {
if (error == ENAMETOOLONG)
- return (E2BIG);
- else
- return (error);
+ error = E2BIG;
+
+ goto err_exit;
}
args->stringspace -= length;
args->endp += length;
@@ -165,7 +165,7 @@
for (;;) {
error = copyin(p32++, &arg, sizeof(arg));
if (error)
- return (error);
+ goto err_exit;
if (arg == 0)
break;
envp = PTRIN(arg);
@@ -173,9 +173,8 @@
&length);
if (error) {
if (error == ENAMETOOLONG)
- return (E2BIG);
- else
- return (error);
+ error = E2BIG;
+ goto err_exit;
}
args->stringspace -= length;
args->endp += length;
@@ -184,6 +183,12 @@
}
return (0);
+
+err_exit:
+ kmem_free_wakeup(exec_map, (vm_offset_t)args->buf,
+ PATH_MAX + ARG_MAX + MAXSHELLCMDLEN);
+ args->buf = NULL;
+ return (error);
}
int
==== //depot/projects/uart/arm/arm/in_cksum.c#6 (text+ko) ====
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__FBSDID("$FreeBSD: src/sys/arm/arm/in_cksum.c,v 1.5 2005/10/03 14:06:44 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/in_cksum.c,v 1.6 2006/03/09 23:33:59 cognet Exp $");
#include <sys/param.h>
#include <sys/mbuf.h>
@@ -130,3 +130,12 @@
REDUCE16;
return (~sum & 0xffff);
}
+
+u_int in_cksum_hdr(const struct ip *ip)
+{
+ u_int64_t sum = do_cksum(ip, sizeof(struct ip));
+ union q_util q_util;
+ union l_util l_util;
+ REDUCE16;
+ return (~sum & 0xffff);
+}
==== //depot/projects/uart/arm/include/in_cksum.h#4 (text+ko) ====
@@ -33,7 +33,7 @@
* from tahoe: in_cksum.c 1.2 86/01/05
* from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
* from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
- * $FreeBSD: src/sys/arm/include/in_cksum.h,v 1.3 2005/10/03 14:06:44 cognet Exp $
+ * $FreeBSD: src/sys/arm/include/in_cksum.h,v 1.4 2006/03/09 23:33:59 cognet Exp $
*/
#ifndef _MACHINE_IN_CKSUM_H_
@@ -46,80 +46,7 @@
u_short in_addword(u_short sum, u_short b);
u_short in_cksum_skip(struct mbuf *m, int len, int skip);
u_int do_cksum(const void *, int);
-static __inline u_int
-in_cksum_hdr(const struct ip *ip)
-{
- u_int sum = 0;
- u_int tmp1, tmp2, tmp3, tmp4;
-
- if (((vm_offset_t)ip & 0x03) == 0)
- __asm __volatile (
- "adds %0, %0, %1\n"
- "adcs %0, %0, %2\n"
- "adcs %0, %0, %3\n"
- "adcs %0, %0, %4\n"
- "adcs %0, %0, %5\n"
- "adc %0, %0, #0\n"
- : "+r" (sum)
- : "r" (((const u_int32_t *)ip)[0]),
- "r" (((const u_int32_t *)ip)[1]),
- "r" (((const u_int32_t *)ip)[2]),
- "r" (((const u_int32_t *)ip)[3]),
- "r" (((const u_int32_t *)ip)[4])
- );
- else
- __asm __volatile (
- "and %1, %5, #3\n"
- "cmp %1, #0x02\n"
- "ldrb %2, [%5], #0x01\n"
- "ldrgeb %3, [%5], #0x01\n"
- "movlt %3, #0\n"
- "ldrgtb %4, [%5], #0x01\n"
- "movle %4, #0x00\n"
-#ifdef __ARMEB__
- "orreq %0, %3, %2, lsl #8\n"
- "orreq %0, %0, %4, lsl #24\n"
- "orrne %0, %0, %3, lsl #8\n"
- "orrne %0, %0, %4, lsl #16\n"
-#else
- "orreq %0, %2, %3, lsl #8\n"
- "orreq %0, %0, %4, lsl #16\n"
- "orrne %0, %3, %2, lsl #8\n"
- "orrne %0, %0, %4, lsl #24\n"
-#endif
- "ldmia %5, {%2, %3, %4}\n"
- "adcs %0, %0, %2\n"
- "adcs %0, %0, %3\n"
- "adcs %0, %0, %4\n"
- "ldrb %2, [%5]\n"
- "cmp %1, #0x02\n"
- "ldrgeb %3, [%5, #0x01]\n"
- "movlt %3, #0x00\n"
- "ldrgtb %4, [%5, #0x02]\n"
- "movle %4, #0x00\n"
- "tst %5, #0x01\n"
-#ifdef __ARMEB__
- "orreq %2, %3, %2, lsl #8\n"
- "orreq %2, %2, %4, lsl #24\n"
- "orrne %2, %2, %3, lsl #8\n"
- "orrne %2, %2, %4, lsl #16\n"
-#else
- "orreq %2, %2, %3, lsl #8\n"
- "orreq %2, %2, %4, lsl #16\n"
- "orrne %2, %3, %2, lsl #8\n"
- "orrne %2, %2, %4, lsl #24\n"
-#endif
- "adds %0, %0, %2\n"
- "adc %0, %0, #0\n"
- : "+r" (sum), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3),
- "=r" (tmp4)
- : "r" (ip));
-
- sum = (sum & 0xffff) + (sum >> 16);
- if (sum > 0xffff)
- sum -= 0xffff;
- return (~sum & 0xffff);
-}
+u_int in_cksum_hdr(const struct ip *);
static __inline u_short
in_pseudo(u_int sum, u_int b, u_int c)
==== //depot/projects/uart/boot/i386/libi386/Makefile#6 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/boot/i386/libi386/Makefile,v 1.39 2005/12/19 09:00:11 sobomax Exp $
+# $FreeBSD: src/sys/boot/i386/libi386/Makefile,v 1.40 2006/03/09 22:49:44 jkim Exp $
#
LIB= i386
INTERNALLIB=
@@ -21,6 +21,11 @@
CFLAGS+= -DDISK_DEBUG
.endif
+.ifdef(BOOT_SENSITIVE_INFO)
+# Show serial numbers, UUID, and asset tag from loader
+CFLAGS+= -DSHOW_SENSITIVE_INFO
+.endif
+
# Include simple terminal emulation (cons25-compatible)
CFLAGS+= -DTERM_EMU
==== //depot/projects/uart/boot/i386/libi386/libi386.h#7 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/boot/i386/libi386/libi386.h,v 1.23 2005/12/21 02:17:58 sobomax Exp $
+ * $FreeBSD: src/sys/boot/i386/libi386/libi386.h,v 1.24 2006/03/09 22:49:44 jkim Exp $
*/
@@ -100,9 +100,9 @@
int biospci_write_config(uint32_t locator, int offset, int width, int val);
int biospci_read_config(uint32_t locator, int offset, int width, uint32_t *val);
-void biosacpi_detect();
+void biosacpi_detect(void);
-void smbios_detect();
+void smbios_detect(void);
void gateA20(void);
==== //depot/projects/uart/boot/i386/libi386/smbios.c#3 (text+ko) ====
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2005 Jung-uk Kim <jkim at FreeBSD.org>
+ * Copyright (c) 2005, 2006 Jung-uk Kim <jkim at FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,12 +25,13 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/smbios.c,v 1.3 2005/10/18 20:03:31 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/smbios.c,v 1.5 2006/03/10 23:33:27 jkim Exp $");
#include <stand.h>
#include <bootstrap.h>
#include "btxv86.h"
+#include "libi386.h"
/*
* Detect SMBIOS and export information about the SMBIOS into the
@@ -54,21 +55,26 @@
#define SMBIOS_SIG "_SM_"
#define SMBIOS_DMI_SIG "_DMI_"
-static u_int8_t smbios_enabled_sockets = 0;
-static u_int8_t smbios_populated_sockets = 0;
+static uint8_t smbios_enabled_sockets = 0;
+static uint8_t smbios_populated_sockets = 0;
+
+static uint8_t *smbios_parse_table(const uint8_t *dmi);
+static void smbios_setenv(const char *name, const uint8_t *dmi,
+ const int offset);
+static uint8_t smbios_checksum(const caddr_t addr, const uint8_t len);
+static uint8_t *smbios_sigsearch(const caddr_t addr, const uint32_t len);
-static u_int8_t *smbios_parse_table(const u_int8_t *dmi);
-static void smbios_setenv(const char *env, const u_int8_t *dmi,
+#ifdef SHOW_SENSITIVE_INFO
+static void smbios_setuuid(const char *name, const uint8_t *dmi,
const int offset);
-static u_int8_t smbios_checksum(const u_int8_t *addr, const u_int8_t len);
-static u_int8_t *smbios_sigsearch(const caddr_t addr, const u_int32_t len);
+#endif
void
smbios_detect(void)
{
- u_int8_t *smbios, *dmi, *addr;
- u_int16_t i, length, count;
- u_int32_t paddr;
+ uint8_t *smbios, *dmi, *addr;
+ uint16_t i, length, count;
+ uint32_t paddr;
char buf[4];
/* locate and validate the SMBIOS */
@@ -76,9 +82,9 @@
if (smbios == NULL)
return;
- length = *(u_int16_t *)(smbios + 0x16); /* Structure Table Length */
- paddr = *(u_int32_t *)(smbios + 0x18); /* Structure Table Address */
- count = *(u_int16_t *)(smbios + 0x1c); /* No of SMBIOS Structures */
+ length = *(uint16_t *)(smbios + 0x16); /* Structure Table Length */
+ paddr = *(uint32_t *)(smbios + 0x18); /* Structure Table Address */
+ count = *(uint16_t *)(smbios + 0x1c); /* No of SMBIOS Structures */
for (dmi = addr = PTOV(paddr), i = 0;
dmi - addr < length && i < count; i++)
@@ -89,10 +95,10 @@
setenv("smbios.socket.populated", buf, 1);
}
-static u_int8_t *
-smbios_parse_table(const u_int8_t *dmi)
+static uint8_t *
+smbios_parse_table(const uint8_t *dmi)
{
- u_int8_t *dp;
+ uint8_t *dp;
switch(dmi[0]) {
case 0: /* Type 0: BIOS */
@@ -105,17 +111,28 @@
smbios_setenv("smbios.system.maker", dmi, 0x04);
smbios_setenv("smbios.system.product", dmi, 0x05);
smbios_setenv("smbios.system.version", dmi, 0x06);
+#ifdef SHOW_SENSITIVE_INFO
+ smbios_setenv("smbios.system.serial", dmi, 0x07);
+ smbios_setuuid("smbios.system.uuid", dmi, 0x08);
+#endif
break;
case 2: /* Type 2: Base Board (or Module) */
smbios_setenv("smbios.planar.maker", dmi, 0x04);
smbios_setenv("smbios.planar.product", dmi, 0x05);
smbios_setenv("smbios.planar.version", dmi, 0x06);
+#ifdef SHOW_SENSITIVE_INFO
+ smbios_setenv("smbios.planar.serial", dmi, 0x07);
+#endif
break;
case 3: /* Type 3: System Enclosure or Chassis */
smbios_setenv("smbios.chassis.maker", dmi, 0x04);
smbios_setenv("smbios.chassis.version", dmi, 0x06);
+#ifdef SHOW_SENSITIVE_INFO
+ smbios_setenv("smbios.chassis.serial", dmi, 0x07);
+ smbios_setenv("smbios.chassis.tag", dmi, 0x08);
+#endif
break;
case 4: /* Type 4: Processor Information */
@@ -147,7 +164,7 @@
}
/* find structure terminator */
- dp = (u_int8_t *)(dmi + dmi[1]);
+ dp = __DECONST(uint8_t *, dmi + dmi[1]);
while (dp[0] != 0 || dp[1] != 0)
dp++;
@@ -155,42 +172,43 @@
}
static void
-smbios_setenv(const char *str, const u_int8_t *dmi, const int offset)
+smbios_setenv(const char *name, const uint8_t *dmi, const int offset)
{
- char *cp;
+ char *cp = __DECONST(char *, dmi + dmi[1]);
int i;
/* skip undefined string */
if (dmi[offset] == 0)
return;
- for (cp = (char *)(dmi + dmi[1]), i = 0; i < dmi[offset] - 1; i++)
+ for (i = 0; i < dmi[offset] - 1; i++)
cp += strlen(cp) + 1;
- setenv(str, cp, 1);
+ setenv(name, cp, 1);
}
-static u_int8_t
-smbios_checksum(const u_int8_t *addr, const u_int8_t len)
+static uint8_t
+smbios_checksum(const caddr_t addr, const uint8_t len)
{
- u_int8_t sum;
+ const uint8_t *cp = addr;
+ uint8_t sum;
int i;
for (sum = 0, i = 0; i < len; i++)
- sum += addr[i];
+ sum += cp[i];
return(sum);
}
-static u_int8_t *
-smbios_sigsearch(const caddr_t addr, const u_int32_t len)
+static uint8_t *
+smbios_sigsearch(const caddr_t addr, const uint32_t len)
{
caddr_t cp;
/* search on 16-byte boundaries */
- for (cp = addr; cp - addr < len; cp += SMBIOS_STEP) {
+ for (cp = addr; cp < addr + len; cp += SMBIOS_STEP) {
/* compare signature, validate checksum */
if (!strncmp(cp, SMBIOS_SIG, 4)) {
- if (smbios_checksum(cp, *(cp + 0x05)))
+ if (smbios_checksum(cp, *(uint8_t *)(cp + 0x05)))
continue;
if (strncmp(cp + 0x10, SMBIOS_DMI_SIG, 5))
continue;
@@ -203,3 +221,31 @@
return(NULL);
}
+
+#ifdef SHOW_SENSITIVE_INFO
+static void
+smbios_setuuid(const char *name, const uint8_t *dmi, const int offset)
+{
+ const uint8_t *idp = dmi + offset;
+ int i, f = 0, z = 0;
+ char uuid[37];
+
+ for (i = 0; i < 16; i++) {
+ if (idp[i] == 0xff)
+ f++;
+ else if (idp[i] == 0x00)
+ z++;
+ else
+ break;
+ }
+ if (f != 16 && z != 16) {
+ sprintf(uuid, "%02X%02X%02X%02X-"
+ "%02X%02X-%02X%02X-%02X%02X-"
+ "%02X%02X%02X%02X%02X%02X",
+ idp[0], idp[1], idp[2], idp[3],
+ idp[4], idp[5], idp[6], idp[7], idp[8], idp[9],
+ idp[10], idp[11], idp[12], idp[13], idp[14], idp[15]);
+ setenv(name, uuid, 1);
+ }
+}
+#endif
==== //depot/projects/uart/compat/freebsd32/freebsd32_misc.c#13 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.52 2006/03/04 00:09:09 ps Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.53 2006/03/08 20:21:53 ups Exp $");
#include "opt_compat.h"
@@ -260,7 +260,7 @@
copystr(fname, args->fname, PATH_MAX, &length) :
copyinstr(fname, args->fname, PATH_MAX, &length);
if (error != 0)
- return (error);
+ goto err_exit;
/*
* extract arguments first
@@ -269,16 +269,15 @@
for (;;) {
error = copyin(p32++, &arg, sizeof(arg));
if (error)
- return (error);
+ goto err_exit;
if (arg == 0)
break;
argp = PTRIN(arg);
error = copyinstr(argp, args->endp, args->stringspace, &length);
if (error) {
if (error == ENAMETOOLONG)
- return (E2BIG);
- else
- return (error);
+ error = E2BIG;
+ goto err_exit;
}
args->stringspace -= length;
args->endp += length;
@@ -295,7 +294,7 @@
for (;;) {
error = copyin(p32++, &arg, sizeof(arg));
if (error)
- return (error);
+ goto err_exit;
if (arg == 0)
break;
envp = PTRIN(arg);
@@ -303,9 +302,8 @@
&length);
if (error) {
if (error == ENAMETOOLONG)
- return (E2BIG);
- else
- return (error);
+ error = E2BIG;
+ goto err_exit;
}
args->stringspace -= length;
args->endp += length;
@@ -314,6 +312,12 @@
}
return (0);
+
+err_exit:
+ kmem_free_wakeup(exec_map, (vm_offset_t)args->buf,
+ PATH_MAX + ARG_MAX + MAXSHELLCMDLEN);
+ args->buf = NULL;
+ return (error);
}
int
==== //depot/projects/uart/conf/files#51 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1100 2006/03/05 22:52:16 yar Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1101 2006/03/10 19:10:05 sos Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -458,6 +458,7 @@
dev/ata/ata-pci.c optional ata pci
dev/ata/ata-queue.c optional ata
dev/ata/ata-raid.c optional ataraid
+dev/ata/ata-usb.c optional atausb
dev/ata/atapi-cam.c optional atapicam
dev/ata/atapi-cd.c optional atapicd
dev/ata/atapi-fd.c optional atapifd
==== //depot/projects/uart/contrib/pf/net/if_pflog.h#5 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/contrib/pf/net/if_pflog.h,v 1.7 2006/02/05 17:17:32 mlaier Exp $ */
+/* $FreeBSD: src/sys/contrib/pf/net/if_pflog.h,v 1.8 2006/03/09 15:54:01 yar Exp $ */
/* $OpenBSD: if_pflog.h,v 1.11 2004/05/19 17:50:51 dhartmei Exp $ */
/*
@@ -71,8 +71,9 @@
#ifdef _KERNEL
#ifdef __FreeBSD__
-/* XXX */
-#include <net/pfvar.h>
+struct pf_rule;
+struct pf_ruleset;
+struct pfi_kif;
typedef int pflog_packet_t(struct pfi_kif *, struct mbuf *, sa_family_t,
u_int8_t, u_int8_t, struct pf_rule *, struct pf_rule *,
==== //depot/projects/uart/ddb/db_command.c#9 (text+ko) ====
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ddb/db_command.c,v 1.64 2005/10/24 15:21:36 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/ddb/db_command.c,v 1.65 2006/03/07 22:17:05 jhb Exp $");
#include <sys/param.h>
#include <sys/linker_set.h>
@@ -83,15 +83,25 @@
{ (char *)0 }
};
+static struct command_table db_show_all_table = {
+ db_show_all_cmds
+};
+
static struct command db_show_cmds[] = {
- { "all", 0, 0, db_show_all_cmds },
+ { "all", 0, 0, &db_show_all_table },
{ "registers", db_show_regs, 0, 0 },
{ "breaks", db_listbreak_cmd, 0, 0 },
{ "threads", db_show_threads, 0, 0 },
{ (char *)0, }
};
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list