tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Bug in NetBSD compiler or "bus.h" header file crashes my ISDN4BSD



Hi,

Now it looks correct:

Disassembly of section .text:

00000000 <do_io_000>:
   0:   55                      push   %ebp
   1:   89 e5                   mov    %esp,%ebp
   3:   56                      push   %esi
   4:   53                      push   %ebx
   5:   8b 5d 0c                mov    0xc(%ebp),%ebx
   8:   8b 75 10                mov    0x10(%ebp),%esi
   b:   8b 45 14                mov    0x14(%ebp),%eax
   e:   8a 4d 18                mov    0x18(%ebp),%cl
  11:   8b 55 08                mov    0x8(%ebp),%edx
  14:   85 d2                   test   %edx,%edx
  16:   75 10                   jne    28 <do_io_000+0x28>
  18:   0f b7 d0                movzwl %ax,%edx
  1b:   8d 14 13                lea    (%ebx,%edx,1),%edx
  1e:   0f b6 c9                movzbl %cl,%ecx
  21:   fc                      cld    
  22:   f3 6e                   repz outsb %ds:(%esi),(%dx)
  24:   5b                      pop    %ebx
  25:   5e                      pop    %esi
  26:   c9                      leave  
  27:   c3                      ret    
  28:   0f b6 c9                movzbl %cl,%ecx
  2b:   0f b7 c0                movzwl %ax,%eax
  2e:   01 d8                   add    %ebx,%eax
  30:   89 c2                   mov    %eax,%edx
  32:   fc                      cld    
  33:   ac                      lods   %ds:(%esi),%al
  34:   88 02                   mov    %al,(%edx)
  36:   e2 fb                   loop   33 <do_io_000+0x33>
  38:   5b                      pop    %ebx
  39:   5e                      pop    %esi
  3a:   c9                      leave  
  3b:   c3                      ret    

0000003c <do_io_001>:
  3c:   55                      push   %ebp
  3d:   89 e5                   mov    %esp,%ebp
  3f:   56                      push   %esi
  40:   53                      push   %ebx
  41:   8b 5d 0c                mov    0xc(%ebp),%ebx
  44:   8b 75 10                mov    0x10(%ebp),%esi
  47:   8b 45 14                mov    0x14(%ebp),%eax
  4a:   8b 4d 18                mov    0x18(%ebp),%ecx
  4d:   8b 55 08                mov    0x8(%ebp),%edx
  50:   85 d2                   test   %edx,%edx
  52:   75 14                   jne    68 <do_io_001+0x2c>
  54:   0f b7 d0                movzwl %ax,%edx
  57:   8d 14 13                lea    (%ebx,%edx,1),%edx
  5a:   0f b7 c9                movzwl %cx,%ecx
  5d:   fc                      cld    
  5e:   f3 66 6f                repz outsw %ds:(%esi),(%dx)
  61:   5b                      pop    %ebx
  62:   5e                      pop    %esi
  63:   c9                      leave  
  64:   c3                      ret    
  65:   8d 76 00                lea    0x0(%esi),%esi
  68:   0f b7 c9                movzwl %cx,%ecx
  6b:   0f b7 c0                movzwl %ax,%eax
  6e:   01 d8                   add    %ebx,%eax
  70:   89 c2                   mov    %eax,%edx
  72:   fc                      cld    
  73:   66 ad                   lods   %ds:(%esi),%ax
  75:   66 89 02                mov    %ax,(%edx)
  78:   e2 f9                   loop   73 <do_io_001+0x37>
  7a:   5b                      pop    %ebx
  7b:   5e                      pop    %esi
  7c:   c9                      leave  
  7d:   c3                      ret    
  7e:   89 f6                   mov    %esi,%esi

00000080 <do_io_002>:
  80:   55                      push   %ebp
  81:   89 e5                   mov    %esp,%ebp
  83:   56                      push   %esi
  84:   53                      push   %ebx
  85:   8b 5d 0c                mov    0xc(%ebp),%ebx
  88:   8b 75 10                mov    0x10(%ebp),%esi
  8b:   8b 4d 18                mov    0x18(%ebp),%ecx
  8e:   8b 45 14                mov    0x14(%ebp),%eax
  91:   8b 55 08                mov    0x8(%ebp),%edx
  94:   85 d2                   test   %edx,%edx
  96:   75 10                   jne    a8 <do_io_002+0x28>
  98:   0f b7 d0                movzwl %ax,%edx
  9b:   8d 14 13                lea    (%ebx,%edx,1),%edx
  9e:   fc                      cld    
  9f:   f3 6f                   repz outsl %ds:(%esi),(%dx)
  a1:   5b                      pop    %ebx
  a2:   5e                      pop    %esi
  a3:   c9                      leave  
  a4:   c3                      ret    
  a5:   8d 76 00                lea    0x0(%esi),%esi
  a8:   0f b7 c0                movzwl %ax,%eax
  ab:   01 d8                   add    %ebx,%eax
  ad:   89 c2                   mov    %eax,%edx
  af:   fc                      cld    
  b0:   ad                      lods   %ds:(%esi),%eax
  b1:   89 02                   mov    %eax,(%edx)
  b3:   e2 fb                   loop   b0 <do_io_002+0x30>
  b5:   5b                      pop    %ebx
  b6:   5e                      pop    %esi
  b7:   c9                      leave  
  b8:   c3                      ret    

Will the NetBSD core have this fixed ?

I have some reports that the same problem is true on AMD64.

--HPS

On Wednesday 26 March 2008, Bang Jun-young wrote:
> On Wed, Mar 26, 2008 at 10:40 PM, Bang Jun-young 
> <junyoung%netbsd.org@localhost> 
wrote:
> > On Mon, Mar 24, 2008 at 8:49 PM, Hans Petter Selasky 
> > <hselasky%c2i.net@localhost> 
wrote:
> >  >  // OOOPS! We are looping on %ecx, but only %cl was initialised - why
> >  > ? // Either the "bus_space_" macros on NetBSD 3+4 are wrong or the //
> >  > compiler is wrong!
> >
> >  Didn't you say
> >
> >  >  // this instruction is very important
> >  >   1e:   0f b6 c9                movzbl %cl,%ecx
> >
> >  ?
>
> At the second thought, I got what you meant. Please ignore this
> brain-damaged question. :-)
>
> Upon reading x86/include/bus.h?rev=1.11 from the netbsd-4 branch,
> would it help add
> a cast like the following:
>
> void
> do_io_000(bus_space_tag_t t, bus_space_handle_t h, void *ptr, uint16_t
> offset, uint8_t len)
> {
>        bus_space_write_multi_1(t, h, offset, ptr, (size_t)len);
> }
>
> ?



Home | Main Index | Thread Index | Old Index