|
|
Subscribe / Log in / New account

hd disk driver

hd disk driver

Posted May 8, 2017 13:08 UTC (Mon) by BenHutchings (subscriber, #37955)
In reply to: hd disk driver by fratti
Parent article: 4.12 Merge window part 1

  • Gets high-precision timestamp by reading the i8253 directly and assuming CONFIG_HZ == 100
  • Non-configurable I/O port addresses
  • Does (nearly) everything in hard interrupt handlers


to post comments

hd disk driver

Posted May 8, 2017 15:05 UTC (Mon) by excors (subscriber, #95769) [Link]

And there's the nice "for (i = 0; i < 1000; i++) barrier();" (an optimisation of Linux 0.01's "for(i = 0; i < 1000; i++) nop();" - the barrier version saves the cost of the explicit nop instruction). Back in 1991 I guess that would have delayed for a couple of hundred microseconds, nowadays it's a couple of hundred nanoseconds. I hope the hardware has very tolerant timing constraints.

Seems a good idea to be deleting this kind of obsolete code, in case people writing new drivers happen to look at it and don't realise it's obsolete and pick up bad habits. (I suspect I've written some bad code myself for that reason.)

hd disk driver

Posted May 8, 2017 15:17 UTC (Mon) by nix (subscriber, #2304) [Link]

It even uses interrupts rather than function calls. It's sort of like a really twisted continuation-passing style. :)


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds