home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / linux / 20272 < prev    next >
Encoding:
Text File  |  1992-12-14  |  2.1 KB  |  49 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!super!becker
  3. From: becker@super.org (Donald J. Becker)
  4. Subject: Re: .98.5 and .98.6: Infinite loop trying to init SMC Elite16
  5. Message-ID: <1992Dec14.021908.25261@super.org>
  6. Sender: news@super.org (USENET News System)
  7. Nntp-Posting-Host: metropolis
  8. Organization: IDA Supercomputing Research Center
  9. References: <ADAMS.92Dec9001250@PDV2.pdv2.fmr.maschinenbau.th-darmstadt.de> <1992Dec9.031803.13643@super.org> <ADAMS.92Dec9171255@PDV2.pdv2.fmr.maschinenbau.th-darmstadt.de>
  10. Date: Mon, 14 Dec 1992 02:19:08 GMT
  11. Lines: 36
  12.  
  13. In article <ADAMS.92Dec9171255@PDV2.pdv2.fmr.maschinenbau.th-darmstadt.de> adams@pdv2.fmr.maschinenbau.th-darmstadt.de (Adams) writes:
  14. >>>I'd regard the code around we_rcv 
  15. >>>    { struct wd_ring * ring;...; if (ring->status & 1)...}
  16. >>>as at least "a little bit dangerous". 
  17.  
  18. >>   In this case the packet buffer shared memory was written before this
  19. >>   routine (a packet-received interrupt handler) was called, so there is no
  20. >>   possibility of the value changing in memory while you keep a copy in a
  21. >>   register.
  22. >
  23. >..But you have to force the C compiler to reevaluate 
  24. >    (ring->status &1) on each invocation,
  25. >indenpendent of any code around this expression. 
  26. >
  27. >There is a chance the code just succeeds by luck, not by design.
  28.  
  29. But 'ring' is reassigned to a unknown (to the compiler) value each
  30. time it goes through the loop -- the compiler is not allowed to assume
  31. that 'ring->volatile' evaluates to the same value, it wouldn't even if
  32. this were not "shared memory.  In this case, a shared memory
  33. 8390-based ethernet card, the packet buffer you are interested in has
  34. already been written and will not change until you move the 'boundary'
  35. register forward -- which should only happen when you are finished
  36. with that packet.  In other words, 'ring->status' isn't polled to see
  37. if the packet has been written which is the only case where 'volatile'
  38. would be called for.
  39.  
  40. Donald Becker                       becker@super.org
  41. Supercomputing Research Center
  42. 17100 Science Drive, Bowie MD 21114           301-805-7482
  43.  
  44.  
  45. -- 
  46. Donald Becker                       becker@super.org
  47. Supercomputing Research Center
  48. 17100 Science Drive, Bowie MD 21114           301-805-7482
  49.