svn commit: r214973 - head/usr.bin/calendar/calendars

2010-11-08 Thread Ruslan Ermilov
Author: ru
Date: Mon Nov  8 09:26:56 2010
New Revision: 214973
URL: http://svn.freebsd.org/changeset/base/214973

Log:
  A traditional (once per three years) sort by month/day/year/login.
  While here, fixed badly formatted lines.

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Nov  8 07:54:24 
2010(r214972)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Nov  8 09:26:56 
2010(r214973)
@@ -7,8 +7,8 @@
 #ifndef _calendar_freebsd_
 #define _calendar_freebsd_
 
-01/01  Alexander Langer a...@freebsd.org born in Duesseldorf, 
Nordrhein-Westfalen, Germany, 1981
 01/01  Dimitry Andric d...@freebsd.org born in Utrecht, the Netherlands, 1969
+01/01  Alexander Langer a...@freebsd.org born in Duesseldorf, 
Nordrhein-Westfalen, Germany, 1981
 01/02  Ion-Mihai IOnut Tetcu ite...@freebsd.org born in Bucharest, 
Romania, 1980
 01/02  Patrick Li p...@freebsd.org born in Beijing, People's Republic of 
China, 1985
 01/03  Tetsurou Okazaki okaz...@freebsd.org born in Mobara, Chiba, Japan, 
1972
@@ -24,13 +24,13 @@
 01/16  Vanilla I. Shu vani...@freebsd.org born in Taipei, Taiwan, Republic 
of China, 1978
 01/18  Dejan Lesjak l...@freebsd.org born in Ljubljana, Slovenia, 
Yugoslavia, 1977
 01/19  Marshall Kirk McKusick mckus...@freebsd.org born in Wilmington, 
Delaware, United States, 1954
-01/19  Marcelo S. Araujo ara...@freebsd.org born in Joinville, Santa 
Catarina, Brazil, 1981
 01/19  Ruslan Ermilov r...@freebsd.org born in Simferopol, USSR, 1974
+01/19  Marcelo S. Araujo ara...@freebsd.org born in Joinville, Santa 
Catarina, Brazil, 1981
 01/20  Poul-Henning Kamp p...@freebsd.org born in Korsoer, Denmark, 1966
 01/22  Johann Visagie w...@freebsd.org born in Cape Town, South Africa, 1970
 01/23  Hideyuki KURASHINA rush...@freebsd.org born in Niigata, Japan, 1982
-01/24  Matteo Riondato mat...@freebsd.org born in Padova, Italy, 1986
 01/24  Fabien Thomas fabi...@freebsd.org born in Avignon, France, 1971
+01/24  Matteo Riondato mat...@freebsd.org born in Padova, Italy, 1986
 01/25  Bernd Walter ti...@freebsd.org born in Moers, Nordrhein-Westfalen, 
Germany, 1974
 01/26  Andrew Gallatin galla...@freebsd.org born in Buffalo, New York, 
United States, 1970
 01/27  Nick Sayer nsa...@freebsd.org born in San Diego, California, United 
States, 1968
@@ -43,19 +43,19 @@
 02/01  Christian Brueffer bruef...@freebsd.org born in Gronau, 
Nordrhein-Westfalen, Germany, 1982
 02/01  Steven Kreuzer skreu...@freebsd.org born in Oceanside, New York, 1982
 02/01  Juli Mallett jmall...@freebsd.org born in Washington, Pennsylvania, 
United States, 1985
-02/02   Michael W Lucas mwlu...@freebsd.org born in Detroit, Michigan, 
United States, 1967
 02/02  Diomidis D. Spinellis d...@freebsd.org born in Athens, Greece, 1967
+02/02  Michael W Lucas mwlu...@freebsd.org born in Detroit, Michigan, United 
States, 1967
 02/02  Yoichi Nakayama yoi...@freebsd.org born in Tsu, Mie, Japan, 1976
 02/05  Frank Laszlo lasz...@freebsd.org born in Howell, Michigan, United 
States, 1983
 02/10  David Greenman d...@freebsd.org born in Portland, Oregon, United 
States, 1968
 02/10  Paul Richards p...@freebsd.org born in Ammanford, Carmarthenshire, 
United Kingdom, 1968
 02/10  Simon Barner bar...@freebsd.org born in Rosenheim, Bayern, Germany, 
1980
 02/13  Jesper Skriver jes...@freebsd.org born in Aarhus, Denmark, 1975
+02/13  Steve Wills swi...@freebsd.org born in Lynchburg, Virginia, United 
States, 1975
 02/13  Andrey Slusar an...@freebsd.org born in Odessa, USSR, 1979
 02/13  David W. Chapman Jr. dw...@freebsd.org born in Bethel, Connecticut, 
United States, 1981
-02/13  Steve Wills swi...@freebsd.org born in Lynchburg, Virginia, United 
States, 1975
-02/14  Erwin Lansing er...@freebsd.org born in 's-Hertogenbosch, the 
Netherlands, 1975
 02/14  Manolis Kiagias mano...@freebsd.org born in Chania, Greece, 1970
+02/14  Erwin Lansing er...@freebsd.org born in 's-Hertogenbosch, the 
Netherlands, 1975
 02/14  Martin Blapp m...@freebsd.org born in Olten, Switzerland, 1976
 02/19  Murray Stokely mur...@freebsd.org born in Jacksonville, Florida, 
United States, 1979
 02/20  Anders Nordby and...@freebsd.org born in Oslo, Norway, 1976
@@ -92,10 +92,10 @@
 03/17  Alexander Motin m...@freebsd.org born in Simferopol, Ukraine, 1979
 03/18  Koop Mast k...@freebsd.org born in Dokkum, the Netherlands, 1981
 03/19  Mikhail Teterin m...@freebsd.org born in Kyiv, Ukraine, 1972
+03/20  Joseph S. Atkinson j...@freebsd.org born in Batesville, Arkansas, 
United States, 1977
+03/20  Henrik Brix Andersen b...@freebsd.org born in Aarhus, Denmark, 1978
 03/20  MANTANI Nobutaka nobut...@freebsd.org born in Hiroshima, Japan, 1978
 03/20  Cameron Grant c...@freebsd.org died in Hemel Hempstead, United 
Kingdom, 2005
-03/20  Henrik Brix Andersen 

svn commit: r214974 - head/usr.bin/calendar/calendars

2010-11-08 Thread Ruslan Ermilov
Author: ru
Date: Mon Nov  8 09:50:47 2010
New Revision: 214974
URL: http://svn.freebsd.org/changeset/base/214974

Log:
  Add/expand country/state.

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Nov  8 09:26:56 
2010(r214973)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Nov  8 09:50:47 
2010(r214974)
@@ -41,7 +41,7 @@
 02/01  Paul Saab p...@freebsd.org born in Champaign-Urbana, Illinois, United 
States, 1978
 02/01  Martin Wilke m...@freebsd.org born in Ludwigsfelde, Brandenburg, 
Germany, 1980
 02/01  Christian Brueffer bruef...@freebsd.org born in Gronau, 
Nordrhein-Westfalen, Germany, 1982
-02/01  Steven Kreuzer skreu...@freebsd.org born in Oceanside, New York, 1982
+02/01  Steven Kreuzer skreu...@freebsd.org born in Oceanside, New York, 
United States, 1982
 02/01  Juli Mallett jmall...@freebsd.org born in Washington, Pennsylvania, 
United States, 1985
 02/02  Diomidis D. Spinellis d...@freebsd.org born in Athens, Greece, 1967
 02/02  Michael W Lucas mwlu...@freebsd.org born in Detroit, Michigan, United 
States, 1967
@@ -151,7 +151,7 @@
 05/19  Ian Dowse iedo...@freebsd.org born in Dublin, Ireland, 1975
 05/21  Kris Kennaway k...@freebsd.org born in Winnipeg, Manitoba, Canada, 
1978
 05/22  Clive Tong-I Lin cl...@freebsd.org born in Changhua, Taiwan, Republic 
of China, 1978
-05/22  Michael Bushkov bush...@freebsd.org born in Rostov-on-Don, Russia, 
1985
+05/22  Michael Bushkov bush...@freebsd.org born in Rostov-on-Don, Russian 
Federation, 1985
 05/22  Rui Paulo rpa...@freebsd.org born in Evora, Portugal, 1986
 05/23  Munechika Sumikawa sumik...@freebsd.org born in Osaka, Osaka, Japan, 
1972
 05/24  Duncan McLennan Barclay d...@freebsd.org born in London, Middlesex, 
United Kingdom, 1970
@@ -164,9 +164,9 @@
 05/29  Seigo Tanimura tanim...@freebsd.org born in Kitakyushu, Fukuoka, 
Japan, 1976
 05/31  Ville Skytta s...@freebsd.org born in Helsinki, Finland, 1974
 06/02  Jean-Marc Zucconi j...@freebsd.org born in Pontarlier, France, 1954
-06/02  Alexander Botero-Lowry ale...@freebsd.org born in Austin, TX, USA, 
1986
+06/02  Alexander Botero-Lowry ale...@freebsd.org born in Austin, Texas, 
United States, 1986
 06/03  CHOI Junho c...@freebsd.org born in Seoul, Korea, 1974
-06/03  Wesley Shields w...@freebsd.org born in Binghamton, NY, USA, 1981
+06/03  Wesley Shields w...@freebsd.org born in Binghamton, New York, United 
States, 1981
 06/04  Julian Elischer jul...@freebsd.org born in Perth, Australia, 1959
 06/04  Justin Gibbs gi...@freebsd.org born in San Pedro, California, United 
States, 1973
 06/04  Jason Evans jas...@freebsd.org born in Greeley, Colorado, United 
States, 1973
@@ -229,7 +229,7 @@
 08/07  Jonathan Mini m...@freebsd.org born in San Mateo, California, United 
States, 1979
 08/10  Peter Pentchev r...@freebsd.org born in Sofia, Bulgaria, 1977
 08/12  Joe Marcus Clarke mar...@freebsd.org born in Lakeland, Florida, 
United States, 1976
-08/12  Max Brazhnikov m...@freebsd.org born in Leningradskaya, Russia, 1979
+08/12  Max Brazhnikov m...@freebsd.org born in Leningradskaya, Russian 
Federation, 1979
 08/14  Stefan Esser s...@freebsd.org born in Cologne, Nordrhein-Westfalen, 
Germany, 1961
 08/17  Olivier Houchard cog...@freebsd.org born in Nancy, France, 1980
 08/19  Chin-San Huang chin...@freebsd.org born in Yi-Lan, Taiwan, Republic 
of China, 1979
@@ -272,7 +272,7 @@
 10/02  Beat Gaetzi b...@freebsd.org born in Zurich, Switzerland, 1980
 10/05  Hiroki Sato h...@freebsd.org born in Yamagata, Japan, 1977
 10/05  Chris Costello ch...@freebsd.org born in Houston, Texas, United 
States, 1985
-10/09  Stefan Walter ste...@freebsd.org born in Werne, Nordrhein-Westfalen, 
1978
+10/09  Stefan Walter ste...@freebsd.org born in Werne, Nordrhein-Westfalen, 
Germany, 1978
 10/12  Pawel Jakub Dawidek p...@freebsd.org born in Radzyn Podlaski, Poland, 
1980
 10/15  Maxim Konovalov ma...@freebsd.org born in Khabarovsk, USSR, 1973
 10/16  Remko Lodder re...@freebsd.org born in Rotterdam, the Netherlands, 
1983
@@ -290,7 +290,7 @@
 10/26  Philip M. Gollucci pgollu...@freebsd.org born in Silver Spring, 
Maryland, United States, 1979
 10/27  Takanori Watanabe takaw...@freebsd.org born in Numazu, Shizuoka, 
Japan, 1972
 11/05  M. Warner Losh i...@freebsd.org born in Kansas City, Kansas, United 
States, 1966
-11/09  Coleman Kane cok...@freebsd.org born in Cincinnati, OH, United 
States, 1980
+11/09  Coleman Kane cok...@freebsd.org born in Cincinnati, Ohio, United 
States, 1980
 11/09  Antoine Brodin anto...@freebsd.org born in Bagnolet, France, 1981
 11/10  Gregory Neil Shapiro gshap...@freebsd.org born in Providence, Rhode 
Island, United States, 1970
 11/13  John Baldwin j...@freebsd.org born in Stuart, Virginia, United 
States, 1977

svn commit: r214982 - head/sys/compat/linprocfs

2010-11-08 Thread Dag-Erling Smorgrav
Author: des
Date: Mon Nov  8 12:04:41 2010
New Revision: 214982
URL: http://svn.freebsd.org/changeset/base/214982

Log:
  Fix CPU ID in /proc/cpuinfo.
  
  PR:   kern/56451
  Submitted by: arundel@
  MFC after:3 weeks

Modified:
  head/sys/compat/linprocfs/linprocfs.c

Modified: head/sys/compat/linprocfs/linprocfs.c
==
--- head/sys/compat/linprocfs/linprocfs.c   Mon Nov  8 11:22:55 2010
(r214981)
+++ head/sys/compat/linprocfs/linprocfs.c   Mon Nov  8 12:04:41 2010
(r214982)
@@ -276,11 +276,11 @@ linprocfs_docpuinfo(PFS_FILL_ARGS)
sbuf_printf(sb,
processor\t: %d\n
vendor_id\t: %.20s\n
-   cpu family\t: %d\n
-   model\t\t: %d\n
+   cpu family\t: %u\n
+   model\t\t: %u\n
model name\t: %s\n
-   stepping\t: %d\n\n,
-   i, cpu_vendor, class, cpu, model, cpu_id  0xf);
+   stepping\t: %u\n\n,
+   i, cpu_vendor, CPUID_TO_FAMILY(cpu_id), 
CPUID_TO_MODEL(cpu_id), model, cpu_id  CPUID_STEPPING);
/* XXX per-cpu vendor / class / model / id? */
}
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r214985 - head/sys/compat/linprocfs

2010-11-08 Thread Dag-Erling Smorgrav
Author: des
Date: Mon Nov  8 15:14:14 2010
New Revision: 214985
URL: http://svn.freebsd.org/changeset/base/214985

Log:
  Break long line.

Modified:
  head/sys/compat/linprocfs/linprocfs.c

Modified: head/sys/compat/linprocfs/linprocfs.c
==
--- head/sys/compat/linprocfs/linprocfs.c   Mon Nov  8 13:31:44 2010
(r214984)
+++ head/sys/compat/linprocfs/linprocfs.c   Mon Nov  8 15:14:14 2010
(r214985)
@@ -280,7 +280,8 @@ linprocfs_docpuinfo(PFS_FILL_ARGS)
model\t\t: %u\n
model name\t: %s\n
stepping\t: %u\n\n,
-   i, cpu_vendor, CPUID_TO_FAMILY(cpu_id), 
CPUID_TO_MODEL(cpu_id), model, cpu_id  CPUID_STEPPING);
+   i, cpu_vendor, CPUID_TO_FAMILY(cpu_id),
+   CPUID_TO_MODEL(cpu_id), model, cpu_id  CPUID_STEPPING);
/* XXX per-cpu vendor / class / model / id? */
}
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r214987 - head/sys/kern

2010-11-08 Thread Alexander Motin
Author: mav
Date: Mon Nov  8 15:25:12 2010
New Revision: 214987
URL: http://svn.freebsd.org/changeset/base/214987

Log:
  On APs startup skip hard-/statclock events, which time passed before CPU
  was lauched. Few seconds event burst, accumulated during long startup,
  reported to cause panic in SCHED_ULE priority calculation logic.

Modified:
  head/sys/kern/kern_clocksource.c

Modified: head/sys/kern/kern_clocksource.c
==
--- head/sys/kern/kern_clocksource.cMon Nov  8 15:22:20 2010
(r214986)
+++ head/sys/kern/kern_clocksource.cMon Nov  8 15:25:12 2010
(r214987)
@@ -208,12 +208,13 @@ handleevents(struct bintime *now, int fa
bintime_add(state-nexthard, hardperiod);
runs++;
}
-   if (runs) {
+   if (runs  fake  2) {
hardclock_anycpu(runs, usermode);
done = 1;
}
while (bintime_cmp(now, state-nextstat, =)) {
-   statclock(usermode);
+   if (fake  2)
+   statclock(usermode);
bintime_add(state-nextstat, statperiod);
done = 1;
}
@@ -227,6 +228,10 @@ handleevents(struct bintime *now, int fa
} else
state-nextprof = state-nextstat;
getnextcpuevent(t, 0);
+   if (fake == 2) {
+   state-nextevent = t;
+   return (done);
+   }
ET_HW_LOCK(state);
if (!busy) {
state-idle = 0;
@@ -383,6 +388,11 @@ loadtimer(struct bintime *now, int start
uint64_t tmp;
int eq;
 
+   if (timer-et_flags  ET_FLAGS_PERCPU) {
+   state = DPCPU_PTR(timerstate);
+   next = state-nexttick;
+   } else
+   next = nexttick;
if (periodic) {
if (start) {
/*
@@ -391,20 +401,18 @@ loadtimer(struct bintime *now, int start
 */
tmp = ((uint64_t)now-sec  36) + (now-frac  28);
tmp = (tmp % (timerperiod.frac  28))  28;
-   tmp = timerperiod.frac - tmp;
-   new = timerperiod;
-   bintime_addx(new, tmp);
+   new.sec = 0;
+   new.frac = timerperiod.frac - tmp;
+   if (new.frac  tmp) /* Left less then passed. */
+   bintime_add(new, timerperiod);
CTR5(KTR_SPARE2, load p at %d:   now %d.%08x first in 
%d.%08x,
curcpu, now-sec, (unsigned int)(now-frac  32),
new.sec, (unsigned int)(new.frac  32));
+   *next = new;
+   bintime_add(next, now);
et_start(timer, new, timerperiod);
}
} else {
-   if (timer-et_flags  ET_FLAGS_PERCPU) {
-   state = DPCPU_PTR(timerstate);
-   next = state-nexttick;
-   } else
-   next = nexttick;
getnextevent(new);
eq = bintime_cmp(new, next, ==);
CTR5(KTR_SPARE2, load at %d:next %d.%08x%08x eq %d,
@@ -669,13 +677,19 @@ cpu_initclocks_ap(void)
struct bintime now;
struct pcpu_state *state;
 
-   if (timer-et_flags  ET_FLAGS_PERCPU) {
-   state = DPCPU_PTR(timerstate);
-   binuptime(now);
-   ET_HW_LOCK(state);
+   state = DPCPU_PTR(timerstate);
+   binuptime(now);
+   ET_HW_LOCK(state);
+   if ((timer-et_flags  ET_FLAGS_PERCPU) == 0  periodic) {
+   state-now = nexttick;
+   bintime_sub(state-now, timerperiod);
+   } else
+   state-now = now;
+   hardclock_sync(curcpu);
+   handleevents(state-now, 2);
+   if (timer-et_flags  ET_FLAGS_PERCPU)
loadtimer(now, 1);
-   ET_HW_UNLOCK(state);
-   }
+   ET_HW_UNLOCK(state);
 }
 
 /*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r214988 - in head/sys/dev: ahci ata siis

2010-11-08 Thread Alexander Motin
Author: mav
Date: Mon Nov  8 15:36:15 2010
New Revision: 214988
URL: http://svn.freebsd.org/changeset/base/214988

Log:
  Teach ahci(4), siis(4) and ATA_CAM ata(4) wrapper report to CAM residual
  I/O length on underruns, that often happens for some SCSI commands.

Modified:
  head/sys/dev/ahci/ahci.c
  head/sys/dev/ata/ata-all.c
  head/sys/dev/siis/siis.c

Modified: head/sys/dev/ahci/ahci.c
==
--- head/sys/dev/ahci/ahci.cMon Nov  8 15:25:12 2010(r214987)
+++ head/sys/dev/ahci/ahci.cMon Nov  8 15:36:15 2010(r214988)
@@ -1625,12 +1625,13 @@ ahci_execute_transaction(struct ahci_slo
/* Setup the command list entry */
clp = (struct ahci_cmd_list *)
(ch-dma.work + AHCI_CL_OFFSET + (AHCI_CL_SIZE * slot-slot));
-   clp-prd_length = slot-dma.nsegs;
-   clp-cmd_flags = (ccb-ccb_h.flags  CAM_DIR_OUT ? AHCI_CMD_WRITE : 0) |
-(ccb-ccb_h.func_code == XPT_SCSI_IO ?
- (AHCI_CMD_ATAPI | AHCI_CMD_PREFETCH) : 0) |
-(fis_size / sizeof(u_int32_t)) |
-(port  12);
+   clp-cmd_flags = htole16(
+   (ccb-ccb_h.flags  CAM_DIR_OUT ? AHCI_CMD_WRITE : 0) |
+   (ccb-ccb_h.func_code == XPT_SCSI_IO ?
+(AHCI_CMD_ATAPI | AHCI_CMD_PREFETCH) : 0) |
+   (fis_size / sizeof(u_int32_t)) |
+   (port  12));
+   clp-prd_length = htole16(slot-dma.nsegs);
/* Special handling for Soft Reset command. */
if ((ccb-ccb_h.func_code == XPT_ATA_IO) 
(ccb-ataio.cmd.flags  CAM_ATAIO_CONTROL)) {
@@ -1650,7 +1651,7 @@ ahci_execute_transaction(struct ahci_slo
clp-cmd_table_phys = htole64(ch-dma.work_bus + AHCI_CT_OFFSET +
  (AHCI_CT_SIZE * slot-slot));
bus_dmamap_sync(ch-dma.work_tag, ch-dma.work_map,
-   BUS_DMASYNC_PREWRITE);
+   BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
bus_dmamap_sync(ch-dma.rfis_tag, ch-dma.rfis_map,
BUS_DMASYNC_PREREAD);
/* Set ACTIVE bit for NCQ commands. */
@@ -1855,10 +1856,13 @@ ahci_end_transaction(struct ahci_slot *s
device_t dev = slot-dev;
struct ahci_channel *ch = device_get_softc(dev);
union ccb *ccb = slot-ccb;
+   struct ahci_cmd_list *clp;
int lastto;
 
bus_dmamap_sync(ch-dma.work_tag, ch-dma.work_map,
-   BUS_DMASYNC_POSTWRITE);
+   BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+   clp = (struct ahci_cmd_list *)
+   (ch-dma.work + AHCI_CL_OFFSET + (AHCI_CL_SIZE * slot-slot));
/* Read result registers to the result struct
 * May be incorrect if several commands finished same time,
 * so read only when sure or have to.
@@ -1893,6 +1897,16 @@ ahci_end_transaction(struct ahci_slot *s
res-sector_count_exp = fis[13];
} else
bzero(res, sizeof(*res));
+   if ((ccb-ataio.cmd.flags  CAM_ATAIO_FPDMA) == 0 
+   (ccb-ccb_h.flags  CAM_DIR_MASK) != CAM_DIR_NONE) {
+   ccb-ataio.resid =
+   ccb-ataio.dxfer_len - le32toh(clp-bytecount);
+   }
+   } else {
+   if ((ccb-ccb_h.flags  CAM_DIR_MASK) != CAM_DIR_NONE) {
+   ccb-csio.resid =
+   ccb-csio.dxfer_len - le32toh(clp-bytecount);
+   }
}
if ((ccb-ccb_h.flags  CAM_DIR_MASK) != CAM_DIR_NONE) {
bus_dmamap_sync(ch-dma.data_tag, slot-dma.data_map,

Modified: head/sys/dev/ata/ata-all.c
==
--- head/sys/dev/ata/ata-all.c  Mon Nov  8 15:25:12 2010(r214987)
+++ head/sys/dev/ata/ata-all.c  Mon Nov  8 15:36:15 2010(r214988)
@@ -1517,6 +1517,15 @@ ata_cam_end_transaction(device_t dev, st
res-sector_count = request-u.ata.count;
res-sector_count_exp = request-u.ata.count  8;
}
+   if ((ccb-ccb_h.flags  CAM_DIR_MASK) != CAM_DIR_NONE) {
+   if (ccb-ccb_h.func_code == XPT_ATA_IO) {
+   ccb-ataio.resid =
+   ccb-ataio.dxfer_len - request-donecount;
+   } else {
+   ccb-csio.resid =
+   ccb-csio.dxfer_len - request-donecount;
+   }
+   }
ata_free_request(request);
xpt_done(ccb);
/* Do error recovery if needed. */

Modified: head/sys/dev/siis/siis.c
==
--- head/sys/dev/siis/siis.cMon Nov  8 15:25:12 2010(r214987)
+++ head/sys/dev/siis/siis.cMon Nov  8 15:36:15 2010(r214988)
@@ -1208,6 +1208,17 @@ siis_end_transaction(struct siis_slot *s

svn commit: r214989 - head/sys/cam

2010-11-08 Thread Alexander Motin
Author: mav
Date: Mon Nov  8 15:59:41 2010
New Revision: 214989
URL: http://svn.freebsd.org/changeset/base/214989

Log:
  When requesting sense data for SIM not doing it automatically (such as
  ATAPI or USB), request only as much data as requested by consumer.
  On the way back -- report how much sense data we have actually received.

Modified:
  head/sys/cam/cam_periph.c

Modified: head/sys/cam/cam_periph.c
==
--- head/sys/cam/cam_periph.c   Mon Nov  8 15:36:15 2010(r214988)
+++ head/sys/cam/cam_periph.c   Mon Nov  8 15:59:41 2010(r214989)
@@ -1055,6 +1055,7 @@ camperiphsensedone(struct cam_periph *pe
saved_ccb-ccb_h.status |=
CAM_AUTOSENSE_FAIL;
}
+   saved_ccb-csio.sense_resid = done_ccb-csio.resid;
bcopy(saved_ccb, done_ccb, sizeof(union ccb));
xpt_free_ccb(saved_ccb);
break;
@@ -1211,7 +1212,7 @@ camperiphdone(struct cam_periph *periph,
scsi_request_sense(done_ccb-csio, /*retries*/1,
   camperiphsensedone,
   save_ccb-csio.sense_data,
-  sizeof(save_ccb-csio.sense_data),
+  save_ccb-csio.sense_len,
   CAM_TAG_ACTION_NONE,
   /*sense_len*/SSD_FULL_SIZE,
   /*timeout*/5000);
@@ -1602,7 +1603,7 @@ camperiphscsisenseerror(union ccb *ccb, 
scsi_request_sense(ccb-csio, /*retries*/1,
   camperiphsensedone,
   orig_ccb-csio.sense_data,
-  sizeof(orig_ccb-csio.sense_data),
+  orig_ccb-csio.sense_len,
   CAM_TAG_ACTION_NONE,
   /*sense_len*/SSD_FULL_SIZE,
   /*timeout*/5000);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r214990 - head/usr.bin/yacc

2010-11-08 Thread David E. O'Brien
Author: obrien
Date: Mon Nov  8 19:00:22 2010
New Revision: 214990
URL: http://svn.freebsd.org/changeset/base/214990

Log:
  Back out r214961 for skeleton.c -- it broke the groff build.

Modified:
  head/usr.bin/yacc/skeleton.c

Modified: head/usr.bin/yacc/skeleton.c
==
--- head/usr.bin/yacc/skeleton.cMon Nov  8 15:59:41 2010
(r214989)
+++ head/usr.bin/yacc/skeleton.cMon Nov  8 19:00:22 2010
(r214990)
@@ -157,14 +157,14 @@ const char *body[] =
 else if ((newsize *= 2)  YYMAXDEPTH),
 newsize = YYMAXDEPTH;,
 i = yyssp - yyss;,
-newss = yyss ? realloc(yyss, newsize * sizeof *newss) :,
-  malloc(newsize * sizeof *newss);,
+newss = yyss ? (short *)realloc(yyss, newsize * sizeof *newss) :,
+  (short *)malloc(newsize * sizeof *newss);,
 if (newss == NULL),
 return -1;,
 yyss = newss;,
 yyssp = newss + i;,
-newvs = yyvs ? realloc(yyvs, newsize * sizeof *newvs) :,
-  malloc(newsize * sizeof *newvs);,
+newvs = yyvs ? (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs) :,
+  (YYSTYPE *)malloc(newsize * sizeof *newvs);,
 if (newvs == NULL),
 return -1;,
 yyvs = newvs;,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r214992 - head/sys/dev/re

2010-11-08 Thread Pyun YongHyeon
Author: yongari
Date: Mon Nov  8 19:15:31 2010
New Revision: 214992
URL: http://svn.freebsd.org/changeset/base/214992

Log:
  Reduce spin wait time consumed in GMII register access routine.
  There were a couple of attempts in the past to reduce it since it
  took more than 1ms. Because mii_tick() periodically polls link
  status, waiting more than 1ms for each GMII register access was
  overkill. Unfortunately all previous attempts were failed with
  various ways on different controllers.
  This time, add additional 20us dealy at the end of GMII register
  access which seems to requirement of all RealTek controllers to
  issue next GMII register access request. This is the same way what
  Linux does.

Modified:
  head/sys/dev/re/if_re.c

Modified: head/sys/dev/re/if_re.c
==
--- head/sys/dev/re/if_re.c Mon Nov  8 19:12:19 2010(r214991)
+++ head/sys/dev/re/if_re.c Mon Nov  8 19:15:31 2010(r214992)
@@ -423,13 +423,12 @@ re_gmii_readreg(device_t dev, int phy, i
}
 
CSR_WRITE_4(sc, RL_PHYAR, reg  16);
-   DELAY(1000);
 
for (i = 0; i  RL_PHY_TIMEOUT; i++) {
rval = CSR_READ_4(sc, RL_PHYAR);
if (rval  RL_PHYAR_BUSY)
break;
-   DELAY(100);
+   DELAY(25);
}
 
if (i == RL_PHY_TIMEOUT) {
@@ -437,6 +436,11 @@ re_gmii_readreg(device_t dev, int phy, i
return (0);
}
 
+   /*
+* Controller requires a 20us delay to process next MDIO request.
+*/
+   DELAY(20);
+
return (rval  RL_PHYAR_PHYDATA);
 }
 
@@ -451,13 +455,12 @@ re_gmii_writereg(device_t dev, int phy, 
 
CSR_WRITE_4(sc, RL_PHYAR, (reg  16) |
(data  RL_PHYAR_PHYDATA) | RL_PHYAR_BUSY);
-   DELAY(1000);
 
for (i = 0; i  RL_PHY_TIMEOUT; i++) {
rval = CSR_READ_4(sc, RL_PHYAR);
if (!(rval  RL_PHYAR_BUSY))
break;
-   DELAY(100);
+   DELAY(25);
}
 
if (i == RL_PHY_TIMEOUT) {
@@ -465,6 +468,11 @@ re_gmii_writereg(device_t dev, int phy, 
return (0);
}
 
+   /*
+* Controller requires a 20us delay to process next MDIO request.
+*/
+   DELAY(20);
+
return (0);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r214998 - head/sys/dev/acpica

2010-11-08 Thread Jung-uk Kim
Author: jkim
Date: Mon Nov  8 19:52:14 2010
New Revision: 214998
URL: http://svn.freebsd.org/changeset/base/214998

Log:
  Consistently use padding `_' in the comment.

Modified:
  head/sys/dev/acpica/acpi.c

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Mon Nov  8 19:36:00 2010(r214997)
+++ head/sys/dev/acpica/acpi.c  Mon Nov  8 19:52:14 2010(r214998)
@@ -1693,7 +1693,7 @@ acpi_probe_child(ACPI_HANDLE handle, UIN
/*
 * Since we scan from \, be sure to skip system scope objects.
 * \_SB_ and \_TZ_ are defined in ACPICA as devices to work around
-* BIOS bugs.  For example, \_SB_ is to allow \_SB._INI to be run
+* BIOS bugs.  For example, \_SB_ is to allow \_SB_._INI to be run
 * during the intialization and \_TZ_ is to support Notify() on it.
 */
if (strcmp(handle_str, \\_SB_) == 0 ||
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r214999 - head/sys/dev/iicbus

2010-11-08 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Nov  8 19:53:16 2010
New Revision: 214999
URL: http://svn.freebsd.org/changeset/base/214999

Log:
  Provide support for IIC_M_NOSTOP/IIC_M_NOSTART for bit-banging and
  otherwise low-level controllers.
  
  Reviewed by:  thompsa

Modified:
  head/sys/dev/iicbus/iiconf.c

Modified: head/sys/dev/iicbus/iiconf.c
==
--- head/sys/dev/iicbus/iiconf.cMon Nov  8 19:52:14 2010
(r214998)
+++ head/sys/dev/iicbus/iiconf.cMon Nov  8 19:53:16 2010
(r214999)
@@ -363,7 +363,7 @@ iicbus_transfer(device_t bus, struct iic
 int
 iicbus_transfer_gen(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
 {
-   int i, error, lenread, lenwrote, nkid;
+   int i, error, lenread, lenwrote, nkid, rpstart, addr;
device_t *children, bus;
 
if ((error = device_get_children(dev, children, nkid)) != 0)
@@ -373,14 +373,38 @@ iicbus_transfer_gen(device_t dev, struct
return (EIO);
}
bus = children[0];
+   rpstart = 0;
free(children, M_TEMP);
for (i = 0, error = 0; i  nmsgs  error == 0; i++) {
+   addr = msgs[i].slave;
if (msgs[i].flags  IIC_M_RD)
-   error = iicbus_block_read(bus, msgs[i].slave,
-   msgs[i].buf, msgs[i].len, lenread);
+   addr |= LSB;
else
-   error = iicbus_block_write(bus, msgs[i].slave,
-   msgs[i].buf, msgs[i].len, lenwrote);
+   addr = ~LSB;
+
+   if (!(msgs[i].flags  IIC_M_NOSTART)) {
+   if (rpstart)
+   error = iicbus_repeated_start(bus, addr, 0);
+   else
+   error = iicbus_start(bus, addr, 0);
+   }
+
+   if (error)
+   break;
+
+   if (msgs[i].flags  IIC_M_RD)
+   error = iicbus_read(bus, msgs[i].buf, msgs[i].len,
+   lenread, IIC_LAST_READ, 0);
+   else
+   error = iicbus_write(bus, msgs[i].buf, msgs[i].len,
+   lenwrote, 0);
+
+   if (!(msgs[i].flags  IIC_M_NOSTOP)) {
+   rpstart = 0;
+   iicbus_stop(bus);
+   } else {
+   rpstart = 1;/* Next message gets repeated start */
+   }
}
return (error);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r215001 - head/sys/x86/x86

2010-11-08 Thread John Baldwin
Author: jhb
Date: Mon Nov  8 20:03:51 2010
New Revision: 215001
URL: http://svn.freebsd.org/changeset/base/215001

Log:
  Only dump the values of the PMC and CMCI local vector table entries on a
  local APIC if those LVT entries are valid.  This quiets spurious illegal
  register local APIC errors during boot on a CPU that doesn't support those
  vectors.
  
  MFC after:1 week

Modified:
  head/sys/x86/x86/local_apic.c

Modified: head/sys/x86/x86/local_apic.c
==
--- head/sys/x86/x86/local_apic.c   Mon Nov  8 19:54:44 2010
(r215000)
+++ head/sys/x86/x86/local_apic.c   Mon Nov  8 20:03:51 2010
(r215001)
@@ -324,16 +324,21 @@ lapic_create(u_int apic_id, int boot_cpu
 void
 lapic_dump(const char* str)
 {
+   uint32_t maxlvt;
 
+   maxlvt = (lapic-version  APIC_VER_MAXLVT)  MAXLVTSHIFT;
printf(cpu%d %s:\n, PCPU_GET(cpuid), str);
printf( ID: 0x%08x   VER: 0x%08x LDR: 0x%08x DFR: 0x%08x\n,
lapic-id, lapic-version, lapic-ldr, lapic-dfr);
printf(  lint0: 0x%08x lint1: 0x%08x TPR: 0x%08x SVR: 0x%08x\n,
lapic-lvt_lint0, lapic-lvt_lint1, lapic-tpr, lapic-svr);
-   printf(  timer: 0x%08x therm: 0x%08x err: 0x%08x pmc: 0x%08x\n,
-   lapic-lvt_timer, lapic-lvt_thermal, lapic-lvt_error,
-   lapic-lvt_pcint);
-   printf(   cmci: 0x%08x\n, lapic-lvt_cmci);
+   printf(  timer: 0x%08x therm: 0x%08x err: 0x%08x,
+   lapic-lvt_timer, lapic-lvt_thermal, lapic-lvt_error);
+   if (maxlvt = LVT_PMC)
+   printf( pmc: 0x%08x, lapic-lvt_pcint);
+   printf(\n);
+   if (maxlvt = LVT_CMCI)
+   printf(   cmci: 0x%08x\n, lapic-lvt_cmci);
 }
 
 void
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r215002 - in head/sys: amd64/acpica amd64/amd64 i386/acpica

2010-11-08 Thread John Baldwin
Author: jhb
Date: Mon Nov  8 20:05:22 2010
New Revision: 215002
URL: http://svn.freebsd.org/changeset/base/215002

Log:
  A few small style and whitespace fixes.

Modified:
  head/sys/amd64/acpica/madt.c
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/i386/acpica/madt.c

Modified: head/sys/amd64/acpica/madt.c
==
--- head/sys/amd64/acpica/madt.cMon Nov  8 20:03:51 2010
(r215001)
+++ head/sys/amd64/acpica/madt.cMon Nov  8 20:05:22 2010
(r215002)
@@ -203,8 +203,7 @@ madt_register(void *dummy __unused)
 
apic_register_enumerator(madt_enumerator);
 }
-SYSINIT(madt_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST,
-madt_register, NULL);
+SYSINIT(madt_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, madt_register, 
NULL);
 
 /*
  * Call the handler routine for each entry in the MADT table.

Modified: head/sys/amd64/amd64/mp_machdep.c
==
--- head/sys/amd64/amd64/mp_machdep.c   Mon Nov  8 20:03:51 2010
(r215001)
+++ head/sys/amd64/amd64/mp_machdep.c   Mon Nov  8 20:05:22 2010
(r215002)
@@ -422,7 +422,7 @@ cpu_add(u_int apic_id, char boot_cpu)
}
if (mp_ncpus  MAXCPU) {
mp_ncpus++;
-   mp_maxid = mp_ncpus -1;
+   mp_maxid = mp_ncpus - 1;
}
if (bootverbose)
printf(SMP: Added CPU %d (%s)\n, apic_id, boot_cpu ? BSP :
@@ -445,7 +445,7 @@ cpu_mp_setmaxid(void)
else
KASSERT(mp_maxid = mp_ncpus - 1,
(%s: counters out of sync: max %d, count %d, __func__,
-   mp_maxid, mp_ncpus));   
+   mp_maxid, mp_ncpus));
 }
 
 int

Modified: head/sys/i386/acpica/madt.c
==
--- head/sys/i386/acpica/madt.c Mon Nov  8 20:03:51 2010(r215001)
+++ head/sys/i386/acpica/madt.c Mon Nov  8 20:05:22 2010(r215002)
@@ -95,7 +95,6 @@ static struct apic_enumerator madt_enume
madt_setup_io
 };
 
-
 /*
  * Look for an ACPI Multiple APIC Description Table (APIC)
  */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r214961 - head/usr.bin/yacc

2010-11-08 Thread David O'Brien
On Sun, Nov 07, 2010 at 05:54:20PM -0800, Juli Mallett wrote:
 On Sun, Nov 7, 2010 at 15:22, David E. O'Brien obr...@freebsd.org wrote:
  Author: obrien
  Date: Sun Nov ?7 23:22:42 2010
  New Revision: 214961
  URL: http://svn.freebsd.org/changeset/base/214961
 
  Log:
  ?Directly use memory allocation functions and remove needless casts in
  ?their usage. ?Also use associated modern types instead of kr ones.
 
 You do know that changing skeleton.c affects the generated files,
 right?

Yes Juli, I know how byacc works.

 I'm wondering if whatever sed script you're
 judiciously-applying knows that.  C++ does not do implicit conversions
 from void * so you need the casts on the mallocs there.

The changes I made were tested on building several other applications.

 With a C++ compiler:

But as you indirectly point out -- they were all C applications.

-- 
-- David  (obr...@freebsd.org)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r215007 - head/sys/modules/acpi

2010-11-08 Thread John Baldwin
Author: jhb
Date: Mon Nov  8 20:30:59 2010
New Revision: 215007
URL: http://svn.freebsd.org/changeset/base/215007

Log:
  Disconnect acpi.ko from the build on i386.  ACPI is now only supported when
  compiled into the kernel, not as a loadable module.

Modified:
  head/sys/modules/acpi/Makefile

Modified: head/sys/modules/acpi/Makefile
==
--- head/sys/modules/acpi/Makefile  Mon Nov  8 20:25:19 2010
(r215006)
+++ head/sys/modules/acpi/Makefile  Mon Nov  8 20:30:59 2010
(r215007)
@@ -1,10 +1,6 @@
 # $FreeBSD$
 
-.if ${MACHINE} == i386
-SUBDIR=acpi
-.endif
-
-SUBDIR+=   acpi_asus acpi_fujitsu acpi_hp acpi_ibm \
+SUBDIR=acpi_asus acpi_fujitsu acpi_hp acpi_ibm \
acpi_panasonic acpi_sony acpi_toshiba acpi_video\
acpi_dock acpi_wmi aibs
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r215008 - head/sys/i386/i386

2010-11-08 Thread John Baldwin
Author: jhb
Date: Mon Nov  8 20:32:35 2010
New Revision: 215008
URL: http://svn.freebsd.org/changeset/base/215008

Log:
  Remove stub symbols for APIC-related functions when 'device apic' is not
  included in a kernel config.  These stubs had existed previously so that
  acpi.ko could always include the MADT parsing code and still link with a
  kernel that did not include 'device apic'.

Modified:
  head/sys/i386/i386/machdep.c

Modified: head/sys/i386/i386/machdep.c
==
--- head/sys/i386/i386/machdep.cMon Nov  8 20:30:59 2010
(r215007)
+++ head/sys/i386/i386/machdep.cMon Nov  8 20:32:35 2010
(r215008)
@@ -40,7 +40,6 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
-#include opt_apic.h
 #include opt_atalk.h
 #include opt_compat.h
 #include opt_cpu.h
@@ -3614,102 +3613,6 @@ user_dbreg_trap(void)
 return 0;
 }
 
-#ifndef DEV_APIC
-#include machine/apicvar.h
-
-/*
- * Provide stub functions so that the MADT APIC enumerator in the acpi
- * kernel module will link against a kernel without 'device apic'.
- *
- * XXX - This is a gross hack.
- */
-void
-apic_register_enumerator(struct apic_enumerator *enumerator)
-{
-}
-
-void *
-ioapic_create(vm_paddr_t addr, int32_t apic_id, int intbase)
-{
-   return (NULL);
-}
-
-int
-ioapic_disable_pin(void *cookie, u_int pin)
-{
-   return (ENXIO);
-}
-
-int
-ioapic_get_vector(void *cookie, u_int pin)
-{
-   return (-1);
-}
-
-void
-ioapic_register(void *cookie)
-{
-}
-
-int
-ioapic_remap_vector(void *cookie, u_int pin, int vector)
-{
-   return (ENXIO);
-}
-
-int
-ioapic_set_extint(void *cookie, u_int pin)
-{
-   return (ENXIO);
-}
-
-int
-ioapic_set_nmi(void *cookie, u_int pin)
-{
-   return (ENXIO);
-}
-
-int
-ioapic_set_polarity(void *cookie, u_int pin, enum intr_polarity pol)
-{
-   return (ENXIO);
-}
-
-int
-ioapic_set_triggermode(void *cookie, u_int pin, enum intr_trigger trigger)
-{
-   return (ENXIO);
-}
-
-void
-lapic_create(u_int apic_id, int boot_cpu)
-{
-}
-
-void
-lapic_init(vm_paddr_t addr)
-{
-}
-
-int
-lapic_set_lvt_mode(u_int apic_id, u_int lvt, u_int32_t mode)
-{
-   return (ENXIO);
-}
-
-int
-lapic_set_lvt_polarity(u_int apic_id, u_int lvt, enum intr_polarity pol)
-{
-   return (ENXIO);
-}
-
-int
-lapic_set_lvt_triggermode(u_int apic_id, u_int lvt, enum intr_trigger trigger)
-{
-   return (ENXIO);
-}
-#endif
-
 #ifdef KDB
 
 /*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r215009 - in head/sys: i386/acpica i386/i386 i386/xen x86/x86

2010-11-08 Thread John Baldwin
Author: jhb
Date: Mon Nov  8 20:35:09 2010
New Revision: 215009
URL: http://svn.freebsd.org/changeset/base/215009

Log:
  Sync the APIC startup sequence with amd64:
  - Register APIC enumerators at SI_SUB_TUNABLES - 1 instead of SI_SUB_CPU - 1.
  - Probe CPUs at SI_SUB_TUNABLES - 1.  This allows i386 to set a truly
accurate mp_maxid value rather than always setting it to MAXCPU - 1.

Modified:
  head/sys/i386/acpica/madt.c
  head/sys/i386/i386/mp_machdep.c
  head/sys/i386/xen/mptable.c
  head/sys/x86/x86/local_apic.c
  head/sys/x86/x86/mptable.c

Modified: head/sys/i386/acpica/madt.c
==
--- head/sys/i386/acpica/madt.c Mon Nov  8 20:32:35 2010(r215008)
+++ head/sys/i386/acpica/madt.c Mon Nov  8 20:35:09 2010(r215009)
@@ -203,7 +203,7 @@ madt_register(void *dummy __unused)
 
apic_register_enumerator(madt_enumerator);
 }
-SYSINIT(madt_register, SI_SUB_CPU - 1, SI_ORDER_SECOND, madt_register, NULL);
+SYSINIT(madt_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, madt_register, 
NULL);
 
 /*
  * Call the handler routine for each entry in the MADT table.

Modified: head/sys/i386/i386/mp_machdep.c
==
--- head/sys/i386/i386/mp_machdep.c Mon Nov  8 20:32:35 2010
(r215008)
+++ head/sys/i386/i386/mp_machdep.c Mon Nov  8 20:35:09 2010
(r215009)
@@ -465,8 +465,10 @@ cpu_add(u_int apic_id, char boot_cpu)
boot_cpu_id = apic_id;
cpu_info[apic_id].cpu_bsp = 1;
}
-   if (mp_ncpus  MAXCPU)
+   if (mp_ncpus  MAXCPU) {
mp_ncpus++;
+   mp_maxid = mp_ncpus - 1;
+   }
if (bootverbose)
printf(SMP: Added CPU %d (%s)\n, apic_id, boot_cpu ? BSP :
AP);
@@ -476,7 +478,19 @@ void
 cpu_mp_setmaxid(void)
 {
 
-   mp_maxid = MAXCPU - 1;
+   /*
+* mp_maxid should be already set by calls to cpu_add().
+* Just sanity check its value here.
+*/
+   if (mp_ncpus == 0)
+   KASSERT(mp_maxid == 0,
+   (%s: mp_ncpus is zero, but mp_maxid is not, __func__));
+   else if (mp_ncpus == 1)
+   mp_maxid = 0;
+   else
+   KASSERT(mp_maxid = mp_ncpus - 1,
+   (%s: counters out of sync: max %d, count %d, __func__,
+   mp_maxid, mp_ncpus));
 }
 
 int
@@ -504,6 +518,7 @@ cpu_mp_probe(void)
 * One CPU was found, so this must be a UP system with
 * an I/O APIC.
 */
+   mp_maxid = 0;
return (0);
}
 

Modified: head/sys/i386/xen/mptable.c
==
--- head/sys/i386/xen/mptable.c Mon Nov  8 20:32:35 2010(r215008)
+++ head/sys/i386/xen/mptable.c Mon Nov  8 20:35:09 2010(r215009)
@@ -109,7 +109,7 @@ mptable_register(void *dummy __unused)
 
apic_register_enumerator(mptable_enumerator);
 }
-SYSINIT(mptable_register, SI_SUB_CPU - 1, SI_ORDER_FIRST, mptable_register,
+SYSINIT(mptable_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, 
mptable_register,
 NULL);
 
 

Modified: head/sys/x86/x86/local_apic.c
==
--- head/sys/x86/x86/local_apic.c   Mon Nov  8 20:32:35 2010
(r215008)
+++ head/sys/x86/x86/local_apic.c   Mon Nov  8 20:35:09 2010
(r215009)
@@ -1285,7 +1285,7 @@ apic_init(void *dummy __unused)
if (resource_disabled(apic, 0))
return;
 
-   /* First, probe all the enumerators to find the best match. */
+   /* Probe all the enumerators to find the best match. */
best_enum = NULL;
best = 0;
SLIST_FOREACH(enumerator, enumerators, apic_next) {
@@ -1321,13 +1321,12 @@ apic_init(void *dummy __unused)
}
 #endif
 
-   /* Second, probe the CPU's in the system. */
+   /* Probe the CPU's in the system. */
retval = best_enum-apic_probe_cpus();
if (retval != 0)
printf(%s: Failed to probe CPUs: returned %d\n,
best_enum-apic_name, retval);
 
-#ifdef __amd64__
 }
 SYSINIT(apic_init, SI_SUB_TUNABLES - 1, SI_ORDER_SECOND, apic_init, NULL);
 
@@ -1342,19 +1341,14 @@ apic_setup_local(void *dummy __unused)
  
if (best_enum == NULL)
return;
-#endif
-   /* Third, initialize the local APIC. */
+
+   /* Initialize the local APIC. */
retval = best_enum-apic_setup_local();
if (retval != 0)
printf(%s: Failed to setup the local APIC: returned %d\n,
best_enum-apic_name, retval);
 }
-#ifdef __amd64__
-SYSINIT(apic_setup_local, SI_SUB_CPU, SI_ORDER_SECOND, apic_setup_local,
-NULL);
-#else
-SYSINIT(apic_init, SI_SUB_CPU, SI_ORDER_SECOND, apic_init, NULL);
-#endif

svn commit: r215010 - head/share/man/man4

2010-11-08 Thread John Baldwin
Author: jhb
Date: Mon Nov  8 20:44:11 2010
New Revision: 215010
URL: http://svn.freebsd.org/changeset/base/215010

Log:
  Don't mention 'device acpi' or loading ACPI as a kernel module since the
  latter is not supported.  This is also more consistent with manpages for
  other vendor-specific drivers such as acpi_ibm(4) and acpi_sony(4).

Modified:
  head/share/man/man4/aibs.4

Modified: head/share/man/man4/aibs.4
==
--- head/share/man/man4/aibs.4  Mon Nov  8 20:35:09 2010(r215009)
+++ head/share/man/man4/aibs.4  Mon Nov  8 20:44:11 2010(r215010)
@@ -24,18 +24,16 @@
 .Nd ASUSTeK AI Booster ACPI ATK0110 voltage, temperature and fan sensor
 .Sh SYNOPSIS
 To compile this driver into the kernel,
-place the following lines in your
+place the following line in your
 kernel configuration file:
 .Bd -ragged -offset indent
-.Cd device acpi
 .Cd device aibs
 .Ed
 .Pp
 Alternatively, to load the driver as a
-module at boot time, place the following lines in
+module at boot time, place the following line in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
-acpi_load=YES
 aibs_load=YES
 .Ed
 .Sh DESCRIPTION
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r215011 - in head: share/man/man9 sys/kern sys/sys

2010-11-08 Thread Matthew D Fleming
Author: mdf
Date: Mon Nov  8 20:56:31 2010
New Revision: 215011
URL: http://svn.freebsd.org/changeset/base/215011

Log:
  Add a taskqueue_cancel(9) to cancel a pending task without waiting for
  it to run as taskqueue_drain(9) does.
  
  Requested by: hselasky
  Original code:jeff
  Reviewed by:  jhb
  MFC after:2 weeks

Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/taskqueue.9
  head/sys/kern/subr_taskqueue.c
  head/sys/sys/taskqueue.h

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileMon Nov  8 20:44:11 2010
(r215010)
+++ head/share/man/man9/MakefileMon Nov  8 20:56:31 2010
(r215011)
@@ -1212,6 +1212,7 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_ent
sysctl_ctx_init.9 sysctl_ctx_entry_find.9 \
sysctl_ctx_init.9 sysctl_ctx_free.9
 MLINKS+=taskqueue.9 TASK_INIT.9 \
+   taskqueue.9 taskqueue_cancel.9 \
taskqueue.9 taskqueue_create.9 \
taskqueue.9 taskqueue_create_fast.9 \
taskqueue.9 TASKQUEUE_DECLARE.9 \

Modified: head/share/man/man9/taskqueue.9
==
--- head/share/man/man9/taskqueue.9 Mon Nov  8 20:44:11 2010
(r215010)
+++ head/share/man/man9/taskqueue.9 Mon Nov  8 20:56:31 2010
(r215011)
@@ -63,6 +63,8 @@ struct task {
 .Fn taskqueue_enqueue struct taskqueue *queue struct task *task
 .Ft int
 .Fn taskqueue_enqueue_fast struct taskqueue *queue struct task *task
+.Ft int
+.Fn taskqueue_cancel struct taskqueue *queue struct task *task u_int 
*pendp
 .Ft void
 .Fn taskqueue_drain struct taskqueue *queue struct task *task
 .Ft int
@@ -162,6 +164,31 @@ is called on the task pointer passed to
 .Fn taskqueue_enqueue .
 .Pp
 The
+.Fn taskqueue_cancel
+function is used to cancel a task.
+The
+.Va ta_pending
+count is cleared, and the old value returned in the reference
+parameter
+.Fa pendp ,
+if it is non- Dv NULL .
+If the task is currently running,
+.Dv EBUSY
+is returned, otherwise 0.
+To implement a blocking
+.Fn taskqueue_cancel
+that waits for a running task to finish, it could look like:
+.Bd -literal -offset indent
+while (taskqueue_cancel(tq, task, NULL) != 0)
+   taskqueue_drain(tq, task);
+.Ed
+.Pp
+Note that, as with
+.Fn taskqueue_drain ,
+the caller is responsible for ensuring that the task is not re-enqueued
+after being canceled.
+.Pp
+The
 .Fn taskqueue_drain
 function is used to wait for the task to finish.
 There is no guarantee that the task will not be

Modified: head/sys/kern/subr_taskqueue.c
==
--- head/sys/kern/subr_taskqueue.c  Mon Nov  8 20:44:11 2010
(r215010)
+++ head/sys/kern/subr_taskqueue.c  Mon Nov  8 20:56:31 2010
(r215011)
@@ -275,6 +275,24 @@ task_is_running(struct taskqueue *queue,
return (0);
 }
 
+int
+taskqueue_cancel(struct taskqueue *queue, struct task *task, u_int *pendp)
+{
+   u_int pending;
+   int error;
+
+   TQ_LOCK(queue);
+   if ((pending = task-ta_pending)  0)
+   STAILQ_REMOVE(queue-tq_queue, task, task, ta_link);
+   task-ta_pending = 0;
+   error = task_is_running(queue, task) ? EBUSY : 0;
+   TQ_UNLOCK(queue);
+
+   if (pendp != NULL)
+   *pendp = pending;
+   return (error);
+}
+
 void
 taskqueue_drain(struct taskqueue *queue, struct task *task)
 {

Modified: head/sys/sys/taskqueue.h
==
--- head/sys/sys/taskqueue.hMon Nov  8 20:44:11 2010(r215010)
+++ head/sys/sys/taskqueue.hMon Nov  8 20:56:31 2010(r215011)
@@ -54,6 +54,8 @@ struct taskqueue *taskqueue_create(const
 inttaskqueue_start_threads(struct taskqueue **tqp, int count, int pri,
const char *name, ...) __printflike(4, 5);
 inttaskqueue_enqueue(struct taskqueue *queue, struct task *task);
+inttaskqueue_cancel(struct taskqueue *queue, struct task *task,
+   u_int *pendp);
 void   taskqueue_drain(struct taskqueue *queue, struct task *task);
 void   taskqueue_free(struct taskqueue *queue);
 void   taskqueue_run(struct taskqueue *queue);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r215012 - in head/sys: amd64/acpica conf i386/acpica modules/acpi/acpi x86/acpica

2010-11-08 Thread John Baldwin
Author: jhb
Date: Mon Nov  8 20:57:02 2010
New Revision: 215012
URL: http://svn.freebsd.org/changeset/base/215012

Log:
  Move the MADT parser for amd64 and i386 to sys/x86/acpica now that it is
  identical on both platforms.

Added:
  head/sys/x86/acpica/madt.c
 - copied unchanged from r215009, head/sys/i386/acpica/madt.c
Deleted:
  head/sys/amd64/acpica/madt.c
  head/sys/i386/acpica/madt.c
Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/modules/acpi/acpi/Makefile

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Mon Nov  8 20:56:31 2010(r215011)
+++ head/sys/conf/files.amd64   Mon Nov  8 20:57:02 2010(r215012)
@@ -92,7 +92,6 @@ acpi_wakedata.h   optionalacpi
\
clean   acpi_wakedata.h
 #
 amd64/acpica/acpi_wakeup.c optionalacpi
-amd64/acpica/madt.coptionalacpi
 amd64/amd64/amd64_mem.coptionalmem
 #amd64/amd64/apic_vector.S standard
 amd64/amd64/atomic.c   standard
@@ -301,6 +300,7 @@ contrib/x86emu/x86emu.c optional x86bio
 #
 # x86 shared code between IA32, AMD64 and PC98 architectures
 #
+x86/acpica/madt.c  optionalacpi
 x86/acpica/srat.c  optionalacpi
 x86/bios/smbios.c  optionalsmbios
 x86/bios/vpd.c optionalvpd

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Mon Nov  8 20:56:31 2010(r215011)
+++ head/sys/conf/files.i386Mon Nov  8 20:57:02 2010(r215012)
@@ -247,7 +247,6 @@ acpi_wakecode.h optional acpi   
\
no-obj no-implicit-rule before-depend   \
clean   acpi_wakecode.h acpi_wakecode.o acpi_wakecode.bin
 #
-i386/acpica/madt.c optional acpi apic
 i386/bios/apm.coptional apm
 i386/bios/mca_machdep.coptional mca
 i386/bios/smapi.c  optional smapi
@@ -374,6 +373,7 @@ compat/x86bios/x86bios.coptional x86bio
 #
 # x86 shared code between IA32, AMD64 and PC98 architectures
 #
+x86/acpica/madt.c  optional acpi apic
 x86/acpica/srat.c  optional acpi
 x86/bios/smbios.c  optional smbios
 x86/bios/vpd.c optional vpd

Modified: head/sys/modules/acpi/acpi/Makefile
==
--- head/sys/modules/acpi/acpi/Makefile Mon Nov  8 20:56:31 2010
(r215011)
+++ head/sys/modules/acpi/acpi/Makefile Mon Nov  8 20:57:02 2010
(r215012)
@@ -22,7 +22,8 @@
${.CURDIR}/../../../pci \
${.CURDIR}/../../../dev/acpica \
${.CURDIR}/../../../dev/acpica/Osd \
-   ${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica
+   ${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica \
+   ${.CURDIR}/../../../x86/acpica
 
 KMOD=  acpi
 

Copied: head/sys/x86/acpica/madt.c (from r215009, head/sys/i386/acpica/madt.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/x86/acpica/madt.c  Mon Nov  8 20:57:02 2010(r215012, copy 
of r215009, head/sys/i386/acpica/madt.c)
@@ -0,0 +1,572 @@
+/*-
+ * Copyright (c) 2003 John Baldwin j...@freebsd.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of any co-contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 

svn commit: r215014 - head/sys/contrib/octeon-sdk

2010-11-08 Thread Juli Mallett
Author: jmallett
Date: Mon Nov  8 21:22:55 2010
New Revision: 215014
URL: http://svn.freebsd.org/changeset/base/215014

Log:
  o) Recognize the Lanner MR-730.
  o) Fix enumeration of PHY addresses on the MR-955.
  o) Parse link state for the MR-730 using the Broadcom PHY support in the SDK.
 It's not clear that this is entirely-correct, but it seems to work.  Since
 this board uses a BCM5482S, this may mean that we work correctly for copper
 but not SFI, which is untested.

Modified:
  head/sys/contrib/octeon-sdk/cvmx-app-init.h
  head/sys/contrib/octeon-sdk/cvmx-helper-board.c
  head/sys/contrib/octeon-sdk/cvmx-helper.c

Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h
==
--- head/sys/contrib/octeon-sdk/cvmx-app-init.h Mon Nov  8 20:57:08 2010
(r215013)
+++ head/sys/contrib/octeon-sdk/cvmx-app-init.h Mon Nov  8 21:22:55 2010
(r215014)
@@ -193,6 +193,9 @@ enum cvmx_board_types_enum {
 CVMX_BOARD_TYPE_CUST_GCT108  = 10012,
 CVMX_BOARD_TYPE_CUST_AGS109  = 10013,
 CVMX_BOARD_TYPE_CUST_GCT110  = 10014,
+#if defined(OCTEON_VENDOR_LANNER)
+CVMX_BOARD_TYPE_CUST_LANNER_MR730= 10021,
+#endif
 CVMX_BOARD_TYPE_CUST_DEFINED_MAX = 2,
 
 /* Set aside a range for customer private use.  The SDK won't
@@ -272,6 +275,9 @@ static inline const char *cvmx_board_typ
 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GCT108)
 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_AGS109)
 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GCT110)
+#if defined(OCTEON_VENDOR_LANNER)
+   ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR730)
+#endif
 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MAX)
 
 /* Customer private range */

Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c
==
--- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Mon Nov  8 20:57:08 
2010(r215013)
+++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Mon Nov  8 21:22:55 
2010(r215014)
@@ -114,9 +114,6 @@ int cvmx_helper_board_get_mii_address(in
 case CVMX_BOARD_TYPE_EBT5800:
 case CVMX_BOARD_TYPE_THUNDER:
 case CVMX_BOARD_TYPE_NICPRO2:
-#if defined(OCTEON_VENDOR_LANNER)
-   case CVMX_BOARD_TYPE_CUST_LANNER_MR955:
-#endif
 /* Interface 0 is SPI4, interface 1 is RGMII */
 if ((ipd_port = 16)  (ipd_port  20))
 return ipd_port - 16;
@@ -180,6 +177,15 @@ int cvmx_helper_board_get_mii_address(in
 
/* Private vendor-defined boards.  */
 #if defined(OCTEON_VENDOR_LANNER)
+   case CVMX_BOARD_TYPE_CUST_LANNER_MR955:
+   /* Interface 1 is 12 BCM5482S PHYs.  */
+if ((ipd_port = 16)  (ipd_port  28))
+return ipd_port - 16;
+   return -1;
+   case CVMX_BOARD_TYPE_CUST_LANNER_MR730:
+if ((ipd_port = 0)  (ipd_port  4))
+return ipd_port;
+   return -1;
case CVMX_BOARD_TYPE_CUST_LANNER_MR320:
/* Port 0 is a Marvell 88E6161 switch, ports 1 and 2 are Marvell
   88E interfaces.  */
@@ -291,6 +297,10 @@ cvmx_helper_link_info_t __cvmx_helper_bo
 break;
/* Private vendor-defined boards.  */
 #if defined(OCTEON_VENDOR_LANNER)
+   case CVMX_BOARD_TYPE_CUST_LANNER_MR730:
+   /* Ports are BCM5482S */
+   is_broadcom_phy = 1;
+   break;
case CVMX_BOARD_TYPE_CUST_LANNER_MR320:
/* Port 0 connects to the switch */
if (ipd_port == 0)

Modified: head/sys/contrib/octeon-sdk/cvmx-helper.c
==
--- head/sys/contrib/octeon-sdk/cvmx-helper.c   Mon Nov  8 20:57:08 2010
(r215013)
+++ head/sys/contrib/octeon-sdk/cvmx-helper.c   Mon Nov  8 21:22:55 2010
(r215014)
@@ -105,6 +105,8 @@ int cvmx_helper_get_number_of_interfaces
 #if defined(OCTEON_VENDOR_LANNER)
case CVMX_BOARD_TYPE_CUST_LANNER_MR955:
return 2;
+   case CVMX_BOARD_TYPE_CUST_LANNER_MR730:
+   return 1;
 #endif
default:
break;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r215015 - head/sys/dev/mii

2010-11-08 Thread Juli Mallett
Author: jmallett
Date: Mon Nov  8 21:23:28 2010
New Revision: 215015
URL: http://svn.freebsd.org/changeset/base/215015

Log:
  Recognize the BCM5482S.

Modified:
  head/sys/dev/mii/brgphy.c
  head/sys/dev/mii/miidevs

Modified: head/sys/dev/mii/brgphy.c
==
--- head/sys/dev/mii/brgphy.c   Mon Nov  8 21:22:55 2010(r215014)
+++ head/sys/dev/mii/brgphy.c   Mon Nov  8 21:23:28 2010(r215015)
@@ -132,6 +132,7 @@ static const struct mii_phydesc brgphys[
MII_PHY_DESC(xxBROADCOM, BCM5754),
MII_PHY_DESC(xxBROADCOM, BCM5780),
MII_PHY_DESC(xxBROADCOM, BCM5708C),
+   MII_PHY_DESC(xxBROADCOM_ALT1, BCM5482S),
MII_PHY_DESC(xxBROADCOM_ALT1, BCM5755),
MII_PHY_DESC(xxBROADCOM_ALT1, BCM5787),
MII_PHY_DESC(xxBROADCOM_ALT1, BCM5708S),

Modified: head/sys/dev/mii/miidevs
==
--- head/sys/dev/mii/miidevsMon Nov  8 21:22:55 2010(r215014)
+++ head/sys/dev/mii/miidevsMon Nov  8 21:23:28 2010(r215015)
@@ -145,6 +145,7 @@ model xxBROADCOM BCM54K20x002e BCM54K2 
 model xxBROADCOM BCM5714   0x0034 BCM5714 10/100/1000baseTX PHY
 model xxBROADCOM BCM5780   0x0035 BCM5780 10/100/1000baseTX PHY
 model xxBROADCOM BCM5708C  0x0036 BCM5708C 10/100/1000baseTX PHY
+model xxBROADCOM_ALT1 BCM5482S 0x000b BCM5482S Dual-Port 10/100/1000baseX/FX 
PHY
 model xxBROADCOM_ALT1 BCM5755  0x000c BCM5755 10/100/1000baseTX PHY
 model xxBROADCOM_ALT1 BCM5787  0x000e BCM5787 10/100/1000baseTX PHY
 model xxBROADCOM_ALT1 BCM5708S 0x0015 BCM5708S 1000/2500BaseSX PHY
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r215016 - in head/sys/boot: common forth i386/libi386 i386/loader

2010-11-08 Thread John Baldwin
Author: jhb
Date: Mon Nov  8 21:50:45 2010
New Revision: 215016
URL: http://svn.freebsd.org/changeset/base/215016

Log:
  Remove support for autoloading ACPI from the loader.  Leave in the code to
  detect ACPI and export info such as the location of the RSDP via hints as
  that is still useful.

Modified:
  head/sys/boot/common/loader.8
  head/sys/boot/forth/beastie.4th
  head/sys/boot/i386/libi386/biosacpi.c
  head/sys/boot/i386/libi386/i386_module.c
  head/sys/boot/i386/loader/help.i386

Modified: head/sys/boot/common/loader.8
==
--- head/sys/boot/common/loader.8   Mon Nov  8 21:23:28 2010
(r215015)
+++ head/sys/boot/common/loader.8   Mon Nov  8 21:50:45 2010
(r215016)
@@ -334,12 +334,6 @@ Some options may require a value,
 while others define behavior just by being set.
 Both types of builtin variables are described below.
 .Bl -tag -width bootfile
-.It Va acpi_load
-Unset this to disable automatic loading of the ACPI module.
-See also
-.Va hint.acpi.0.disabled
-in
-.Xr device.hints 5 .
 .It Va autoboot_delay
 Number of seconds
 .Ic autoboot

Modified: head/sys/boot/forth/beastie.4th
==
--- head/sys/boot/forth/beastie.4th Mon Nov  8 21:23:28 2010
(r215015)
+++ head/sys/boot/forth/beastie.4th Mon Nov  8 21:50:45 2010
(r215016)
@@ -141,13 +141,11 @@ at-xy . `--{__) 
 ;
 
 : acpienabled? ( -- flag )
-   s acpi_load getenv
+   s hint.acpi.0.rsdp getenv
dup -1 = if
drop false exit
then
-   s YES compare-insensitive 0 if
-   false exit
-   then
+   2drop
s hint.acpi.0.disabled getenv
dup -1  if
s 0 compare 0 if
@@ -254,11 +252,9 @@ set-current
dup bootkey @ = if 0 boot then
dup bootacpikey @ = if
acpienabled? if
-   s acpi_load unsetenv
s 1 s hint.acpi.0.disabled setenv
s 1 s loader.acpi_disabled_by_user setenv
else
-   s YES s acpi_load setenv
s 0 s hint.acpi.0.disabled setenv
then
0 boot
@@ -266,7 +262,6 @@ set-current
dup bootsafekey @ = if
s arch-i386 environment? if
drop
-   s acpi_load unsetenv
s 1 s hint.acpi.0.disabled setenv
s 1 s loader.acpi_disabled_by_user setenv
s 1 s hint.apic.0.disabled setenv

Modified: head/sys/boot/i386/libi386/biosacpi.c
==
--- head/sys/boot/i386/libi386/biosacpi.c   Mon Nov  8 21:23:28 2010
(r215015)
+++ head/sys/boot/i386/libi386/biosacpi.c   Mon Nov  8 21:50:45 2010
(r215016)
@@ -40,7 +40,7 @@ __FBSDID($FreeBSD$);
 #include actbl.h
 
 /*
- * Detect ACPI and export information about the APCI BIOS into the
+ * Detect ACPI and export information about the ACPI BIOS into the
  * environment.
  */
 
@@ -56,8 +56,6 @@ biosacpi_detect(void)
 char   buf[24];
 intrevision;
 
-/* XXX check the BIOS datestamp */
-
 /* locate and validate the RSDP */
 if ((rsdp = biosacpi_find_rsdp()) == NULL)
return;
@@ -82,9 +80,6 @@ biosacpi_detect(void)
sprintf(buf, %d, rsdp-Length);
setenv(hint.acpi.0.xsdt_length, buf, 1);
 }
-/* XXX other tables? */
-
-setenv(acpi_load, YES, 1);
 }
 
 /*

Modified: head/sys/boot/i386/libi386/i386_module.c
==
--- head/sys/boot/i386/libi386/i386_module.cMon Nov  8 21:23:28 2010
(r215015)
+++ head/sys/boot/i386/libi386/i386_module.cMon Nov  8 21:50:45 2010
(r215016)
@@ -44,25 +44,7 @@ __FBSDID($FreeBSD$);
 int
 i386_autoload(void)
 {
-interror;
-intdisabled;
-char   *rv;
 
 /* XXX use PnP to locate stuff here */
-
-/* autoload ACPI support */
-/* XXX should be in 4th keyed off acpi_load */
-disabled = 0;
-rv = getenv(hint.acpi.0.disabled);
-if (rv != NULL  strncmp(rv, 0, 1) != 0) {
-   disabled = 1;
-}
-
-if (getenv(acpi_load)  (!disabled)) {
-   error = mod_load(acpi, NULL, 0, NULL);
-   if (error != 0)
-   printf(ACPI autoload failed - %s\n, strerror(error));
-}
-
 return(0);
 }

Modified: head/sys/boot/i386/loader/help.i386
==
--- head/sys/boot/i386/loader/help.i386 Mon Nov  8 21:23:28 2010
(r215015)
+++ 

svn commit: r215017 - in head/sys: dev/re pci

2010-11-08 Thread Pyun YongHyeon
Author: yongari
Date: Mon Nov  8 21:50:50 2010
New Revision: 215017
URL: http://svn.freebsd.org/changeset/base/215017

Log:
  Follow the lead of vendor's interrupt moderation mechanism.
  It seems RTL8169/RTL8168/RTL810xE has a kind of interrupt
  moderation mechanism but it is not documented at all. The magic
  value dramatically reduced number of interrupts without noticeable
  performance drops so apply it to all RTL8169/RTL8169 controllers.
  Vendor's FreeBSD driver also applies it to RTL810xE controllers but
  their Linux driver explicitly cleared the register, so do not
  enable interrupt moderation for RTL810xE controllers.
  
  While I'm here sort 8169 specific registers.
  
  Obtained from:RealTek FreeBSD driver

Modified:
  head/sys/dev/re/if_re.c
  head/sys/pci/if_rlreg.h

Modified: head/sys/dev/re/if_re.c
==
--- head/sys/dev/re/if_re.c Mon Nov  8 21:50:45 2010(r215016)
+++ head/sys/dev/re/if_re.c Mon Nov  8 21:50:50 2010(r215017)
@@ -2715,6 +2715,24 @@ re_init_locked(struct rl_softc *sc)
 */
re_set_rxmode(sc);
 
+   /* Configure interrupt moderation. */
+   if (sc-rl_type == RL_8169) {
+   switch (sc-rl_hwrev) {
+   case RL_HWREV_8100E:
+   case RL_HWREV_8101E:
+   case RL_HWREV_8102E:
+   case RL_HWREV_8102EL:
+   case RL_HWREV_8102EL_SPIN1:
+   case RL_HWREV_8103E:
+   CSR_WRITE_2(sc, RL_INTRMOD, 0);
+   break;
+   default:
+   /* Magic from vendor. */
+   CSR_WRITE_2(sc, RL_INTRMOD, 0x5151);
+   break;
+   }
+   }
+
 #ifdef DEVICE_POLLING
/*
 * Disable interrupts if we are polling.

Modified: head/sys/pci/if_rlreg.h
==
--- head/sys/pci/if_rlreg.h Mon Nov  8 21:50:45 2010(r215016)
+++ head/sys/pci/if_rlreg.h Mon Nov  8 21:50:50 2010(r215017)
@@ -125,6 +125,7 @@
 /*
  * Registers specific to the 8169 gigE chip
  */
+#define RL_GTXSTART0x0038  /* 8 bits */
 #define RL_TIMERINT_8169   0x0058  /* different offset than 8139 */
 #define RL_PHYAR   0x0060
 #define RL_TBICSR  0x0064
@@ -135,7 +136,7 @@
 #define RL_GPIO0x006E  /* 8 bits, 8168C SPIN2 only */
 #define RL_PMCH0x006F  /* 8 bits */
 #define RL_MAXRXPKTLEN 0x00DA  /* 16 bits, chip multiplies by 8 */
-#define RL_GTXSTART0x0038  /* 8 bits */
+#define RL_INTRMOD 0x00E2  /* 16 bits */
 
 /*
  * TX config register bits
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r215018 - head/sys/pci

2010-11-08 Thread Pyun YongHyeon
Author: yongari
Date: Mon Nov  8 22:03:40 2010
New Revision: 215018
URL: http://svn.freebsd.org/changeset/base/215018

Log:
  Consistently use tab character instead of using space character.
  No functional changes.

Modified:
  head/sys/pci/if_rlreg.h

Modified: head/sys/pci/if_rlreg.h
==
--- head/sys/pci/if_rlreg.h Mon Nov  8 21:50:50 2010(r215017)
+++ head/sys/pci/if_rlreg.h Mon Nov  8 22:03:40 2010(r215018)
@@ -36,211 +36,211 @@
  * RealTek 8129/8139 register offsets
  */
 #defineRL_IDR0 0x  /* ID register 0 (station addr) 
*/
-#define RL_IDR10x0001  /* Must use 32-bit accesses (?) 
*/
-#define RL_IDR20x0002
-#define RL_IDR30x0003
-#define RL_IDR40x0004
-#define RL_IDR50x0005
+#defineRL_IDR1 0x0001  /* Must use 32-bit accesses (?) 
*/
+#defineRL_IDR2 0x0002
+#defineRL_IDR3 0x0003
+#defineRL_IDR4 0x0004
+#defineRL_IDR5 0x0005
/* 0006-0007 reserved */
-#define RL_MAR00x0008  /* Multicast hash table */
-#define RL_MAR10x0009
-#define RL_MAR20x000A
-#define RL_MAR30x000B
-#define RL_MAR40x000C
-#define RL_MAR50x000D
-#define RL_MAR60x000E
-#define RL_MAR70x000F
-
-#define RL_TXSTAT0 0x0010  /* status of TX descriptor 0 */
-#define RL_TXSTAT1 0x0014  /* status of TX descriptor 1 */
-#define RL_TXSTAT2 0x0018  /* status of TX descriptor 2 */
-#define RL_TXSTAT3 0x001C  /* status of TX descriptor 3 */
-
-#define RL_TXADDR0 0x0020  /* address of TX descriptor 0 */
-#define RL_TXADDR1 0x0024  /* address of TX descriptor 1 */
-#define RL_TXADDR2 0x0028  /* address of TX descriptor 2 */
-#define RL_TXADDR3 0x002C  /* address of TX descriptor 3 */
-
-#define RL_RXADDR  0x0030  /* RX ring start address */
-#define RL_RX_EARLY_BYTES  0x0034  /* RX early byte count */
-#define RL_RX_EARLY_STAT   0x0036  /* RX early status */
-#define RL_COMMAND 0x0037  /* command register */
-#define RL_CURRXADDR   0x0038  /* current address of packet read */
-#define RL_CURRXBUF0x003A  /* current RX buffer address */
-#define RL_IMR 0x003C  /* interrupt mask register */
-#define RL_ISR 0x003E  /* interrupt status register */
-#define RL_TXCFG   0x0040  /* transmit config */
-#define RL_RXCFG   0x0044  /* receive config */
-#define RL_TIMERCNT0x0048  /* timer count register */
-#define RL_MISSEDPKT   0x004C  /* missed packet counter */
-#define RL_EECMD   0x0050  /* EEPROM command register */
-#define RL_CFG00x0051  /* config register #0 */
-#define RL_CFG10x0052  /* config register #1 */
+#defineRL_MAR0 0x0008  /* Multicast hash table */
+#defineRL_MAR1 0x0009
+#defineRL_MAR2 0x000A
+#defineRL_MAR3 0x000B
+#defineRL_MAR4 0x000C
+#defineRL_MAR5 0x000D
+#defineRL_MAR6 0x000E
+#defineRL_MAR7 0x000F
+
+#defineRL_TXSTAT0  0x0010  /* status of TX descriptor 0 */
+#defineRL_TXSTAT1  0x0014  /* status of TX descriptor 1 */
+#defineRL_TXSTAT2  0x0018  /* status of TX descriptor 2 */
+#defineRL_TXSTAT3  0x001C  /* status of TX descriptor 3 */
+
+#defineRL_TXADDR0  0x0020  /* address of TX descriptor 0 */
+#defineRL_TXADDR1  0x0024  /* address of TX descriptor 1 */
+#defineRL_TXADDR2  0x0028  /* address of TX descriptor 2 */
+#defineRL_TXADDR3  0x002C  /* address of TX descriptor 3 */
+
+#defineRL_RXADDR   0x0030  /* RX ring start address */
+#defineRL_RX_EARLY_BYTES   0x0034  /* RX early byte count */
+#defineRL_RX_EARLY_STAT0x0036  /* RX early status */
+#defineRL_COMMAND  0x0037  /* command register */
+#defineRL_CURRXADDR0x0038  /* current address of packet 
read */
+#defineRL_CURRXBUF 0x003A  /* current RX buffer address */
+#defineRL_IMR  0x003C  /* interrupt mask register */
+#defineRL_ISR  0x003E  /* interrupt status register */
+#defineRL_TXCFG0x0040  /* transmit config */
+#defineRL_RXCFG0x0044  /* receive config */
+#defineRL_TIMERCNT 0x0048  /* timer count register */

svn commit: r215020 - head/sys/pci

2010-11-08 Thread Pyun YongHyeon
Author: yongari
Date: Mon Nov  8 22:10:51 2010
New Revision: 215020
URL: http://svn.freebsd.org/changeset/base/215020

Log:
  Remove standard PCI configuration space register definitions.

Modified:
  head/sys/pci/if_rlreg.h

Modified: head/sys/pci/if_rlreg.h
==
--- head/sys/pci/if_rlreg.h Mon Nov  8 22:05:11 2010(r215019)
+++ head/sys/pci/if_rlreg.h Mon Nov  8 22:10:51 2010(r215020)
@@ -1113,38 +1113,3 @@ struct rl_softc {
 /* US Robotics 997902 device ID */
 
 #defineUSR_DEVICEID_997902 0x0116
-
-/*
- * PCI low memory base and low I/O base register, and
- * other PCI registers.
- */
-
-#defineRL_PCI_VENDOR_ID0x00
-#defineRL_PCI_DEVICE_ID0x02
-#defineRL_PCI_COMMAND  0x04
-#defineRL_PCI_STATUS   0x06
-#defineRL_PCI_CLASSCODE0x09
-#defineRL_PCI_LATENCY_TIMER0x0D
-#defineRL_PCI_HEADER_TYPE  0x0E
-#defineRL_PCI_LOIO 0x10
-#defineRL_PCI_LOMEM0x14
-#defineRL_PCI_BIOSROM  0x30
-#defineRL_PCI_INTLINE  0x3C
-#defineRL_PCI_INTPIN   0x3D
-#defineRL_PCI_MINGNT   0x3E
-#defineRL_PCI_MINLAT   0x0F
-#defineRL_PCI_RESETOPT 0x48
-#defineRL_PCI_EEPROM_DATA  0x4C
-
-#defineRL_PCI_CAPID0x50 /* 8 bits */
-#defineRL_PCI_NEXTPTR  0x51 /* 8 bits */
-#defineRL_PCI_PWRMGMTCAP   0x52 /* 16 bits */
-#defineRL_PCI_PWRMGMTCTRL  0x54 /* 16 bits */
-
-#defineRL_PSTATE_MASK  0x0003
-#defineRL_PSTATE_D00x
-#defineRL_PSTATE_D10x0002
-#defineRL_PSTATE_D20x0002
-#defineRL_PSTATE_D30x0003
-#defineRL_PME_EN   0x0010
-#defineRL_PME_STATUS   0x8000
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r215021 - head/sys/kern

2010-11-08 Thread Juli Mallett
Author: jmallett
Date: Mon Nov  8 22:12:25 2010
New Revision: 215021
URL: http://svn.freebsd.org/changeset/base/215021

Log:
  Use macros rather than inline functions to lock and unlock mutexes, so that
  line number information is preserved in witness.
  
  Reviewed by:  jhb

Modified:
  head/sys/kern/subr_taskqueue.c

Modified: head/sys/kern/subr_taskqueue.c
==
--- head/sys/kern/subr_taskqueue.c  Mon Nov  8 22:10:51 2010
(r215020)
+++ head/sys/kern/subr_taskqueue.c  Mon Nov  8 22:12:25 2010
(r215021)
@@ -68,23 +68,21 @@ struct taskqueue {
 #defineTQ_FLAGS_BLOCKED(1  1)
 #defineTQ_FLAGS_PENDING(1  2)
 
-static __inline void
-TQ_LOCK(struct taskqueue *tq)
-{
-   if (tq-tq_spin)
-   mtx_lock_spin(tq-tq_mutex);
-   else
-   mtx_lock(tq-tq_mutex);
-}
-
-static __inline void
-TQ_UNLOCK(struct taskqueue *tq)
-{
-   if (tq-tq_spin)
-   mtx_unlock_spin(tq-tq_mutex);
-   else
-   mtx_unlock(tq-tq_mutex);
-}
+#defineTQ_LOCK(tq) 
\
+   do {\
+   if ((tq)-tq_spin)  \
+   mtx_lock_spin((tq)-tq_mutex); \
+   else\
+   mtx_lock((tq)-tq_mutex);  \
+   } while (0)
+
+#defineTQ_UNLOCK(tq)   
\
+   do {\
+   if ((tq)-tq_spin)  \
+   mtx_unlock_spin((tq)-tq_mutex);   \
+   else\
+   mtx_unlock((tq)-tq_mutex);\
+   } while (0)
 
 static __inline int
 TQ_SLEEP(struct taskqueue *tq, void *p, struct mtx *m, int pri, const char *wm,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r215022 - in head: bin/test tools/regression/bin tools/regression/bin/test

2010-11-08 Thread Jilles Tjoelker
Author: jilles
Date: Mon Nov  8 23:15:10 2010
New Revision: 215022
URL: http://svn.freebsd.org/changeset/base/215022

Log:
  test: Move tests to tools/regression/bin/test.
  Convert the tests to the perl prove format.
  Remove obsolete TEST.README (results of an old TEST.sh for some old Unices)
  and TEST.csh (old tests without correct values, far less complete than
  TEST.sh).
  
  MFC after:1 week

Added:
  head/tools/regression/bin/test/
  head/tools/regression/bin/test/Makefile   (contents, props changed)
  head/tools/regression/bin/test/regress.sh
 - copied, changed from r214813, head/bin/test/TEST.sh
  head/tools/regression/bin/test/regress.t   (contents, props changed)
Deleted:
  head/bin/test/TEST.README
  head/bin/test/TEST.csh
  head/bin/test/TEST.sh
Modified:
  head/tools/regression/bin/Makefile

Modified: head/tools/regression/bin/Makefile
==
--- head/tools/regression/bin/Makefile  Mon Nov  8 22:12:25 2010
(r215021)
+++ head/tools/regression/bin/Makefile  Mon Nov  8 23:15:10 2010
(r215022)
@@ -1,5 +1,5 @@
 # $FreeBSD$
 
-SUBDIR=date mv pax sh
+SUBDIR=date mv pax sh test
 
 .include bsd.subdir.mk

Added: head/tools/regression/bin/test/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/test/Makefile Mon Nov  8 23:15:10 2010
(r215022)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+all:
+   sh regress.sh

Copied and modified: head/tools/regression/bin/test/regress.sh (from r214813, 
head/bin/test/TEST.sh)
==
--- head/bin/test/TEST.sh   Thu Nov  4 22:05:50 2010(r214813, copy 
source)
+++ head/tools/regression/bin/test/regress.sh   Mon Nov  8 23:15:10 2010
(r215022)
@@ -30,44 +30,29 @@
 #
 # $FreeBSD$
 
-# force a specified test program, e.g. `env test=/bin/test sh TEST.sh'
+# force a specified test program, e.g. `env test=/bin/test sh regress.sh'
 : ${test=test} 
 
-ERROR=0 FAILED=0
-
 t ()
 {
# $1 - exit code
# $2 - $test expression
 
-   echo -n $1: $test $2 
-
+   count=$((count+1))
# check for syntax errors
syntax=`eval $test $2 21`
-   if test -z $syntax; then
-
-   case $1 in
-   0) if eval $test $2; then echo  OK; else failed;fi;;
-   1) if eval $test $2; then failed; else echo  OK;fi;;
-   esac
-
+   ret=$?
+   if test -n $syntax; then
+   printf not ok %s - (syntax error)\n $count $2
+   elif [ $ret != $1 ]; then
+   printf not ok %s - (got $ret, expected $1)\n $count $2
else
-   error
+   printf ok %s\n $count $2
fi
 }
 
-error () 
-{
-   echo ; echo  $syntax
-   ERROR=`expr $ERROR + 1`
-}
-
-failed () 
-{
-   echo ; echo  failed
-   FAILED=`expr $FAILED + 1`
-}
-
+count=0
+echo 1..94
 
 t 0 'b = b' 
 t 1 'b != b' 
@@ -172,6 +157,3 @@ t 1 '-z y -o y = # -o y = x'
 t 0 '0 -ne 0 -o ! -f /'
 t 0 '1 -ne 0 -o ! -f /etc/passwd'
 t 1 '0 -ne 0 -o ! -f /etc/passwd'
-
-echo 
-echo Syntax errors: $ERROR Failed: $FAILED

Added: head/tools/regression/bin/test/regress.t
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/test/regress.tMon Nov  8 23:15:10 2010
(r215022)
@@ -0,0 +1,6 @@
+#!/bin/sh
+# $FreeBSD$
+
+cd `dirname $0`
+
+sh regress.sh
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r214982 - head/sys/compat/linprocfs

2010-11-08 Thread Alexander Best
On Mon Nov  8 10, Dag-Erling Smorgrav wrote:
 Author: des
 Date: Mon Nov  8 12:04:41 2010
 New Revision: 214982
 URL: http://svn.freebsd.org/changeset/base/214982
 
 Log:
   Fix CPU ID in /proc/cpuinfo.

thanks a lot. maybe it would also be a good idea to find out where class and
cpu are being defined and completely remove chose varaibles. i think the
CPUID_* macros are being used in most places in the src tree (boot messages
e.g.). plus there's no point really to have variables around which are being
set to wrong values.

   
   PR: kern/56451
   Submitted by:   arundel@
   MFC after:  3 weeks
 
 Modified:
   head/sys/compat/linprocfs/linprocfs.c
 
 Modified: head/sys/compat/linprocfs/linprocfs.c
 ==
 --- head/sys/compat/linprocfs/linprocfs.c Mon Nov  8 11:22:55 2010
 (r214981)
 +++ head/sys/compat/linprocfs/linprocfs.c Mon Nov  8 12:04:41 2010
 (r214982)
 @@ -276,11 +276,11 @@ linprocfs_docpuinfo(PFS_FILL_ARGS)
   sbuf_printf(sb,
   processor\t: %d\n
   vendor_id\t: %.20s\n
 - cpu family\t: %d\n
 - model\t\t: %d\n
 + cpu family\t: %u\n
 + model\t\t: %u\n
   model name\t: %s\n
 - stepping\t: %d\n\n,
 - i, cpu_vendor, class, cpu, model, cpu_id  0xf);
 + stepping\t: %u\n\n,
 + i, cpu_vendor, CPUID_TO_FAMILY(cpu_id), 
 CPUID_TO_MODEL(cpu_id), model, cpu_id  CPUID_STEPPING);
   /* XXX per-cpu vendor / class / model / id? */
   }
  

-- 
a13x
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r214964 - head/usr.bin/yacc

2010-11-08 Thread Alexander Best
On Sun Nov  7 10, David E. O'Brien wrote:
 Author: obrien
 Date: Sun Nov  7 23:44:40 2010
 New Revision: 214964
 URL: http://svn.freebsd.org/changeset/base/214964
 
 Log:
   Add '-y' for bison compatibility.
   
   Obtained from:  http://invisible-island.net

could you take a look at PR 140309? it's a simple one line fix to prevent yacc
from segfaulting in certain cases.

cheers.
alex

 
 Modified:
   head/usr.bin/yacc/main.c
   head/usr.bin/yacc/yacc.1
 
 Modified: head/usr.bin/yacc/main.c
 ==
 --- head/usr.bin/yacc/main.c  Sun Nov  7 23:34:05 2010(r214963)
 +++ head/usr.bin/yacc/main.c  Sun Nov  7 23:44:40 2010(r214964)
 @@ -166,7 +166,7 @@ getargs(int argc, char *argv[])
  {
  int ch;
  
 -while ((ch = getopt(argc, argv, b:dlo:p:rtv)) != -1)
 +while ((ch = getopt(argc, argv, b:dlo:p:rtvy)) != -1)
  {
   switch (ch)
   {
 @@ -202,6 +202,10 @@ getargs(int argc, char *argv[])
   vflag = 1;
   break;
  
 + case 'y':
 + /* for bison compatibility -- byacc is already POSIX compatible */
 + break;
 +
   default:
   usage();
   }
 
 Modified: head/usr.bin/yacc/yacc.1
 ==
 --- head/usr.bin/yacc/yacc.1  Sun Nov  7 23:34:05 2010(r214963)
 +++ head/usr.bin/yacc/yacc.1  Sun Nov  7 23:44:40 2010(r214964)
 @@ -44,7 +44,7 @@
  .Nd an LALR(1) parser generator
  .Sh SYNOPSIS
  .Nm
 -.Op Fl dlrtv
 +.Op Fl dlrtvy
  .Op Fl b Ar file_prefix
  .Op Fl o Ar output_filename
  .Op Fl p Ar symbol_prefix
 @@ -118,6 +118,10 @@ so that debugging statements will be inc
  Cause a human-readable description of the generated parser to
  be written to the file
  .Pa y.output .
 +.It Fl y
 +NOOP for bison compatibility.
 +.Nm
 +is already designed to be POSIX yacc compatible.
  .El
  .Sh ENVIRONMENT
  .Bl -tag -width .Ev TMPDIR

-- 
a13x
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r214964 - head/usr.bin/yacc

2010-11-08 Thread Alexander Best
On Tue Nov  9 10, Alexander Best wrote:
 On Sun Nov  7 10, David E. O'Brien wrote:
  Author: obrien
  Date: Sun Nov  7 23:44:40 2010
  New Revision: 214964
  URL: http://svn.freebsd.org/changeset/base/214964
  
  Log:
Add '-y' for bison compatibility.

Obtained from:http://invisible-island.net
 
 could you take a look at PR 140309? it's a simple one line fix to prevent yacc
 from segfaulting in certain cases.

fixing PR 23254 also doesn't seem too complicated.

cheers.
alex

 
 cheers.
 alex
 
  
  Modified:
head/usr.bin/yacc/main.c
head/usr.bin/yacc/yacc.1
  
  Modified: head/usr.bin/yacc/main.c
  ==
  --- head/usr.bin/yacc/main.cSun Nov  7 23:34:05 2010
  (r214963)
  +++ head/usr.bin/yacc/main.cSun Nov  7 23:44:40 2010
  (r214964)
  @@ -166,7 +166,7 @@ getargs(int argc, char *argv[])
   {
   int ch;
   
  -while ((ch = getopt(argc, argv, b:dlo:p:rtv)) != -1)
  +while ((ch = getopt(argc, argv, b:dlo:p:rtvy)) != -1)
   {
  switch (ch)
  {
  @@ -202,6 +202,10 @@ getargs(int argc, char *argv[])
  vflag = 1;
  break;
   
  +   case 'y':
  +   /* for bison compatibility -- byacc is already POSIX compatible */
  +   break;
  +
  default:
  usage();
  }
  
  Modified: head/usr.bin/yacc/yacc.1
  ==
  --- head/usr.bin/yacc/yacc.1Sun Nov  7 23:34:05 2010
  (r214963)
  +++ head/usr.bin/yacc/yacc.1Sun Nov  7 23:44:40 2010
  (r214964)
  @@ -44,7 +44,7 @@
   .Nd an LALR(1) parser generator
   .Sh SYNOPSIS
   .Nm
  -.Op Fl dlrtv
  +.Op Fl dlrtvy
   .Op Fl b Ar file_prefix
   .Op Fl o Ar output_filename
   .Op Fl p Ar symbol_prefix
  @@ -118,6 +118,10 @@ so that debugging statements will be inc
   Cause a human-readable description of the generated parser to
   be written to the file
   .Pa y.output .
  +.It Fl y
  +NOOP for bison compatibility.
  +.Nm
  +is already designed to be POSIX yacc compatible.
   .El
   .Sh ENVIRONMENT
   .Bl -tag -width .Ev TMPDIR
 
 -- 
 a13x

-- 
a13x
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r215024 - in head/sys: amd64/acpica conf i386/acpica x86/acpica

2010-11-08 Thread Jung-uk Kim
Author: jkim
Date: Tue Nov  9 00:27:18 2010
New Revision: 215024
URL: http://svn.freebsd.org/changeset/base/215024

Log:
  Now OsdEnvironment.c is identical on amd64 and i386.  Move it to a new home.

Added:
  head/sys/x86/acpica/OsdEnvironment.c
 - copied unchanged from r215023, head/sys/amd64/acpica/OsdEnvironment.c
Deleted:
  head/sys/amd64/acpica/OsdEnvironment.c
  head/sys/i386/acpica/OsdEnvironment.c
Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Tue Nov  9 00:14:39 2010(r215023)
+++ head/sys/conf/files.amd64   Tue Nov  9 00:27:18 2010(r215024)
@@ -67,7 +67,6 @@ hptrr_lib.o   optionalhptrr   
\
compile-withuudecode  $S/dev/hptrr/amd64-elf.hptrr_lib.o.uu \
no-implicit-rule
 #
-amd64/acpica/OsdEnvironment.c  optionalacpi
 amd64/acpica/acpi_machdep.coptionalacpi
 amd64/acpica/acpi_switch.S optionalacpi
 acpi_wakecode.ooptionalacpi
\
@@ -300,6 +299,7 @@ contrib/x86emu/x86emu.c optional x86bio
 #
 # x86 shared code between IA32, AMD64 and PC98 architectures
 #
+x86/acpica/OsdEnvironment.coptionalacpi
 x86/acpica/madt.c  optionalacpi
 x86/acpica/srat.c  optionalacpi
 x86/bios/smbios.c  optionalsmbios

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Tue Nov  9 00:14:39 2010(r215023)
+++ head/sys/conf/files.i386Tue Nov  9 00:27:18 2010(r215024)
@@ -238,7 +238,6 @@ dev/uart/uart_cpu_i386.coptional uart
 dev/acpica/acpi_if.m   standard
 dev/acpi_support/acpi_wmi_if.m standard
 dev/wpi/if_wpi.c   optional wpi
-i386/acpica/OsdEnvironment.c   optional acpi
 i386/acpica/acpi_machdep.c optional acpi
 i386/acpica/acpi_wakeup.c  optional acpi
 acpi_wakecode.hoptional acpi   \
@@ -373,6 +372,7 @@ compat/x86bios/x86bios.coptional x86bio
 #
 # x86 shared code between IA32, AMD64 and PC98 architectures
 #
+x86/acpica/OsdEnvironment.coptional acpi
 x86/acpica/madt.c  optional acpi apic
 x86/acpica/srat.c  optional acpi
 x86/bios/smbios.c  optional smbios

Copied: head/sys/x86/acpica/OsdEnvironment.c (from r215023, 
head/sys/amd64/acpica/OsdEnvironment.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/x86/acpica/OsdEnvironment.cTue Nov  9 00:27:18 2010
(r215024, copy of r215023, head/sys/amd64/acpica/OsdEnvironment.c)
@@ -0,0 +1,91 @@
+/*-
+ * Copyright (c) 2000,2001 Michael Smith
+ * Copyright (c) 2000 BSDi
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include sys/types.h
+#include sys/bus.h
+#include sys/linker_set.h
+#include sys/sysctl.h
+
+#include contrib/dev/acpica/include/acpi.h
+#include contrib/dev/acpica/include/actables.h
+
+static u_long acpi_root_phys;
+
+SYSCTL_ULONG(_machdep, OID_AUTO, acpi_root, CTLFLAG_RD, acpi_root_phys, 0,
+The physical address of the RSDP);
+
+ACPI_STATUS
+AcpiOsInitialize(void)
+{
+
+   return (AE_OK);
+}
+
+ACPI_STATUS
+AcpiOsTerminate(void)
+{
+
+   return (AE_OK);
+}
+
+static u_long
+acpi_get_root_from_loader(void)
+{
+   long acpi_root;
+
+   if (resource_long_value(acpi, 0, rsdp, 

svn commit: r215023 - in head/sys: amd64/acpica i386/acpica ia64/acpica

2010-11-08 Thread Jung-uk Kim
Author: jkim
Date: Tue Nov  9 00:14:39 2010
New Revision: 215023
URL: http://svn.freebsd.org/changeset/base/215023

Log:
  Reduce diff between platforms and fix style(9) bugs.

Modified:
  head/sys/amd64/acpica/OsdEnvironment.c
  head/sys/i386/acpica/OsdEnvironment.c
  head/sys/ia64/acpica/OsdEnvironment.c

Modified: head/sys/amd64/acpica/OsdEnvironment.c
==
--- head/sys/amd64/acpica/OsdEnvironment.c  Mon Nov  8 23:15:10 2010
(r215022)
+++ head/sys/amd64/acpica/OsdEnvironment.c  Tue Nov  9 00:14:39 2010
(r215023)
@@ -28,9 +28,6 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
-/*
- * 6.1 : Environmental support
- */
 #include sys/types.h
 #include sys/bus.h
 #include sys/linker_set.h
@@ -39,33 +36,56 @@ __FBSDID($FreeBSD$);
 #include contrib/dev/acpica/include/acpi.h
 #include contrib/dev/acpica/include/actables.h
 
-static u_long amd64_acpi_root;
+static u_long acpi_root_phys;
 
-SYSCTL_ULONG(_machdep, OID_AUTO, acpi_root, CTLFLAG_RD, amd64_acpi_root, 0,
-The physical address of the RSDP);
+SYSCTL_ULONG(_machdep, OID_AUTO, acpi_root, CTLFLAG_RD, acpi_root_phys, 0,
+The physical address of the RSDP);
 
 ACPI_STATUS
 AcpiOsInitialize(void)
 {
-   return(0);
+
+   return (AE_OK);
 }
 
 ACPI_STATUS
 AcpiOsTerminate(void)
 {
-   return(0);
+
+   return (AE_OK);
+}
+
+static u_long
+acpi_get_root_from_loader(void)
+{
+   long acpi_root;
+
+   if (resource_long_value(acpi, 0, rsdp, acpi_root) == 0)
+   return (acpi_root);
+
+   return (0);
+}
+
+static u_long
+acpi_get_root_from_memory(void)
+{
+   ACPI_SIZE acpi_root;
+
+   if (ACPI_SUCCESS(AcpiFindRootPointer(acpi_root)))
+   return (acpi_root);
+
+   return (0);
 }
 
 ACPI_PHYSICAL_ADDRESS
 AcpiOsGetRootPointer(void)
 {
-   u_long  ptr;
 
-   if (amd64_acpi_root == 0 
-   (resource_long_value(acpi, 0, rsdp, (long *)ptr) == 0 ||
-   AcpiFindRootPointer((ACPI_SIZE *)ptr) == AE_OK) 
-   ptr != 0)
-   amd64_acpi_root = ptr;
+   if (acpi_root_phys == 0) {
+   acpi_root_phys = acpi_get_root_from_loader();
+   if (acpi_root_phys == 0)
+   acpi_root_phys = acpi_get_root_from_memory();
+   }
 
-   return (amd64_acpi_root);
+   return (acpi_root_phys);
 }

Modified: head/sys/i386/acpica/OsdEnvironment.c
==
--- head/sys/i386/acpica/OsdEnvironment.c   Mon Nov  8 23:15:10 2010
(r215022)
+++ head/sys/i386/acpica/OsdEnvironment.c   Tue Nov  9 00:14:39 2010
(r215023)
@@ -28,9 +28,6 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
-/*
- * 6.1 : Environmental support
- */
 #include sys/types.h
 #include sys/bus.h
 #include sys/linker_set.h
@@ -39,33 +36,56 @@ __FBSDID($FreeBSD$);
 #include contrib/dev/acpica/include/acpi.h
 #include contrib/dev/acpica/include/actables.h
 
-static u_long i386_acpi_root;
+static u_long acpi_root_phys;
 
-SYSCTL_ULONG(_machdep, OID_AUTO, acpi_root, CTLFLAG_RD, i386_acpi_root, 0,
-The physical address of the RSDP);
+SYSCTL_ULONG(_machdep, OID_AUTO, acpi_root, CTLFLAG_RD, acpi_root_phys, 0,
+The physical address of the RSDP);
 
 ACPI_STATUS
 AcpiOsInitialize(void)
 {
-   return(0);
+
+   return (AE_OK);
 }
 
 ACPI_STATUS
 AcpiOsTerminate(void)
 {
-   return(0);
+
+   return (AE_OK);
+}
+
+static u_long
+acpi_get_root_from_loader(void)
+{
+   long acpi_root;
+
+   if (resource_long_value(acpi, 0, rsdp, acpi_root) == 0)
+   return (acpi_root);
+
+   return (0);
+}
+
+static u_long
+acpi_get_root_from_memory(void)
+{
+   ACPI_SIZE acpi_root;
+
+   if (ACPI_SUCCESS(AcpiFindRootPointer(acpi_root)))
+   return (acpi_root);
+
+   return (0);
 }
 
 ACPI_PHYSICAL_ADDRESS
 AcpiOsGetRootPointer(void)
 {
-   u_long  ptr;
 
-   if (i386_acpi_root == 0 
-   (resource_long_value(acpi, 0, rsdp, (long *)ptr) == 0 ||
-   AcpiFindRootPointer((ACPI_SIZE *)ptr) == AE_OK) 
-   ptr != 0)
-   i386_acpi_root = ptr;
+   if (acpi_root_phys == 0) {
+   acpi_root_phys = acpi_get_root_from_loader();
+   if (acpi_root_phys == 0)
+   acpi_root_phys = acpi_get_root_from_memory();
+   }
 
-   return (i386_acpi_root);
+   return (acpi_root_phys);
 }

Modified: head/sys/ia64/acpica/OsdEnvironment.c
==
--- head/sys/ia64/acpica/OsdEnvironment.c   Mon Nov  8 23:15:10 2010
(r215022)
+++ head/sys/ia64/acpica/OsdEnvironment.c   Tue Nov  9 00:14:39 2010
(r215023)
@@ -35,8 +35,6 @@ __FBSDID($FreeBSD$);
 
 #include contrib/dev/acpica/include/acpi.h
 
-static struct uuid acpi_root_uuid = EFI_TABLE_ACPI20;
-
 static u_long acpi_root_phys;

svn commit: r215025 - head/sys/dev/re

2010-11-08 Thread Pyun YongHyeon
Author: yongari
Date: Tue Nov  9 01:52:09 2010
New Revision: 215025
URL: http://svn.freebsd.org/changeset/base/215025

Log:
  Only moderate TX completion interrupts. Relying on taskqueue to
  suppress RX interrupts seems to give better RX performance than
  RX interrupt moderation.

Modified:
  head/sys/dev/re/if_re.c

Modified: head/sys/dev/re/if_re.c
==
--- head/sys/dev/re/if_re.c Tue Nov  9 00:27:18 2010(r215024)
+++ head/sys/dev/re/if_re.c Tue Nov  9 01:52:09 2010(r215025)
@@ -2728,7 +2728,7 @@ re_init_locked(struct rl_softc *sc)
break;
default:
/* Magic from vendor. */
-   CSR_WRITE_2(sc, RL_INTRMOD, 0x5151);
+   CSR_WRITE_2(sc, RL_INTRMOD, 0x5100);
break;
}
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r215027 - head/usr.bin/yacc

2010-11-08 Thread David E. O'Brien
Author: obrien
Date: Tue Nov  9 02:51:38 2010
New Revision: 215027
URL: http://svn.freebsd.org/changeset/base/215027

Log:
  Fix the build on 64-bit hosts.  WARNS=6 fails on them.

Modified:
  head/usr.bin/yacc/reader.c

Modified: head/usr.bin/yacc/reader.c
==
--- head/usr.bin/yacc/reader.c  Tue Nov  9 01:57:56 2010(r215026)
+++ head/usr.bin/yacc/reader.c  Tue Nov  9 02:51:38 2010(r215027)
@@ -719,7 +719,7 @@ get_literal(void)
++cptr;
}
}
-   if (n  UCHAR_MAX) illegal_character(c_cptr);
+   if (n  (int)UCHAR_MAX) illegal_character(c_cptr);
c = n;
break;
 
@@ -735,7 +735,7 @@ get_literal(void)
if (i  0 || i = 16) break;
++cptr;
n = (n  4) + i;
-   if (n  UCHAR_MAX) illegal_character(c_cptr);
+   if (n  (int)UCHAR_MAX) illegal_character(c_cptr);
}
c = n;
break;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org