svn commit: r205728 - head/lib/libusbhid

2010-03-27 Thread Kai Wang
Author: kaiw
Date: Sat Mar 27 08:00:16 2010
New Revision: 205728
URL: http://svn.freebsd.org/changeset/base/205728

Log:
  Merge improvements from kernel HID parser to the userland usbhid(3)
  parser.  This merge does not change any API and should not break any
  native or thirdparty applications.
  
  Changes include:
  
  * Merge multiple report ID support and other improvements from kernel
HID parser.
  * Ignore rid argument in hid_start_parser, parse all the report items since
we now support multiple report ID.
  * Skip report ID byte in hid_get_data() and set report ID byte in
hid_set_data(), if report ID is non-zero.
  * Reimplement hid_get_report_id: instead get report id from uhid device
(which is always 0), try parsing the report descriptor and return the
first report ID encountered.
  
  Reviewed by:  hps
  Silent on:-usb mailing list

Modified:
  head/lib/libusbhid/data.c
  head/lib/libusbhid/descr.c
  head/lib/libusbhid/parse.c
  head/lib/libusbhid/usage.c
  head/lib/libusbhid/usbhid.h
  head/lib/libusbhid/usbvar.h

Modified: head/lib/libusbhid/data.c
==
--- head/lib/libusbhid/data.c   Sat Mar 27 06:53:11 2010(r205727)
+++ head/lib/libusbhid/data.c   Sat Mar 27 08:00:16 2010(r205728)
@@ -29,6 +29,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 #include "usbhid.h"
@@ -36,18 +37,27 @@ __FBSDID("$FreeBSD$");
 int
 hid_get_data(const void *p, const hid_item_t *h)
 {
-   const unsigned char *buf;
-   unsigned int hpos;
-   unsigned int hsize;
-   int data;
+   const uint8_t *buf;
+   uint32_t hpos;
+   uint32_t hsize;
+   uint32_t data;
int i, end, offs;
 
buf = p;
+
+   /* Skip report ID byte. */
+   if (h->report_ID > 0)
+   buf++;
+
hpos = h->pos;  /* bit position of data */
hsize = h->report_size; /* bit length of data */
 
+   /* Range check and limit */
if (hsize == 0)
return (0);
+   if (hsize > 32)
+   hsize = 32;
+
offs = hpos / 8;
end = (hpos + hsize) / 8 - offs;
data = 0;
@@ -66,12 +76,17 @@ hid_get_data(const void *p, const hid_it
 void
 hid_set_data(void *p, const hid_item_t *h, int data)
 {
-   unsigned char *buf;
-   unsigned int hpos;
-   unsigned int hsize;
+   uint8_t *buf;
+   uint32_t hpos;
+   uint32_t hsize;
int i, end, offs, mask;
 
buf = p;
+
+   /* Set report ID byte. */
+   if (h->report_ID > 0)
+   *buf++ = h->report_ID & 0xff;
+
hpos = h->pos;  /* bit position of data */
hsize = h->report_size; /* bit length of data */
 
@@ -90,5 +105,5 @@ hid_set_data(void *p, const hid_item_t *
 
for (i = 0; i <= end; i++)
buf[offs + i] = (buf[offs + i] & (mask >> (i*8))) |
-   ((data >> (i*8)) & 0xff);
+   ((data >> (i*8)) & 0xff);
 }

Modified: head/lib/libusbhid/descr.c
==
--- head/lib/libusbhid/descr.c  Sat Mar 27 06:53:11 2010(r205727)
+++ head/lib/libusbhid/descr.c  Sat Mar 27 08:00:16 2010(r205728)
@@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-
 #include 
 
 #include "usbhid.h"
@@ -59,9 +58,30 @@ hid_set_immed(int fd, int enable)
 int
 hid_get_report_id(int fd)
 {
+   report_desc_t rep;
+   hid_data_t d;
+   hid_item_t h;
+   int kindset;
int temp = -1;
int ret;
 
+   if ((rep = hid_get_report_desc(fd)) == NULL)
+   goto use_ioctl;
+   kindset = 1 << hid_input | 1 << hid_output | 1 << hid_feature;
+   for (d = hid_start_parse(rep, kindset, 0); hid_get_item(d, &h); ) {
+   /* Return the first report ID we met. */
+   if (h.report_ID != 0) {
+   temp = h.report_ID;
+   break;
+   }
+   }
+   hid_end_parse(d);
+   hid_dispose_report_desc(rep);
+
+   if (temp > 0)
+   return (temp);
+
+use_ioctl:
ret = ioctl(fd, USB_GET_REPORT_ID, &temp);
 #ifdef HID_COMPAT7
if (ret < 0)

Modified: head/lib/libusbhid/parse.c
==
--- head/lib/libusbhid/parse.c  Sat Mar 27 06:53:11 2010(r205727)
+++ head/lib/libusbhid/parse.c  Sat Mar 27 08:00:16 2010(r205728)
@@ -40,42 +40,43 @@ __FBSDID("$FreeBSD$");
 #include "usbhid.h"
 #include "usbvar.h"
 
-#define MAXUSAGE 100
-struct hid_data {
-   u_char *start;
-   u_char *end;
-   u_char *p;
-   hid_item_t cur;
-   unsigned int usages[MAXUSAGE];
-   int nusage;
-   int minset;
-   int logminsize;
-   int multi;
-   int multimax;
-   int kindset;
-   int report

Re: I486_CPU and I586_CPU removed from GENERIC kernel [was Re: svn commit: r205307 - head/sys/i386/conf]

2010-03-27 Thread Bernd Walter
On Fri, Mar 19, 2010 at 05:28:06PM +0100, Ivan Voras wrote:
> On 19 March 2010 17:22, Valentin Nechayev  wrote:
> >  Fri, Mar 19, 2010 at 17:13:00, ivoras wrote about "Re: I486_CPU and 
> > I586_CPU removed from GENERIC kernel [was Re: svn commit: r205307 - 
> > head/sys/i386/conf]":
> >
> >> SSE in the userland you mean? Regardless, I don't think there is now
> >> reason for compiling everything as for i386. E.g. why not add at least
> >> -mtune=generic or even also -march=i686 to default gcc options?
> >>
> >> http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html
> >
> > Having userland compiled with i686 will give the same effect as i686-only
> > kernel: it won't boot on machines which doesn't conform to. If it is
> > supposed to boot on i486 and higher, no more than -march=i486 can be used.
> 
> Yes, this is how I read the change - the move from "i386" to "i686". I
> apologize if I got it wrong :)
> 
> As it was pointed out earlier - small systems users and designers
> probably have special install procedures because of the nature of the
> business.

The assumption is wrong to my knowledge.
I think it is a fact that an old 586 usually can't boot our CDs.
It is also true that many embedded boards don't have CD boot support,
like Soekris systems.
But there are also some miniATX systems build on 586 class CPUs, which
have recent BIOS code and can boot from CD.
It is also quite common for unexeperienced users to binary install the
HDD in a modern system.
This is not business, because many home users run such small systems as
storage servers, gateways, dhcp, ... - there are many unexperienced
users with such systems.

-- 
B.Walter  http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.
___
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: r205729 - in head/contrib/bsnmp: gensnmpdef snmpd

2010-03-27 Thread Antoine Brodin
Author: antoine
Date: Sat Mar 27 13:43:18 2010
New Revision: 205729
URL: http://svn.freebsd.org/changeset/base/205729

Log:
  (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.
  Fix some wrong usages.
  Note: this does not affect generated binaries as this argument is not used.
  
  Approved by:  harti@

Modified:
  head/contrib/bsnmp/gensnmpdef/gensnmpdef.c
  head/contrib/bsnmp/snmpd/config.c

Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c
==
--- head/contrib/bsnmp/gensnmpdef/gensnmpdef.c  Sat Mar 27 08:00:16 2010
(r205728)
+++ head/contrib/bsnmp/gensnmpdef/gensnmpdef.c  Sat Mar 27 13:43:18 2010
(r205729)
@@ -59,7 +59,7 @@ struct tdef {
SLIST_ENTRY(tdef) link;
 };
 
-static SLIST_HEAD(, tdef) tdefs = SLIST_HEAD_INITIALIZER(tdef);
+static SLIST_HEAD(, tdef) tdefs = SLIST_HEAD_INITIALIZER(tdefs);
 static int do_typedef = 0;
 
 static void print_node(SmiNode *n, u_int level);

Modified: head/contrib/bsnmp/snmpd/config.c
==
--- head/contrib/bsnmp/snmpd/config.c   Sat Mar 27 08:00:16 2010
(r205728)
+++ head/contrib/bsnmp/snmpd/config.c   Sat Mar 27 13:43:18 2010
(r205729)
@@ -134,7 +134,7 @@ struct macro {
LIST_ENTRY(macro) link;
int perm;
 };
-static LIST_HEAD(, macro) macros = LIST_HEAD_INITIALIZER(¯os);
+static LIST_HEAD(, macro) macros = LIST_HEAD_INITIALIZER(macros);
 
 enum {
TOK_EOF = 0200,
___
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: r205734 - head/sys/dev/sound/pcm

2010-03-27 Thread Alexander Motin
Author: mav
Date: Sat Mar 27 15:39:19 2010
New Revision: 205734
URL: http://svn.freebsd.org/changeset/base/205734

Log:
  Fix lock leakage.
  
  PR:   kern/145081

Modified:
  head/sys/dev/sound/pcm/dsp.c

Modified: head/sys/dev/sound/pcm/dsp.c
==
--- head/sys/dev/sound/pcm/dsp.cSat Mar 27 15:05:06 2010
(r205733)
+++ head/sys/dev/sound/pcm/dsp.cSat Mar 27 15:39:19 2010
(r205734)
@@ -1071,6 +1071,7 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd
if (IOCGROUP(cmd) == 'M') {
if (cmd == OSS_GETVERSION) {
*arg_i = SOUND_VERSION;
+   PCM_GIANT_EXIT(d);
return (0);
}
ret = dsp_ioctl_channel(i_dev, PCM_VOLCH(i_dev), cmd, arg);
___
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: r205738 - head/sbin/hastd

2010-03-27 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Mar 27 16:35:07 2010
New Revision: 205738
URL: http://svn.freebsd.org/changeset/base/205738

Log:
  Don't hold connection lock when doing reconnects as it makes I/Os wait for
  connection timeouts.
  
  Reported by:  Kevin Day 

Modified:
  head/sbin/hastd/primary.c

Modified: head/sbin/hastd/primary.c
==
--- head/sbin/hastd/primary.c   Sat Mar 27 16:31:49 2010(r205737)
+++ head/sbin/hastd/primary.c   Sat Mar 27 16:35:07 2010(r205738)
@@ -460,9 +460,11 @@ init_local(struct hast_resource *res)
exit(EX_NOINPUT);
 }
 
-static void
-init_remote(struct hast_resource *res)
+static bool
+init_remote(struct hast_resource *res, struct proto_conn **inp,
+struct proto_conn **outp)
 {
+   struct proto_conn *in, *out;
struct nv *nvout, *nvin;
const unsigned char *token;
unsigned char *map;
@@ -472,13 +474,17 @@ init_remote(struct hast_resource *res)
uint32_t mapsize;
size_t size;
 
+   assert((inp == NULL && outp == NULL) || (inp != NULL && outp != NULL));
+
+   in = out = NULL;
+
/* Prepare outgoing connection with remote node. */
-   if (proto_client(res->hr_remoteaddr, &res->hr_remoteout) < 0) {
+   if (proto_client(res->hr_remoteaddr, &out) < 0) {
primary_exit(EX_OSERR, "Unable to create connection to %s",
res->hr_remoteaddr);
}
/* Try to connect, but accept failure. */
-   if (proto_connect(res->hr_remoteout) < 0) {
+   if (proto_connect(out) < 0) {
pjdlog_errno(LOG_WARNING, "Unable to connect to %s",
res->hr_remoteaddr);
goto close;
@@ -496,7 +502,7 @@ init_remote(struct hast_resource *res)
nv_free(nvout);
goto close;
}
-   if (hast_proto_send(res, res->hr_remoteout, nvout, NULL, 0) < 0) {
+   if (hast_proto_send(res, out, nvout, NULL, 0) < 0) {
pjdlog_errno(LOG_WARNING,
"Unable to send handshake header to %s",
res->hr_remoteaddr);
@@ -504,7 +510,7 @@ init_remote(struct hast_resource *res)
goto close;
}
nv_free(nvout);
-   if (hast_proto_recv_hdr(res->hr_remoteout, &nvin) < 0) {
+   if (hast_proto_recv_hdr(out, &nvin) < 0) {
pjdlog_errno(LOG_WARNING,
"Unable to receive handshake header from %s",
res->hr_remoteaddr);
@@ -536,12 +542,12 @@ init_remote(struct hast_resource *res)
 * Second handshake step.
 * Setup incoming connection with remote node.
 */
-   if (proto_client(res->hr_remoteaddr, &res->hr_remotein) < 0) {
+   if (proto_client(res->hr_remoteaddr, &in) < 0) {
pjdlog_errno(LOG_WARNING, "Unable to create connection to %s",
res->hr_remoteaddr);
}
/* Try to connect, but accept failure. */
-   if (proto_connect(res->hr_remotein) < 0) {
+   if (proto_connect(in) < 0) {
pjdlog_errno(LOG_WARNING, "Unable to connect to %s",
res->hr_remoteaddr);
goto close;
@@ -560,7 +566,7 @@ init_remote(struct hast_resource *res)
nv_free(nvout);
goto close;
}
-   if (hast_proto_send(res, res->hr_remotein, nvout, NULL, 0) < 0) {
+   if (hast_proto_send(res, in, nvout, NULL, 0) < 0) {
pjdlog_errno(LOG_WARNING,
"Unable to send handshake header to %s",
res->hr_remoteaddr);
@@ -568,7 +574,7 @@ init_remote(struct hast_resource *res)
goto close;
}
nv_free(nvout);
-   if (hast_proto_recv_hdr(res->hr_remoteout, &nvin) < 0) {
+   if (hast_proto_recv_hdr(out, &nvin) < 0) {
pjdlog_errno(LOG_WARNING,
"Unable to receive handshake header from %s",
res->hr_remoteaddr);
@@ -611,7 +617,7 @@ init_remote(struct hast_resource *res)
 * Remote node have some dirty extents on its own, lets
 * download its activemap.
 */
-   if (hast_proto_recv_data(res, res->hr_remoteout, nvin, map,
+   if (hast_proto_recv_data(res, out, nvin, map,
mapsize) < 0) {
pjdlog_errno(LOG_ERR,
"Unable to receive remote activemap");
@@ -631,18 +637,29 @@ init_remote(struct hast_resource *res)
(void)hast_activemap_flush(res);
}
pjdlog_info("Connected to %s.", res->hr_remoteaddr);
+   if (inp != NULL && outp != NULL) {
+   *inp = in;
+   *outp = out;
+   } else {
+   res->hr_remotein = in;
+   res->hr_remoteout = out;
+   }
+   return (true);
+close:
+   proto_close(out);
+   if (in != NULL)
+ 

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

2010-03-27 Thread Alan Cox
Author: alc
Date: Sat Mar 27 18:24:27 2010
New Revision: 205773
URL: http://svn.freebsd.org/changeset/base/205773

Log:
  Simplify pmap_growkernel(), making the i386 version more like the amd64
  version.
  
  MFC after:3 weeks

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

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Sat Mar 27 18:15:18 2010(r205772)
+++ head/sys/i386/i386/pmap.c   Sat Mar 27 18:24:27 2010(r205773)
@@ -207,8 +207,8 @@ vm_offset_t virtual_end;/* VA of last a
 int pgeflag = 0;   /* PG_G or-in */
 int pseflag = 0;   /* PG_PS or-in */
 
-static int nkpt;
-vm_offset_t kernel_vm_end;
+static int nkpt = NKPT;
+vm_offset_t kernel_vm_end = KERNBASE + NKPT * NBPDR;
 extern u_int32_t KERNend;
 extern u_int32_t KPTphys;
 
@@ -395,7 +395,6 @@ pmap_bootstrap(vm_paddr_t firstaddr)
mtx_lock_spin(&allpmaps_lock);
LIST_INSERT_HEAD(&allpmaps, kernel_pmap, pm_list);
mtx_unlock_spin(&allpmaps_lock);
-   nkpt = NKPT;
 
/*
 * Reserve some special page table entries/VA space for temporary
@@ -2032,24 +2031,12 @@ pmap_growkernel(vm_offset_t addr)
pd_entry_t newpdir;
 
mtx_assert(&kernel_map->system_mtx, MA_OWNED);
-   if (kernel_vm_end == 0) {
-   kernel_vm_end = KERNBASE;
-   nkpt = 0;
-   while (pdir_pde(PTD, kernel_vm_end)) {
-   kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & 
~(PAGE_SIZE * NPTEPG - 1);
-   nkpt++;
-   if (kernel_vm_end - 1 >= kernel_map->max_offset) {
-   kernel_vm_end = kernel_map->max_offset;
-   break;
-   }
-   }
-   }
-   addr = roundup2(addr, PAGE_SIZE * NPTEPG);
+   addr = roundup2(addr, NBPDR);
if (addr - 1 >= kernel_map->max_offset)
addr = kernel_map->max_offset;
while (kernel_vm_end < addr) {
if (pdir_pde(PTD, kernel_vm_end)) {
-   kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & 
~(PAGE_SIZE * NPTEPG - 1);
+   kernel_vm_end = (kernel_vm_end + NBPDR) & ~PDRMASK;
if (kernel_vm_end - 1 >= kernel_map->max_offset) {
kernel_vm_end = kernel_map->max_offset;
break;
@@ -2072,7 +2059,7 @@ pmap_growkernel(vm_offset_t addr)
pdir_pde(KPTD, kernel_vm_end) = pgeflag | newpdir;
 
pmap_kenter_pde(kernel_vm_end, newpdir);
-   kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & 
~(PAGE_SIZE * NPTEPG - 1);
+   kernel_vm_end = (kernel_vm_end + NBPDR) & ~PDRMASK;
if (kernel_vm_end - 1 >= kernel_map->max_offset) {
kernel_vm_end = kernel_map->max_offset;
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: r205778 - in head/sys: amd64/amd64 i386/i386

2010-03-27 Thread Alan Cox
Author: alc
Date: Sat Mar 27 23:53:47 2010
New Revision: 205778
URL: http://svn.freebsd.org/changeset/base/205778

Log:
  Correctly handle preemption of pmap_update_pde_invalidate().
  
  X-MFC after:  r205573

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/i386/i386/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Sat Mar 27 20:25:50 2010(r205777)
+++ head/sys/amd64/amd64/pmap.c Sat Mar 27 23:53:47 2010(r205778)
@@ -880,9 +880,12 @@ pmap_update_pde_invalidate(vm_offset_t v
load_cr4(cr4 & ~CR4_PGE);
/*
 * Although preemption at this point could be detrimental to
-* performance, it would not lead to an error.
+* performance, it would not lead to an error.  PG_G is simply
+* ignored if CR4.PGE is clear.  Moreover, in case this block
+* is re-entered, the load_cr4() either above or below will
+* modify CR4.PGE flushing the TLB.
 */
-   load_cr4(cr4);
+   load_cr4(cr4 | CR4_PGE);
}
 }
 #ifdef SMP

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Sat Mar 27 20:25:50 2010(r205777)
+++ head/sys/i386/i386/pmap.c   Sat Mar 27 23:53:47 2010(r205778)
@@ -917,9 +917,12 @@ pmap_update_pde_invalidate(vm_offset_t v
load_cr4(cr4 & ~CR4_PGE);
/*
 * Although preemption at this point could be detrimental to
-* performance, it would not lead to an error.
+* performance, it would not lead to an error.  PG_G is simply
+* ignored if CR4.PGE is clear.  Moreover, in case this block
+* is re-entered, the load_cr4() either above or below will
+* modify CR4.PGE flushing the TLB.
 */
-   load_cr4(cr4);
+   load_cr4(cr4 | CR4_PGE);
}
 }
 #ifdef SMP
___
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: r205781 - head/sys/dev/bktr

2010-03-27 Thread Justin T. Gibbs
Author: gibbs
Date: Sun Mar 28 00:10:09 2010
New Revision: 205781
URL: http://svn.freebsd.org/changeset/base/205781

Log:
  Use standard types in preference to BSD types so that these header files
  can be used in applications compiled with only POSIX types visible.
  
  MFC after: 2 weeks

Modified:
  head/sys/dev/bktr/ioctl_bt848.h
  head/sys/dev/bktr/ioctl_meteor.h

Modified: head/sys/dev/bktr/ioctl_bt848.h
==
--- head/sys/dev/bktr/ioctl_bt848.h Sat Mar 27 23:58:53 2010
(r205780)
+++ head/sys/dev/bktr/ioctl_bt848.h Sun Mar 28 00:10:09 2010
(r205781)
@@ -89,9 +89,9 @@
  * EEProm stuff
  */
 struct eeProm {
-   short   offset;
-   short   count;
-   u_char  bytes[ 256 ];
+   short   offset;
+   short   count;
+   unsigned char   bytes[ 256 ];
 };
 
 
@@ -147,7 +147,7 @@ struct eeProm {
  * b23-b16:  i2c addr (write)
  * b31-b24:  1 = write, 0 = read 
  */
-#define BT848_I2CWR _IOWR('x', 57, u_long)/* i2c read-write */
+#define BT848_I2CWR _IOWR('x', 57, unsigned long)/* i2c read-write */
 
 struct bktr_msp_control {
unsigned char function;
@@ -192,10 +192,10 @@ typedef enum { METEOR_PIXTYPE_RGB, METEO
 
 
 struct meteor_pixfmt {
-   u_int  index; /* Index in supported pixfmt list */
+   unsigned int   index; /* Index in supported pixfmt list */
METEOR_PIXTYPE type;  /* What's the board gonna feed us */
-   u_int  Bpp;   /* Bytes per pixel*/
-   u_long masks[3];  /* R,G,B or Y,U,V masks, respectively */
+   unsigned int   Bpp;   /* Bytes per pixel*/
+   unsigned long  masks[3];  /* R,G,B or Y,U,V masks, respectively */
unsigned   swap_bytes :1; /* Bytes  swapped within shorts   */
unsigned   swap_shorts:1; /* Shorts swapped within longs*/
 };

Modified: head/sys/dev/bktr/ioctl_meteor.h
==
--- head/sys/dev/bktr/ioctl_meteor.hSat Mar 27 23:58:53 2010
(r205780)
+++ head/sys/dev/bktr/ioctl_meteor.hSun Mar 28 00:10:09 2010
(r205781)
@@ -50,27 +50,27 @@ struct meteor_capframe {
 
 /* structure for METEOR[GS]ETGEO - get/set geometry  */
 struct meteor_geomet {
-   u_short rows;
-   u_short columns;
-   u_short frames;
-   u_long  oformat;
+   unsigned short  rows;
+   unsigned short  columns;
+   unsigned short  frames;
+   unsigned long   oformat;
 } ;
 
 /* structure for METEORGCOUNT-get count of frames, fifo errors and dma errors 
*/
 struct meteor_counts {
-   u_long fifo_errors; /* count of fifo errors since open */
-   u_long dma_errors;  /* count of dma errors since open */
-   u_long frames_captured; /* count of frames captured since open */
-   u_long even_fields_captured; /* count of even fields captured */
-   u_long odd_fields_captured; /* count of odd fields captured */
+   unsigned long fifo_errors;  /* count of fifo errors since open */
+   unsigned long dma_errors;   /* count of dma errors since open */
+   unsigned long frames_captured;  /* count of frames captured since open 
*/
+   unsigned long even_fields_captured; /* count of even fields captured */
+   unsigned long odd_fields_captured; /* count of odd fields captured */
 } ;
 
 /* structure for getting and setting direct transfers to vram */
 struct meteor_video {
-   u_long  addr;   /* Address of location to dma to */
-   u_long  width;  /* Width of memory area */
-   u_long  banksize;   /* Size of Vram bank */
-   u_long  ramsize;/* Size of Vram */
+   unsigned long   addr;   /* Address of location to dma to */
+   unsigned long   width;  /* Width of memory area */
+   unsigned long   banksize;   /* Size of Vram bank */
+   unsigned long   ramsize;/* Size of Vram */
 };
 
 #define METEORCAPTUR _IOW('x', 1, int)  /* capture a frame */
___
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: r205789 - head/sys/netipsec

2010-03-27 Thread Bjoern A. Zeeb
Author: bz
Date: Sun Mar 28 06:51:50 2010
New Revision: 205789
URL: http://svn.freebsd.org/changeset/base/205789

Log:
  When tearing down IPsec as part of a (virtual) network stack,
  do not try to free the same list twice but free both the
  acquiring list and the security policy acquiring list.
  
  Reviewed by:  anchie
  MFC after:3 days

Modified:
  head/sys/netipsec/key.c

Modified: head/sys/netipsec/key.c
==
--- head/sys/netipsec/key.c Sun Mar 28 03:00:18 2010(r205788)
+++ head/sys/netipsec/key.c Sun Mar 28 06:51:50 2010(r205789)
@@ -7779,7 +7779,8 @@ void
 key_destroy(void)
 {
struct secpolicy *sp, *nextsp;
-   struct secspacq *acq, *nextacq;
+   struct secacq *acq, *nextacq;
+   struct secspacq *spacq, *nextspacq;
struct secashead *sah, *nextsah;
struct secreg *reg;
int i;
@@ -7820,7 +7821,7 @@ key_destroy(void)
REGTREE_UNLOCK();
 
ACQ_LOCK();
-   for (acq = LIST_FIRST(&V_spacqtree); acq != NULL; acq = nextacq) {
+   for (acq = LIST_FIRST(&V_acqtree); acq != NULL; acq = nextacq) {
nextacq = LIST_NEXT(acq, chain);
if (__LIST_CHAINED(acq)) {
LIST_REMOVE(acq, chain);
@@ -7830,11 +7831,12 @@ key_destroy(void)
ACQ_UNLOCK();
 
SPACQ_LOCK();
-   for (acq = LIST_FIRST(&V_spacqtree); acq != NULL; acq = nextacq) {
-   nextacq = LIST_NEXT(acq, chain);
-   if (__LIST_CHAINED(acq)) {
-   LIST_REMOVE(acq, chain);
-   free(acq, M_IPSEC_SAQ);
+   for (spacq = LIST_FIRST(&V_spacqtree); spacq != NULL;
+   spacq = nextspacq) {
+   nextspacq = LIST_NEXT(spacq, chain);
+   if (__LIST_CHAINED(spacq)) {
+   LIST_REMOVE(spacq, chain);
+   free(spacq, M_IPSEC_SAQ);
}
}
SPACQ_UNLOCK();
___
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"