📄 ucosman.ps
字号:
0 cf cs readline pop { ic exch get exec add } forall pop } bind def/wh { /len exch def /pos exch def ws 0 len getinterval im pos len getinterval copy pop pos len } bind def/bl { /len exch def /pos exch def bs 0 len getinterval im pos len getinterval copy pop pos len } bind def/s1 1 string def/fl { /len exch def /pos exch def /val cf s1 readhexstring pop 0 get def pos 1 pos len add 1 sub {im exch val put} for pos len } bind def/hx { 3 copy getinterval cf exch readhexstring pop pop } bind def /h FMLOCAL /w FMLOCAL /d FMLOCAL /lb FMLOCAL /bitmapsave FMLOCAL /is FMLOCAL /cf FMLOCAL/wbytes { dup 8 eq {pop} {1 eq {7 add 8 idiv} {3 add 4 idiv} ifelse} ifelse } bind def/BEGINBITMAPBWc { 1 {} COMMONBITMAPc } bind def/BEGINBITMAPGRAYc { 8 {} COMMONBITMAPc } bind def/BEGINBITMAP2BITc { 2 {} COMMONBITMAPc } bind def/COMMONBITMAPc { /r exch def /d exch def gsave translate rotate scale /h exch def /w exch def /lb w d wbytes def sl lb lt {lb ms} if /bitmapsave save def r /is im 0 lb getinterval def ws 0 lb getinterval is copy pop /cf currentfile def w h d [w 0 0 h neg 0 h] {ip} image bitmapsave restore grestore } bind def/BEGINBITMAPBW { 1 {} COMMONBITMAP } bind def/BEGINBITMAPGRAY { 8 {} COMMONBITMAP } bind def/BEGINBITMAP2BIT { 2 {} COMMONBITMAP } bind def/COMMONBITMAP { /r exch def /d exch def gsave translate rotate scale /h exch def /w exch def /bitmapsave save def r /is w d wbytes string def /cf currentfile def w h d [w 0 0 h neg 0 h] {cf is readhexstring pop} image bitmapsave restore grestore } bind def /proc1 FMLOCAL /proc2 FMLOCAL /newproc FMLOCAL/Fmcc { /proc2 exch cvlit def /proc1 exch cvlit def /newproc proc1 length proc2 length add array def newproc 0 proc1 putinterval newproc proc1 length proc2 putinterval newproc cvx} bind def/ngrayt 256 array def/nredt 256 array def/nbluet 256 array def/ngreent 256 array def /gryt FMLOCAL /blut FMLOCAL /grnt FMLOCAL /redt FMLOCAL /indx FMLOCAL /cynu FMLOCAL /magu FMLOCAL /yelu FMLOCAL /k FMLOCAL /u FMLOCAL/colorsetup { currentcolortransfer /gryt exch def /blut exch def /grnt exch def /redt exch def 0 1 255 { /indx exch def /cynu 1 red indx get 255 div sub def /magu 1 green indx get 255 div sub def /yelu 1 blue indx get 255 div sub def /k cynu magu min yelu min def /u k currentundercolorremoval exec def nredt indx 1 0 cynu u sub max sub redt exec put ngreent indx 1 0 magu u sub max sub grnt exec put nbluet indx 1 0 yelu u sub max sub blut exec put ngrayt indx 1 k currentblackgeneration exec sub gryt exec put } for {255 mul cvi nredt exch get} {255 mul cvi ngreent exch get} {255 mul cvi nbluet exch get} {255 mul cvi ngrayt exch get} setcolortransfer {pop 0} setundercolorremoval {} setblackgeneration } bind def /tran FMLOCAL/fakecolorsetup { /tran 256 string def 0 1 255 {/indx exch def tran indx red indx get 77 mul green indx get 151 mul blue indx get 28 mul add add 256 idiv put} for currenttransfer {255 mul cvi tran exch get 255.0 div} exch Fmcc settransfer} bind def/BITMAPCOLOR { /d 8 def gsave translate rotate scale /h exch def /w exch def /bitmapsave save def colorsetup /is w d wbytes string def /cf currentfile def w h d [w 0 0 h neg 0 h] {cf is readhexstring pop} {is} {is} true 3 colorimage bitmapsave restore grestore } bind def/BITMAPCOLORc { /d 8 def gsave translate rotate scale /h exch def /w exch def /lb w d wbytes def sl lb lt {lb ms} if /bitmapsave save def colorsetup /is im 0 lb getinterval def ws 0 lb getinterval is copy pop /cf currentfile def w h d [w 0 0 h neg 0 h] {ip} {is} {is} true 3 colorimage bitmapsave restore grestore } bind def/BITMAPTRUECOLORc { gsave translate rotate scale /h exch def /w exch def /bitmapsave save def /is w string def ws 0 w getinterval is copy pop /cf currentfile def w h 8 [w 0 0 h neg 0 h] {ip} {gip} {bip} true 3 colorimage bitmapsave restore grestore } bind def/BITMAPTRUECOLOR { gsave translate rotate scale /h exch def /w exch def /bitmapsave save def /is w string def /gis w string def /bis w string def /cf currentfile def w h 8 [w 0 0 h neg 0 h] { cf is readhexstring pop } { cf gis readhexstring pop } { cf bis readhexstring pop } true 3 colorimage bitmapsave restore grestore } bind def/BITMAPTRUEGRAYc { gsave translate rotate scale /h exch def /w exch def /bitmapsave save def /is w string def ws 0 w getinterval is copy pop /cf currentfile def w h 8 [w 0 0 h neg 0 h] {ip gip bip w gray} image bitmapsave restore grestore } bind def/ww FMLOCAL/r FMLOCAL/g FMLOCAL/b FMLOCAL/i FMLOCAL/gray { /ww exch def /b exch def /g exch def /r exch def 0 1 ww 1 sub { /i exch def r i get .299 mul g i get .587 mul b i get .114 mul add add r i 3 -1 roll floor cvi put } for r } bind def/BITMAPTRUEGRAY { gsave translate rotate scale /h exch def /w exch def /bitmapsave save def /is w string def /gis w string def /bis w string def /cf currentfile def w h 8 [w 0 0 h neg 0 h] { cf is readhexstring pop cf gis readhexstring pop cf bis readhexstring pop w gray} image bitmapsave restore grestore } bind def/BITMAPGRAY { 8 {fakecolorsetup} COMMONBITMAP } bind def/BITMAPGRAYc { 8 {fakecolorsetup} COMMONBITMAPc } bind def/ENDBITMAP { } bind defend /ALDsave FMLOCAL /ALDmatrix matrix def ALDmatrix currentmatrix pop/StartALD { /ALDsave save def savematrix ALDmatrix setmatrix } bind def/InALD { restorematrix } bind def/DoneALD { ALDsave restore } bind def%%EndProlog%%BeginSetup(3.0) FMVERSION1 1 612 792 0 1 11 FMDOCUMENT0 0 /Times-Roman FMFONTDEFINE1 1 /Symbol FMFONTDEFINE2 0 /Times-Bold FMFONTDEFINE3 0 /Courier FMFONTDEFINE4 0 /Times-Italic FMFONTDEFINE32 FMFILLS0 0 FMFILL1 0.1 FMFILL2 0.3 FMFILL3 0.5 FMFILL4 0.7 FMFILL5 0.9 FMFILL6 0.97 FMFILL7 1 FMFILL8 <0f1e3c78f0e1c387> FMFILL9 <0f87c3e1f0783c1e> FMFILL10 <cccccccccccccccc> FMFILL11 <ffff0000ffff0000> FMFILL12 <8142241818244281> FMFILL13 <03060c183060c081> FMFILL14 <8040201008040201> FMFILL16 1 FMFILL17 0.9 FMFILL18 0.7 FMFILL19 0.5 FMFILL20 0.3 FMFILL21 0.1 FMFILL22 0.03 FMFILL23 0 FMFILL24 <f0e1c3870f1e3c78> FMFILL25 <f0783c1e0f87c3e1> FMFILL26 <3333333333333333> FMFILL27 <0000ffff0000ffff> FMFILL28 <7ebddbe7e7dbbd7e> FMFILL29 <fcf9f3e7cf9f3f7e> FMFILL30 <7fbfdfeff7fbfdfe> FMFILL%%EndSetup%%Page: "1" 1%%BeginPaperSize: Letter%%EndPaperSize612 792 0 FMBEGINPAGE0 10 Q0 X0 K(OSInit\050\051) 108 749.33 T1 F(m) 282.5 749.33 T0 F(C/OS System Calls) 288.26 749.33 T(OSInit\050\051) 506.67 749.33 T108 54 540 54 2 L1 H2 ZN(VLSI T) 108 41.28 T(echnology Inc.) 138.13 41.28 T(July 1, 1993) 299.42 41.28 T(1) 535 41.28 T108 738 540 738 2 LN2 18 Q(OSInit) 108 708 T0 14 Q(Initialize) 135 674.67 T1 F(m) 188.27 674.67 T0 F(C/OS internal data structures.) 196.33 674.67 T3 11 Q(#include \322ucos.h\323;) 135 646.67 T(void OSInit\050void\051;) 135 616.67 T2 12 Q(DESCRIPTION) 108 586.33 T3 11 Q-0.18 (OSInit\050\051) 135 565 P0 12 Q-0.08 ( initializes the internal data structures of) 187.8 565 P1 F-0.08 ( m) 379.94 565 P0 F-0.08 (C/OS and resets the PID board.) 389.77 565 P-0.52 (Upon entering,) 135 545 P3 11 Q-1.14 (OSInit\050\051) 208.95 545 P0 12 Q-0.52 ( uses) 261.75 545 P3 11 Q-1.14 (PIDInit\050\051) 287.38 545 P0 12 Q-0.52 ( to initialize the PID interrupt controller) 346.78 545 P-0.52 (,) 534.52 545 P(and the 16C551 serial communication controller) 135 531 T(.) 366.65 531 T3 11 Q(PIDInit\050\051) 372.65 531 T0 12 Q( installs also new) 432.05 531 T-0.38 (exeption handlers for IRQ interrupt requests, FIQ fast interrupt requests and for SWI) 135 517 P-0.1 (software interrupts. These exeption handlers allow for user) 135 503 P-0.1 (-de\336ned interrupt service) 416.66 503 P(routines to be installed at subsequent times. No speci\336c interrupt service routine is) 135 489 T(installed by) 135 475 T3 11 Q(OSInit\050\051) 193.67 475 T0 12 Q(.) 246.47 475 T-0.04 (After initializing the PID board,) 135 455 P3 11 Q-0.08 (OSInit\050\051) 291.46 455 P0 12 Q-0.04 ( switches the ARM processor into super-) 344.26 455 P(visor mode SVC32 and disables interrupts. Interrupts remain disabled until the) 135 441 T1 F(m) 515.64 441 T0 F(C/) 522.55 441 T-0.13 (OS scheduler is activated with a call to) 135 427 P3 11 Q-0.28 (OSStart\050\051) 323.95 427 P0 12 Q-0.13 (. Finally) 383.35 427 P-0.13 (, the idle task at the low-) 422.45 427 P(est priority OS_LO_PRIO is created.) 135 413 T2 F(NOTES) 108 384.33 T3 11 Q-0.89 (OSInit\050\051) 135 363 P0 12 Q-0.41 ( must be called prior to calling any other) 187.8 363 P1 F-0.41 (m) 381.79 363 P0 F-0.41 (C/OS system call. After calling) 388.7 363 P3 11 Q-0.06 (OSInit\050\051) 135 349 P0 12 Q-0.03 ( the ARM CPU is in SVC32 mode. The) 187.8 349 P1 F-0.03 (m) 380.9 349 P0 F-0.03 (C/OS kernel requires the ARM) 387.82 349 P(CPU to remain in this or other priviliged mode while using its services.) 135 335 T(The) 135 315 T1 F(m) 156.66 315 T0 F(C/OS kernel assumes that the ARM CPU has been initialized by some other) 163.57 315 T(startup code, such us the PID ROM-resident monitor demon, in the appropriate 32) 135 301 T-0.14 (bit mode, with the MMU enabled and a page table initialized. It is also assumed that) 135 287 P(stacks for each mode are allocated and that the stack pointer registers are initialized.) 135 273 T-0.44 (The PID demon is deactivated byt he) 135 253 P1 F-0.44 (m) 312.88 253 P0 F-0.44 (C/OS kernel and the PID board has to be reset) 319.79 253 P(to use it again.) 135 239 T2 F(SEE ALSO) 108 210.33 T3 11 Q(OSStart\050\051, IRQInstall\050\051, FIQInstall\050\051, SWIInstall\050\051.) 135 189.67 TFMENDPAGE%%EndPage: "1" 2%%Page: "2" 2612 792 0 FMBEGINPAGE0 10 Q0 X0 K(OSStart\050\051) 108 749.33 T1 F(m) 282.5 749.33 T0 F(C/OS System Calls) 288.26 749.33 T(OSStart\050\051) 501.67 749.33 T108 54 540 54 2 L1 H2 ZN(VLSI T) 108 41.28 T(echnology Inc.) 138.13 41.28 T(July 1, 1993) 299.42 41.28 T(2) 535 41.28 T108 738 540 738 2 LN2 18 Q(OSStart) 108 708 T0 14 Q(Start the scheduler and multi-tasking under) 135 674.67 T1 12 Q(m) 379.97 674.67 T2 F(C/OS) 386.88 674.67 T2 14 Q(.) 414.89 674.67 T3 11 Q(#include \322ucos.h\323) 135 646.67 T(void OSStart\050void\051) 135 616.67 T2 12 Q(DESCRIPTION) 108 586.33 T3 11 Q-0.68 (OSStart\050\051) 135 565 P0 12 Q-0.31 ( is called to start the multi-tasking activity of the) 194.4 565 P1 F-0.31 (m) 427.3 565 P0 F-0.31 (C/OS kernel. It has to) 434.22 565 P-0.25 (be invoked after) 135 551 P3 11 Q-0.56 (OSInit\050\051) 215.21 551 P0 12 Q-0.25 ( and it completes the) 268.01 551 P1 F-0.25 (m) 369.07 551 P0 F-0.25 (C/OS inititialization. Splitting the) 375.98 551 P1 F(m) 135 537 T0 F(C/OS initialization into two steps gives a chance to the application\325) 141.91 537 T(s programmer) 464.57 537 T(using) 135 523 T1 F(m) 164 523 T0 F(C/OS, to create data structures and tasks without having) 170.92 523 T1 F(m) 442.88 523 T0 F(C/OS activated.) 449.8 523 T(This system call installs also the standard timer interrupt routine used by) 135 503 T1 F(m) 486.31 503 T0 F(C/OS as) 493.22 503 T(regular interrupt IRQ using interrupt #1 in the PID interrupt controller) 135 489 T(. The PID) 470.96 489 T-0.05 (timer is therefore for exclusive use by the) 135 475 P1 F-0.05 (m) 337.24 475 P0 F-0.05 (C/OS kernel. However) 344.15 475 P-0.05 (,) 453.23 475 P1 F-0.05 (m) 459.18 475 P0 F-0.05 (C/OS provides) 466.09 475 P-0.39 (other services for getting the current system time or delay a task for a certain number) 135 461 P(of system ticks.) 135 447 T(T) 135 427 T(o manually change the way the system tick is handled, look at the routine) 141.49 427 T3 11 Q(OSTimeTick\050\051) 135 413 T0 12 Q(.) 214.2 413 T2 F(NOTES) 108 384.33 T3 11 Q(OSStart\050\051) 135 363 T0 12 Q( never returns.) 194.4 363 T2 F(SEE ALSO) 108 334.33 T3 11 Q(OSInit\050\051, IRQInstall\050\051, OSTimeGet\050\051, OSTimeDly\050\051.) 135 313.67 TFMENDPAGE%%EndPage: "2" 3%%Page: "3" 3612 792 0 FMBEGINPAGE0 10 Q0 X0 K(OSDisableInt\050\051) 108 749.33 T1 F(m) 282.5 749.33 T0 F(C/OS System Calls) 288.26 749.33 T(OSDisableInt\050\051) 478.9 749.33 T108 54 540 54 2 L1 H2 ZN(VLSI T) 108 41.28 T(echnology Inc.) 138.13 41.28 T(July 1, 1993) 299.42 41.28 T(3) 535 41.28 T108 738 540 738 2 LN2 18 Q(OSDisableInt) 108 708 T0 14 Q(Disable interrupts.) 135 674.67 T3 11 Q(#include \322ucos.h\323) 135 646.67 T(void OSDisableInt\050void\051) 135 616.67 T2 12 Q(DESCRIPTION) 108 586.33 T3 11 Q-0.61 (OSDisableInt\050\051) 135 565 P0 12 Q-0.28 ( disables both FIQs and IRQs changing the current process status) 227.4 565 P(register of the ARM. It is used to protect critical regions in application code.) 135 551 T2 F(NOTES) 108 522.33 T0 F(When executing an interrupt service routine registered with) 135 501 T3 11 Q(IRQInstall\050\051) 423.6 501 T0 12 Q( or) 502.8 501 T3 11 Q(FIQInstall\050\051) 135 487 T0 12 Q(, interrupts are re-enabled before entering the interrupt service rou-) 214.2 487 T(tine, if they were enabled prior to the interrupt.) 135 473 T(There are no limitations in using) 135 453 T3 11 Q(OSDisableInt\050\051) 294.32 453 T0 12 Q( inside an interrupt service rou-) 386.72 453 T(tine. At the exit of an interrupt service routine the ARM process status register is) 135 439 T(restored to the value it had at the time the interrupt occurred.) 135 425 T(Even though the application is running in privileged mode it is not reccomended to) 135 405 T(change the I and F interrupt \337ags in the CPSR directly) 135 391 T(.) 394.87 391 T2 F(SEE ALSO) 108 362.33 T3 11 Q(OSEnableInt\050\051, IRQInstall\050\051, FIQInstall\050\051.) 135 341.67 TFMENDPAGE%%EndPage: "3" 4%%Page: "4" 4612 792 0 FMBEGINPAGE0 10 Q0 X0 K(OSEnableInt\050\051) 108 749.33 T1 F(m) 282.5 749.33 T0 F(C/OS System Calls) 288.26 749.33 T(OSEnableInt\050\051) 481.68 749.33 T108 54 540 54 2 L1 H2 ZN(VLSI T) 108 41.28 T(echnology Inc.) 138.13 41.28 T(July 1, 1993) 299.42 41.28 T(4) 535 41.28 T108 738 540 738 2 LN2 18 Q(OSEnableInt) 108 708 T0 14 Q(Enable interrupts.) 135 674.67 T3 11 Q(#include \322ucos.h\323) 135 646.67 T(void OSEnableInt\050void\051) 135 616.67 T2 12 Q(DESCRIPTION) 108 586.33 T3 11 Q(OSEnableInt\050\051) 135 565 T0 12 Q( enables both FIQs and IRQs in the ARM CPU. A call to) 220.8 565 T3 11 Q(OSEnableInt\050\051) 135 551 T0 12 Q( always results in resetting the I and F bits in the current process) 220.8 551 T(status register CPSR, regardless their previous values.) 135 537 T2 F(NOTES) 108 508.33 T0 F(Always use) 135 487 T3 11 Q(OSEnableInt\050\051) 193.66 487 T0 12 Q( in pair with) 279.46 487 T3 11 Q(OSDisableInt\050\051) 340.79 487 T0 12 Q(.) 433.19 487 T(No nesting of) 135 467 T3 11 Q(OSDisableInt\050\051) 203.33 467 T0 12 Q( is allowed. That is, the interrupts will be re-) 295.73 467 T(enabled a the \336rst) 135 453 T3 11 Q(OSEnableInt\050\051) 222.98 453 T0 12 Q( call, regardless of the number of previous) 308.78 453 T3 11 Q(OSDisableInt\050\051) 135 439 T0 12 Q(.) 227.4 439 T
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -