Subject: cardbus code without busy wait
To: None <tech-kern@netbsd.org>
From: Hayakawa Koichi <haya@arch.sony.co.jp>
List: tech-kern
Date: 01/19/2000 17:44:09
Hi,
I made a patch to remove most busy wait loops on CardBus-PCI
bridge codes under kernel thread context. This patch
affects not only CardBus cards, but also 16-bit PCcards.
This code is not beautiful, because in interrupt context we
must use busy wait. Unfortunately, PCcard probe routine may
be called in interrupt context.
Comments?
--
begin 644 usetsleep.diff.gz
M'XL("/8\A3@" W1S;&5E<"YD:69F .T<:U/;2/*S\RL&KC9G@\!ZX1<A5V#(
M'A46*'"RNW5[I1+2&*MB2SY)AB1[W&^_[GE((ULR!I(EV5I7@6UIIJ??T]W3
M\G'HTX\]DGQ*FCZ]:7IN[%_-$OF^[;W8>_KKQ47_D@R#,>V1IG>3Q%&4-F'!
M)/::E>MJ-R]BFL8!O0G":Q+#6Q)$(3&VC?8+/Q@.R99'MF+\N@3WC8V-ZKLU
M4]?UIFXT#8L8>L]L]RRCQN!O;6VM,JU+=+MG6CV[A0NI+[:P;6AVB["O"!"_
MM@E\VGI!R-^"T!O/?$I>X3H3=SR.O.W1ZX4['V@<TG'9'?@;1]=X9W/NSC26
ML J3)JXW"D+:1"+XW3*D6QVM;7.DV?S+P?[@N$]NHL G@@5NF@(HXCCG]7J2
MQC,O)<"HP*-D0R,+%]C,C49C%X U-R2\($PEN&F,7Q@T/E8C7A0F<'_DQFPF
MV6B^6%.G.!P%![\6\)#WDVB8>G)5QH4A6?/I$.C'"0<79V^/3IWCT\/CBZ/^
MP.F?G;XY_C&G5EEJXJ;WT>H-?3=UB[2BP%M=K;TC!?Z]LU+CDZ(PI1_3Y^-K
MF<IVNEIW1ZILDKIIX!4HC*GK.^EL.J9)*86" VY\G<!B *,&+P(O,2"FUTZJ
MD9D#0#M.RC ,/E-'LF%-+LK0I*%[-:;.<!9Z*3JL^WC*_G%(*A@_2!X&)Y,)
MT[VNKG5;4O>^3YY\><:4*8_5-35;[TCUN>-#FQM =FH,I2*Y1*O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