most of my driver codes just don't compile well for the first time. other than a few typo's there are a lot of other things which i keep coding upside down. so i decided to kind of put it clean on the paper, so that in the future i dont end up with the same errors. i am sure i will....
the usual trouble i hit up is on semaphore...
the down() goes this way....
1) disable interrupts
2) load semaphore count into register
3) decrement register value (remember if it goes negative)
4) store register value to semaphore count location
5) enable interrupts
6) if the count went negative go to sleep
The up() goes like this:
1) disable interrupts
2) load semaphore count into register
3) increment register value (remember if it remains < 1)
4) store register value to semaphore count location
5) enable interrupts
6) if the sem count is still < 1 then wake up someone
i hope not to hit the same error in the near future....
buggy drivers!!
About this entry
Youre currently reading buggy drivers!!.
- Published:
- at 12:22 PM on Sunday, December 18, 2005
- Previous:
- Older Post
- Next:
- Newer Post
0 comments: