Re: ad0: FAILURE - WRITE_DMA

2004-10-10 Thread Mikhail P.
On Saturday 09 October 2004 17:01, Mikhail P. wrote:
 I also got another message off-list, where author suggested to play with
 UDMA values. I switched from UDMA100 to UDMA66. System's uptime is 12
 hours, and no timeouts so far.. but I'm quite sure they will get back in
 few days.

1.5 days of uptime, running in UDMA66 changes nothing. Still getting

ad0: FAILURE - READ_DMA status=51READY,DSC,ERROR error=10NID_NOT_FOUND 
LBA=268435455
ad0: FAILURE - READ_DMA status=51READY,DSC,ERROR error=10NID_NOT_FOUND 
LBA=268435455

regards,
M.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: Bit field definition ?

2004-10-10 Thread Li, Qing

 
 In the last episode (Oct 08), Li, Qing said:
  The bit fields th_x2 and th_off in struct tcphdr,
  even though defined as u_int, actually occupies 1 byte.
 
 u_int   th_x2:4,/* (unused) */
 th_off:4;   /* data offset */
 
 The :4 after each variable means 4 bits long, so both fields 
 together take up 8 bits = 1 byte.  That's the whole purpose 
 of bitfields :)
 

D'oh

I didn't ask the right question.

It seems u_int specifies the packing and alignment size
for the bit fields, is that correct ?

struct {
  u_int a:4,   
b:4;
};   is 4 bytes in size.

struct {
 u_int a:4,
   b:4;
 short c;
  };   is 4 bytes in size.

  struct {
 u_int a:4,
   b:4;
 short c;
 u_char d;
  };   is 8 bytes in size;

  But

  struct {
 u_int a:4,
   b:4;
 u_char d;
 short c;
  };   is 4 bytes in size;


-- Qing



___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Bit field definition ?

2004-10-10 Thread Dan Nelson
In the last episode (Oct 10), Li, Qing said:
  In the last episode (Oct 08), Li, Qing said:
 The bit fields th_x2 and th_off in struct tcphdr, even
 though defined as u_int, actually occupies 1 byte.
  
  u_int   th_x2:4,/* (unused) */
  th_off:4;   /* data offset */
  
  The :4 after each variable means 4 bits long, so both fields
  together take up 8 bits = 1 byte.  That's the whole purpose of
  bitfields :)
   
   D'oh
 
   I didn't ask the right question.
 
   It seems u_int specifies the packing and alignment size
   for the bit fields, is that correct ?

I don't think so.  C99 only allows bitfields to be of type Bool, signed
_int, or unsigned int, so that seems to prevent the use of
char/short/int/long to dictate padding or alignment.  There must be
something in the FreeBSD ABI that says structs must be padded so they
are 4-byte aligned, even if none of the members require it. Try putting
your 4 structs into a program and compiling them with gcc -Wpadding:

   struct {
   u_int a:4,   
 b:4;
   };   is 4 bytes in size.
a.c:7: warning: padding struct size to alignment boundary

   struct {
  u_int a:4,
b:4;
  short c;
   };   is 4 bytes in size.
a.c:13: warning: padding struct to align 'c'
(1 byte of padding added just before c)

   struct {
  u_int a:4,
b:4;
  short c;
  u_char d;
   };   is 8 bytes in size;
a.c:19: warning: padding struct to align 'c' 
(1 byte padding just before c, and 3 bytes just after d).  I think it
should have printed a padding struct size to alignment boundary
warning also, since if it didn't, the padding after d would have been 1
byte, and struct would have been 6 bytes total.
 
   But
 
   struct {
  u_int a:4,
b:4;
  u_char d;
  short c;
   };   is 4 bytes in size;
 
a.c:21: warning: padding struct size to alignment boundary

This last warning I don't understand, since 1+1+2 is 4 all by itself. 
No padding is needed or used.

-- 
Dan Nelson
[EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]