home *** CD-ROM | disk | FTP | other *** search
/ IT.SOFT 22 / ITSOFTCD_22.iso / mac / linux22 / slackware3.6 / DOCS / LINUX-2.0 / SMP.TEX;1 < prev    next >
LaTeX Document  |  1998-07-13  |  17.5 KB  |  [TEXT/hscd]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: LaTeX Document (document/latex).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert LaTeX Document (document/latex) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news or mail text default
99% file LaTeX 2e document text default
98% file LaTeX document text default
97% file LaTeX document, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/280 LaTeX (Master document) default
100% detectItEasy Format: Plain text[LF] default
100% xdgMime message/rfc822 default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[hscd]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 6d 69 | 63 68 61 65 6c 40 50 68 |From: mi|chael@Ph|
|00000010| 79 73 69 6b 2e 55 6e 69 | 2d 44 6f 72 74 6d 75 6e |ysik.Uni|-Dortmun|
|00000020| 64 2e 44 45 20 28 4d 69 | 63 68 61 65 6c 20 44 69 |d.DE (Mi|chael Di|
|00000030| 72 6b 6d 61 6e 6e 29 0a | 0a 74 68 61 6e 6b 73 20 |rkmann).|.thanks |
|00000040| 66 6f 72 20 79 6f 75 72 | 20 69 6e 66 6f 72 6d 61 |for your| informa|
|00000050| 74 69 6f 6e 2e 20 41 74 | 74 61 63 68 65 64 20 69 |tion. At|tached i|
|00000060| 73 20 74 68 65 20 74 65 | 78 2d 63 6f 64 65 20 6f |s the te|x-code o|
|00000070| 66 20 79 6f 75 72 0a 53 | 4d 50 2d 64 6f 63 75 6d |f your.S|MP-docum|
|00000080| 65 6e 74 61 74 69 6f 6e | 20 3a 0a 2d 3d 2d 3d 2d |entation| :.-=-=-|
|00000090| 3d 2d 3d 2d 3d 2d 3d 2d | 3d 2d 3d 2d 3d 2d 3d 2d |=-=-=-=-|=-=-=-=-|
|000000a0| 3d 2d 3d 2d 3d 2d 3d 2d | 3d 2d 3d 2d 3d 2d 3d 2d |=-=-=-=-|=-=-=-=-|
|000000b0| 3d 2d 3d 2d 3d 2d 3d 2d | 3d 2d 3d 2d 3d 2d 3d 2d |=-=-=-=-|=-=-=-=-|
|000000c0| 3d 2d 3d 2d 3d 2d 3d 2d | 3d 2d 3d 2d 3d 2d 3d 2d |=-=-=-=-|=-=-=-=-|
|000000d0| 3d 2d 3d 0a 5c 64 6f 63 | 75 6d 65 6e 74 63 6c 61 |=-=.\doc|umentcla|
|000000e0| 73 73 5b 5d 7b 61 72 74 | 69 63 6c 65 7d 0a 5c 70 |ss[]{art|icle}.\p|
|000000f0| 61 72 69 6e 64 65 6e 74 | 30 2e 30 63 6d 0a 5c 70 |arindent|0.0cm.\p|
|00000100| 61 72 73 6b 69 70 30 2e | 32 63 6d 0a 0a 5c 62 65 |arskip0.|2cm..\be|
|00000110| 67 69 6e 7b 64 6f 63 75 | 6d 65 6e 74 7d 0a 0a 5c |gin{docu|ment}..\|
|00000120| 62 65 67 69 6e 7b 63 65 | 6e 74 65 72 7d 0a 5c 4c |begin{ce|nter}.\L|
|00000130| 41 52 47 45 20 5c 62 66 | 0a 41 6e 20 49 6d 70 6c |ARGE \bf|.An Impl|
|00000140| 65 6d 65 6e 74 61 74 69 | 6f 6e 20 4f 66 20 4d 75 |ementati|on Of Mu|
|00000150| 6c 74 69 70 72 6f 63 65 | 73 73 6f 72 20 4c 69 6e |ltiproce|ssor Lin|
|00000160| 75 78 0a 5c 6e 6f 72 6d | 61 6c 73 69 7a 65 0a 5c |ux.\norm|alsize.\|
|00000170| 65 6e 64 7b 63 65 6e 74 | 65 72 7d 0a 0a 7b 20 5c |end{cent|er}..{ \|
|00000180| 69 74 0a 54 68 69 73 20 | 64 6f 63 75 6d 65 6e 74 |it.This |document|
|00000190| 20 64 65 73 63 72 69 62 | 65 73 20 74 68 65 20 69 | describ|es the i|
|000001a0| 6d 70 6c 65 6d 65 6e 74 | 61 74 69 6f 6e 20 6f 66 |mplement|ation of|
|000001b0| 20 61 20 73 69 6d 70 6c | 65 20 53 4d 50 20 0a 4c | a simpl|e SMP .L|
|000001c0| 69 6e 75 78 20 6b 65 72 | 6e 65 6c 20 65 78 74 65 |inux ker|nel exte|
|000001d0| 6e 73 69 6f 6e 20 61 6e | 64 20 68 6f 77 20 74 6f |nsion an|d how to|
|000001e0| 20 75 73 65 20 74 68 69 | 73 20 74 6f 20 64 65 76 | use thi|s to dev|
|000001f0| 65 6c 6f 70 20 53 4d 50 | 20 4c 69 6e 75 78 20 6b |elop SMP| Linux k|
|00000200| 65 72 6e 65 6c 73 20 66 | 6f 72 20 0a 61 72 63 68 |ernels f|or .arch|
|00000210| 69 74 65 63 74 75 72 65 | 73 20 6f 74 68 65 72 20 |itecture|s other |
|00000220| 74 68 61 6e 20 74 68 65 | 20 49 6e 74 65 6c 20 4d |than the| Intel M|
|00000230| 50 20 76 31 2e 31 20 61 | 72 63 68 69 74 65 63 74 |P v1.1 a|rchitect|
|00000240| 75 72 65 20 66 6f 72 20 | 50 65 6e 74 69 75 6d 20 |ure for |Pentium |
|00000250| 61 6e 64 20 34 38 36 20 | 0a 70 72 6f 63 65 73 73 |and 486 |.process|
|00000260| 6f 72 73 2e 7d 0a 0a 5c | 68 66 69 6c 6c 20 41 6c |ors.}..\|hfill Al|
|00000270| 61 6e 20 43 6f 78 2c 20 | 31 39 39 35 0a 0a 0a 54 |an Cox, |1995...T|
|00000280| 68 65 20 61 75 74 68 6f | 72 20 77 69 73 68 65 73 |he autho|r wishes|
|00000290| 20 74 6f 20 74 68 61 6e | 6b 20 43 61 6c 64 65 72 | to than|k Calder|
|000002a0| 61 20 49 6e 63 2e 20 28 | 20 68 74 74 70 3a 2f 2f |a Inc. (| http://|
|000002b0| 77 77 77 2e 63 61 6c 64 | 65 72 61 2e 63 6f 6d 20 |www.cald|era.com |
|000002c0| 29 0a 77 68 6f 73 65 20 | 64 6f 6e 61 74 69 6f 6e |).whose |donation|
|000002d0| 20 6f 66 20 61 6e 20 41 | 53 55 53 20 64 75 61 6c | of an A|SUS dual|
|000002e0| 20 50 65 6e 74 69 75 6d | 20 62 6f 61 72 64 20 6d | Pentium| board m|
|000002f0| 61 64 65 20 74 68 69 73 | 20 70 72 6f 6a 65 63 74 |ade this| project|
|00000300| 20 70 6f 73 73 69 62 6c | 65 2c 20 0a 61 6e 64 20 | possibl|e, .and |
|00000310| 54 68 6f 6d 61 73 20 52 | 61 64 6b 65 2c 20 77 68 |Thomas R|adke, wh|
|00000320| 6f 73 65 20 69 6e 69 74 | 69 61 6c 20 77 6f 72 6b |ose init|ial work|
|00000330| 20 6f 6e 20 6d 75 6c 74 | 69 70 72 6f 63 65 73 73 | on mult|iprocess|
|00000340| 6f 72 20 4c 69 6e 75 78 | 20 66 6f 72 6d 65 64 20 |or Linux| formed |
|00000350| 0a 74 68 65 20 62 61 63 | 6b 62 6f 6e 65 20 6f 66 |.the bac|kbone of|
|00000360| 20 74 68 69 73 20 70 72 | 6f 6a 65 63 74 2e 0a 0a | this pr|oject...|
|00000370| 5c 73 65 63 74 69 6f 6e | 7b 42 61 63 6b 67 72 6f |\section|{Backgro|
|00000380| 75 6e 64 3a 20 54 68 65 | 20 49 6e 74 65 6c 20 4d |und: The| Intel M|
|00000390| 50 20 73 70 65 63 69 66 | 69 63 61 74 69 6f 6e 2e |P specif|ication.|
|000003a0| 7d 0a 4d 6f 73 74 20 49 | 42 4d 20 50 43 20 73 74 |}.Most I|BM PC st|
|000003b0| 79 6c 65 20 6d 75 6c 74 | 69 70 72 6f 63 65 73 73 |yle mult|iprocess|
|000003c0| 6f 72 20 6d 6f 74 68 65 | 72 62 6f 61 72 64 73 20 |or mothe|rboards |
|000003d0| 63 6f 6d 62 69 6e 65 20 | 49 6e 74 65 6c 20 34 38 |combine |Intel 48|
|000003e0| 36 20 6f 72 20 50 65 6e | 74 69 75 6d 20 0a 70 72 |6 or Pen|tium .pr|
|000003f0| 6f 63 65 73 73 6f 72 73 | 20 61 6e 64 20 67 6c 75 |ocessors| and glu|
|00000400| 65 20 63 68 69 70 73 65 | 74 73 20 77 69 74 68 20 |e chipse|ts with |
|00000410| 61 20 68 61 72 64 77 61 | 72 65 2f 73 6f 66 74 77 |a hardwa|re/softw|
|00000420| 61 72 65 20 73 70 65 63 | 69 66 69 63 61 74 69 6f |are spec|ificatio|
|00000430| 6e 2e 20 54 68 65 20 0a | 73 70 65 63 69 66 69 63 |n. The .|specific|
|00000440| 61 74 69 6f 6e 20 70 6c | 61 63 65 73 20 6d 75 63 |ation pl|aces muc|
|00000450| 68 20 6f 66 20 74 68 65 | 20 6f 6e 75 73 20 66 6f |h of the| onus fo|
|00000460| 72 20 68 61 72 64 20 77 | 6f 72 6b 20 6f 6e 20 74 |r hard w|ork on t|
|00000470| 68 65 20 63 68 69 70 73 | 65 74 20 61 6e 64 20 0a |he chips|et and .|
|00000480| 68 61 72 64 77 61 72 65 | 20 72 61 74 68 65 72 20 |hardware| rather |
|00000490| 74 68 61 6e 20 74 68 65 | 20 6f 70 65 72 61 74 69 |than the| operati|
|000004a0| 6e 67 20 73 79 73 74 65 | 6d 2e 0a 0a 54 68 65 20 |ng syste|m...The |
|000004b0| 49 6e 74 65 6c 20 50 65 | 6e 74 69 75 6d 20 70 72 |Intel Pe|ntium pr|
|000004c0| 6f 63 65 73 73 6f 72 73 | 20 68 61 76 65 20 61 20 |ocessors| have a |
|000004d0| 77 69 64 65 20 76 61 72 | 69 65 74 79 20 6f 66 20 |wide var|iety of |
|000004e0| 62 75 69 6c 74 2d 69 6e | 20 66 61 63 69 6c 69 74 |built-in| facilit|
|000004f0| 69 65 73 20 66 6f 72 20 | 0a 73 75 70 70 6f 72 74 |ies for |.support|
|00000500| 69 6e 67 20 6d 75 6c 74 | 69 70 72 6f 63 65 73 73 |ing mult|iprocess|
|00000510| 69 6e 67 2c 20 69 6e 63 | 6c 75 64 69 6e 67 20 68 |ing, inc|luding h|
|00000520| 61 72 64 77 61 72 65 20 | 63 61 63 68 65 20 63 6f |ardware |cache co|
|00000530| 68 65 72 65 6e 63 79 2c | 20 62 75 69 6c 74 20 69 |herency,| built i|
|00000540| 6e 20 0a 69 6e 74 65 72 | 70 72 6f 63 65 73 73 6f |n .inter|processo|
|00000550| 72 20 69 6e 74 65 72 72 | 75 70 74 20 68 61 6e 64 |r interr|upt hand|
|00000560| 6c 69 6e 67 20 61 6e 64 | 20 61 20 73 65 74 20 6f |ling and| a set o|
|00000570| 66 20 61 74 6f 6d 69 63 | 20 74 65 73 74 20 61 6e |f atomic| test an|
|00000580| 64 20 73 65 74 2c 20 0a | 65 78 63 68 61 6e 67 65 |d set, .|exchange|
|00000590| 20 61 6e 64 20 73 69 6d | 69 6c 61 72 20 6f 70 65 | and sim|ilar ope|
|000005a0| 72 61 74 69 6f 6e 73 2e | 20 54 68 65 20 63 61 63 |rations.| The cac|
|000005b0| 68 65 20 63 6f 68 65 72 | 65 6e 63 79 20 69 6e 20 |he coher|ency in |
|000005c0| 70 61 72 74 69 63 75 6c | 61 72 20 6d 61 6b 65 73 |particul|ar makes|
|000005d0| 20 74 68 65 20 0a 6f 70 | 65 72 61 74 69 6e 67 20 | the .op|erating |
|000005e0| 73 79 73 74 65 6d 73 20 | 6a 6f 62 20 66 61 72 20 |systems |job far |
|000005f0| 65 61 73 69 65 72 2e 0a | 0a 54 68 65 20 73 70 65 |easier..|.The spe|
|00000600| 63 69 66 69 63 61 74 69 | 6f 6e 20 64 65 66 69 6e |cificati|on defin|
|00000610| 65 73 20 61 20 64 65 74 | 61 69 6c 65 64 20 63 6f |es a det|ailed co|
|00000620| 6e 66 69 67 75 72 61 74 | 69 6f 6e 20 73 74 72 75 |nfigurat|ion stru|
|00000630| 63 74 75 72 65 20 69 6e | 20 52 4f 4d 20 74 68 61 |cture in| ROM tha|
|00000640| 74 20 0a 74 68 65 20 62 | 6f 6f 74 20 75 70 20 70 |t .the b|oot up p|
|00000650| 72 6f 63 65 73 73 6f 72 | 20 63 61 6e 20 72 65 61 |rocessor| can rea|
|00000660| 64 20 74 6f 20 66 69 6e | 64 20 74 68 65 20 66 75 |d to fin|d the fu|
|00000670| 6c 6c 20 63 6f 6e 66 69 | 67 75 72 61 74 69 6f 6e |ll confi|guration|
|00000680| 20 6f 66 20 74 68 65 20 | 0a 70 72 6f 63 65 73 73 | of the |.process|
|00000690| 6f 72 73 20 61 6e 64 20 | 62 75 73 73 65 73 2e 20 |ors and |busses. |
|000006a0| 49 74 20 61 6c 73 6f 20 | 64 65 66 69 6e 65 73 20 |It also |defines |
|000006b0| 61 20 70 72 6f 63 65 64 | 75 72 65 20 66 6f 72 20 |a proced|ure for |
|000006c0| 73 74 61 72 74 69 6e 67 | 20 75 70 20 74 68 65 20 |starting| up the |
|000006d0| 0a 6f 74 68 65 72 20 70 | 72 6f 63 65 73 73 6f 72 |.other p|rocessor|
|000006e0| 73 2e 0a 0a 0a 5c 73 65 | 63 74 69 6f 6e 7b 4d 75 |s....\se|ction{Mu|
|000006f0| 74 75 61 6c 20 45 78 63 | 6c 75 73 69 6f 6e 20 57 |tual Exc|lusion W|
|00000700| 69 74 68 69 6e 20 41 20 | 53 69 6e 67 6c 65 20 50 |ithin A |Single P|
|00000710| 72 6f 63 65 73 73 6f 72 | 20 4c 69 6e 75 78 20 4b |rocessor| Linux K|
|00000720| 65 72 6e 65 6c 7d 0a 46 | 6f 72 20 61 6e 79 20 6b |ernel}.F|or any k|
|00000730| 65 72 6e 65 6c 20 74 6f | 20 66 75 6e 63 74 69 6f |ernel to| functio|
|00000740| 6e 20 69 6e 20 61 20 73 | 61 6e 65 20 6d 61 6e 6e |n in a s|ane mann|
|00000750| 65 72 20 69 74 20 68 61 | 73 20 74 6f 20 70 72 6f |er it ha|s to pro|
|00000760| 76 69 64 65 20 69 6e 74 | 65 72 6e 61 6c 20 0a 6c |vide int|ernal .l|
|00000770| 6f 63 6b 69 6e 67 20 61 | 6e 64 20 70 72 6f 74 65 |ocking a|nd prote|
|00000780| 63 74 69 6f 6e 20 6f 66 | 20 69 74 73 20 6f 77 6e |ction of| its own|
|00000790| 20 74 61 62 6c 65 73 20 | 74 6f 20 70 72 65 76 65 | tables |to preve|
|000007a0| 6e 74 20 74 77 6f 20 70 | 72 6f 63 65 73 73 65 73 |nt two p|rocesses|
|000007b0| 20 75 70 64 61 74 69 6e | 67 20 0a 74 68 65 6d 20 | updatin|g .them |
|000007c0| 61 74 20 6f 6e 63 65 20 | 61 6e 64 20 66 6f 72 20 |at once |and for |
|000007d0| 65 78 61 6d 70 6c 65 20 | 61 6c 6c 6f 63 61 74 69 |example |allocati|
|000007e0| 6e 67 20 74 68 65 20 73 | 61 6d 65 20 6d 65 6d 6f |ng the s|ame memo|
|000007f0| 72 79 20 62 6c 6f 63 6b | 2e 20 54 68 65 72 65 20 |ry block|. There |
|00000800| 61 72 65 20 0a 74 77 6f | 20 73 74 72 61 74 65 67 |are .two| strateg|
|00000810| 69 65 73 20 66 6f 72 20 | 74 68 69 73 20 77 69 74 |ies for |this wit|
|00000820| 68 69 6e 20 63 75 72 72 | 65 6e 74 20 55 6e 69 78 |hin curr|ent Unix|
|00000830| 20 61 6e 64 20 55 6e 69 | 78 6c 69 6b 65 20 6b 65 | and Uni|xlike ke|
|00000840| 72 6e 65 6c 73 2e 20 0a | 54 72 61 64 69 74 69 6f |rnels. .|Traditio|
|00000850| 6e 61 6c 20 75 6e 69 78 | 20 73 79 73 74 65 6d 73 |nal unix| systems|
|00000860| 20 66 72 6f 6d 20 74 68 | 65 20 65 61 72 6c 69 65 | from th|e earlie|
|00000870| 73 74 20 6f 66 20 64 61 | 79 73 20 75 73 65 20 61 |st of da|ys use a|
|00000880| 20 73 63 68 65 6d 65 20 | 6f 66 20 27 43 6f 61 72 | scheme |of 'Coar|
|00000890| 73 65 20 0a 47 72 61 69 | 6e 65 64 20 4c 6f 63 6b |se .Grai|ned Lock|
|000008a0| 69 6e 67 27 20 77 68 65 | 72 65 20 74 68 65 20 65 |ing' whe|re the e|
|000008b0| 6e 74 69 72 65 20 6b 65 | 72 6e 65 6c 20 69 73 20 |ntire ke|rnel is |
|000008c0| 70 72 6f 74 65 63 74 65 | 64 20 61 73 20 61 20 73 |protecte|d as a s|
|000008d0| 6d 61 6c 6c 20 6e 75 6d | 62 65 72 20 6f 66 20 0a |mall num|ber of .|
|000008e0| 6c 6f 63 6b 73 20 6f 6e | 6c 79 2e 20 53 6f 6d 65 |locks on|ly. Some|
|000008f0| 20 6d 6f 64 65 72 6e 20 | 73 79 73 74 65 6d 73 20 | modern |systems |
|00000900| 75 73 65 20 66 69 6e 65 | 20 67 72 61 69 6e 65 64 |use fine| grained|
|00000910| 20 6c 6f 63 6b 69 6e 67 | 2e 20 42 65 63 61 75 73 | locking|. Becaus|
|00000920| 65 20 66 69 6e 65 20 0a | 67 72 61 69 6e 65 64 20 |e fine .|grained |
|00000930| 6c 6f 63 6b 69 6e 67 20 | 68 61 73 20 6d 6f 72 65 |locking |has more|
|00000940| 20 6f 76 65 72 68 65 61 | 64 20 69 74 20 69 73 20 | overhea|d it is |
|00000950| 6e 6f 72 6d 61 6c 6c 79 | 20 75 73 65 64 20 6f 6e |normally| used on|
|00000960| 6c 79 20 6f 6e 20 0a 6d | 75 6c 74 69 70 72 6f 63 |ly on .m|ultiproc|
|00000970| 65 73 73 6f 72 20 6b 65 | 72 6e 65 6c 73 20 61 6e |essor ke|rnels an|
|00000980| 64 20 72 65 61 6c 20 74 | 69 6d 65 20 6b 65 72 6e |d real t|ime kern|
|00000990| 65 6c 73 2e 20 49 6e 20 | 61 20 72 65 61 6c 20 74 |els. In |a real t|
|000009a0| 69 6d 65 20 6b 65 72 6e | 65 6c 20 74 68 65 20 0a |ime kern|el the .|
|000009b0| 66 69 6e 65 20 67 72 61 | 69 6e 65 64 20 6c 6f 63 |fine gra|ined loc|
|000009c0| 6b 69 6e 67 20 72 65 64 | 75 63 65 73 20 74 68 65 |king red|uces the|
|000009d0| 20 61 6d 6f 75 6e 74 20 | 6f 66 20 74 69 6d 65 20 | amount |of time |
|000009e0| 6c 6f 63 6b 73 20 61 72 | 65 20 68 65 6c 64 20 61 |locks ar|e held a|
|000009f0| 6e 64 20 72 65 64 75 63 | 65 73 20 0a 74 68 65 20 |nd reduc|es .the |
|00000a00| 63 72 69 74 69 63 61 6c | 20 28 74 6f 20 72 65 61 |critical| (to rea|
|00000a10| 6c 20 74 69 6d 65 20 70 | 72 6f 67 72 61 6d 6d 69 |l time p|rogrammi|
|00000a20| 6e 67 20 61 74 20 6c 65 | 61 73 74 29 20 6c 61 74 |ng at le|ast) lat|
|00000a30| 65 6e 63 79 20 74 69 6d | 65 73 2e 0a 0a 57 69 74 |ency tim|es...Wit|
|00000a40| 68 69 6e 20 74 68 65 20 | 4c 69 6e 75 78 20 6b 65 |hin the |Linux ke|
|00000a50| 72 6e 65 6c 20 63 65 72 | 74 61 69 6e 20 67 75 61 |rnel cer|tain gua|
|00000a60| 72 61 6e 74 65 65 73 20 | 61 72 65 20 6d 61 64 65 |rantees |are made|
|00000a70| 2e 20 4e 6f 20 70 72 6f | 63 65 73 73 20 72 75 6e |. No pro|cess run|
|00000a80| 6e 69 6e 67 20 69 6e 20 | 0a 6b 65 72 6e 65 6c 20 |ning in |.kernel |
|00000a90| 6d 6f 64 65 20 77 69 6c | 6c 20 62 65 20 70 72 65 |mode wil|l be pre|
|00000aa0| 2d 65 6d 70 74 65 64 20 | 62 79 20 61 6e 6f 74 68 |-empted |by anoth|
|00000ab0| 65 72 20 6b 65 72 6e 65 | 6c 20 6d 6f 64 65 20 70 |er kerne|l mode p|
|00000ac0| 72 6f 63 65 73 73 20 75 | 6e 6c 65 73 73 20 69 74 |rocess u|nless it|
|00000ad0| 20 0a 76 6f 6c 75 6e 74 | 61 72 69 6c 79 20 73 6c | .volunt|arily sl|
|00000ae0| 65 65 70 73 2e 20 20 54 | 68 69 73 20 65 6e 73 75 |eeps. T|his ensu|
|00000af0| 72 65 73 20 74 68 61 74 | 20 62 6c 6f 63 6b 73 20 |res that| blocks |
|00000b00| 6f 66 20 6b 65 72 6e 65 | 6c 20 63 6f 64 65 20 61 |of kerne|l code a|
|00000b10| 72 65 20 0a 65 66 66 65 | 63 74 69 76 65 6c 79 20 |re .effe|ctively |
|00000b20| 61 74 6f 6d 69 63 20 77 | 69 74 68 20 72 65 73 70 |atomic w|ith resp|
|00000b30| 65 63 74 20 74 6f 20 6f | 74 68 65 72 20 70 72 6f |ect to o|ther pro|
|00000b40| 63 65 73 73 65 73 20 61 | 6e 64 20 67 72 65 61 74 |cesses a|nd great|
|00000b50| 6c 79 20 73 69 6d 70 6c | 69 66 69 65 73 20 0a 6d |ly simpl|ifies .m|
|00000b60| 61 6e 79 20 6f 70 65 72 | 61 74 69 6f 6e 2e 20 53 |any oper|ation. S|
|00000b70| 65 63 6f 6e 64 6c 79 20 | 69 6e 74 65 72 72 75 70 |econdly |interrup|
|00000b80| 74 73 20 6d 61 79 20 70 | 72 65 2d 65 6d 70 74 20 |ts may p|re-empt |
|00000b90| 61 20 6b 65 72 6e 65 6c | 20 72 75 6e 6e 69 6e 67 |a kernel| running|
|00000ba0| 20 70 72 6f 63 65 73 73 | 2c 20 0a 62 75 74 20 77 | process|, .but w|
|00000bb0| 69 6c 6c 20 61 6c 77 61 | 79 73 20 72 65 74 75 72 |ill alwa|ys retur|
|00000bc0| 6e 20 74 6f 20 74 68 61 | 74 20 70 72 6f 63 65 73 |n to tha|t proces|
|00000bd0| 73 2e 20 41 20 70 72 6f | 63 65 73 73 20 69 6e 20 |s. A pro|cess in |
|00000be0| 6b 65 72 6e 65 6c 20 6d | 6f 64 65 20 6d 61 79 20 |kernel m|ode may |
|00000bf0| 0a 64 69 73 61 62 6c 65 | 20 69 6e 74 65 72 72 75 |.disable| interru|
|00000c00| 70 74 73 20 6f 6e 20 74 | 68 65 20 70 72 6f 63 65 |pts on t|he proce|
|00000c10| 73 73 6f 72 20 61 6e 64 | 20 67 75 61 72 61 6e 74 |ssor and| guarant|
|00000c20| 65 65 20 73 75 63 68 20 | 61 6e 20 69 6e 74 65 72 |ee such |an inter|
|00000c30| 72 75 70 74 69 6f 6e 20 | 77 69 6c 6c 20 0a 6e 6f |ruption |will .no|
|00000c40| 74 20 6f 63 63 75 72 2e | 20 54 68 65 20 66 69 6e |t occur.| The fin|
|00000c50| 61 6c 20 67 75 61 72 61 | 6e 74 65 65 20 69 73 20 |al guara|ntee is |
|00000c60| 74 68 61 74 20 61 6e 20 | 69 6e 74 65 72 72 75 70 |that an |interrup|
|00000c70| 74 20 77 69 6c 6c 20 6e | 6f 74 20 62 65 20 70 72 |t will n|ot be pr|
|00000c80| 65 2d 65 6d 70 74 65 64 | 20 0a 62 79 20 61 20 6b |e-empted| .by a k|
|00000c90| 65 72 6e 65 6c 20 74 61 | 73 6b 2e 20 54 68 61 74 |ernel ta|sk. That|
|00000ca0| 20 69 73 20 69 6e 74 65 | 72 72 75 70 74 73 20 77 | is inte|rrupts w|
|00000cb0| 69 6c 6c 20 72 75 6e 20 | 74 6f 20 63 6f 6d 70 6c |ill run |to compl|
|00000cc0| 65 74 69 6f 6e 20 6f 72 | 20 62 65 20 0a 70 72 65 |etion or| be .pre|
|00000cd0| 2d 65 6d 70 74 65 64 20 | 62 79 20 6f 74 68 65 72 |-empted |by other|
|00000ce0| 20 69 6e 74 65 72 72 75 | 70 74 73 20 6f 6e 6c 79 | interru|pts only|
|00000cf0| 2e 0a 0a 54 68 65 20 53 | 4d 50 20 6b 65 72 6e 65 |...The S|MP kerne|
|00000d00| 6c 20 63 68 6f 6f 73 65 | 73 20 74 6f 20 63 6f 6e |l choose|s to con|
|00000d10| 74 69 6e 75 65 20 74 68 | 65 73 65 20 62 61 73 69 |tinue th|ese basi|
|00000d20| 63 20 67 75 61 72 61 6e | 74 65 65 73 20 69 6e 20 |c guaran|tees in |
|00000d30| 6f 72 64 65 72 20 74 6f | 20 6d 61 6b 65 20 0a 69 |order to| make .i|
|00000d40| 6e 69 74 69 61 6c 20 69 | 6d 70 6c 65 6d 65 6e 74 |nitial i|mplement|
|00000d50| 61 74 69 6f 6e 20 61 6e | 64 20 64 65 70 6c 6f 79 |ation an|d deploy|
|00000d60| 6d 65 6e 74 20 65 61 73 | 69 65 72 2e 20 20 41 20 |ment eas|ier. A |
|00000d70| 73 69 6e 67 6c 65 20 6c | 6f 63 6b 20 69 73 20 6d |single l|ock is m|
|00000d80| 61 69 6e 74 61 69 6e 65 | 64 20 0a 61 63 72 6f 73 |aintaine|d .acros|
|00000d90| 73 20 61 6c 6c 20 70 72 | 6f 63 65 73 73 6f 72 73 |s all pr|ocessors|
|00000da0| 2e 20 54 68 69 73 20 6c | 6f 63 6b 20 69 73 20 72 |. This l|ock is r|
|00000db0| 65 71 75 69 72 65 64 20 | 74 6f 20 61 63 63 65 73 |equired |to acces|
|00000dc0| 73 20 74 68 65 20 6b 65 | 72 6e 65 6c 20 73 70 61 |s the ke|rnel spa|
|00000dd0| 63 65 2e 20 0a 41 6e 79 | 20 70 72 6f 63 65 73 73 |ce. .Any| process|
|00000de0| 6f 72 20 6d 61 79 20 68 | 6f 6c 64 20 69 74 20 61 |or may h|old it a|
|00000df0| 6e 64 20 6f 6e 63 65 20 | 69 74 20 69 73 20 68 65 |nd once |it is he|
|00000e00| 6c 64 20 6d 61 79 20 61 | 6c 73 6f 20 72 65 2d 65 |ld may a|lso re-e|
|00000e10| 6e 74 65 72 20 74 68 65 | 20 6b 65 72 6e 65 6c 20 |nter the| kernel |
|00000e20| 0a 66 6f 72 20 69 6e 74 | 65 72 72 75 70 74 73 20 |.for int|errupts |
|00000e30| 61 6e 64 20 6f 74 68 65 | 72 20 73 65 72 76 69 63 |and othe|r servic|
|00000e40| 65 73 20 77 68 65 6e 65 | 76 65 72 20 69 74 20 6c |es whene|ver it l|
|00000e50| 69 6b 65 73 20 75 6e 74 | 69 6c 20 74 68 65 20 6c |ikes unt|il the l|
|00000e60| 6f 63 6b 20 69 73 20 0a | 72 65 6c 69 6e 71 75 69 |ock is .|relinqui|
|00000e70| 73 68 65 64 2e 20 54 68 | 69 73 20 6c 6f 63 6b 20 |shed. Th|is lock |
|00000e80| 65 6e 73 75 72 65 73 20 | 74 68 61 74 20 61 20 6b |ensures |that a k|
|00000e90| 65 72 6e 65 6c 20 6d 6f | 64 65 20 70 72 6f 63 65 |ernel mo|de proce|
|00000ea0| 73 73 20 77 69 6c 6c 20 | 6e 6f 74 20 62 65 20 0a |ss will |not be .|
|00000eb0| 70 72 65 2d 65 6d 70 74 | 65 64 20 61 6e 64 20 65 |pre-empt|ed and e|
|00000ec0| 6e 73 75 72 65 73 20 74 | 68 61 74 20 62 6c 6f 63 |nsures t|hat bloc|
|00000ed0| 6b 69 6e 67 20 69 6e 74 | 65 72 72 75 70 74 73 20 |king int|errupts |
|00000ee0| 69 6e 20 6b 65 72 6e 65 | 6c 20 6d 6f 64 65 20 62 |in kerne|l mode b|
|00000ef0| 65 68 61 76 65 73 20 0a | 63 6f 72 72 65 63 74 6c |ehaves .|correctl|
|00000f00| 79 2e 20 54 68 69 73 20 | 69 73 20 67 75 61 72 61 |y. This |is guara|
|00000f10| 6e 74 65 65 64 20 62 65 | 63 61 75 73 65 20 6f 6e |nteed be|cause on|
|00000f20| 6c 79 20 74 68 65 20 70 | 72 6f 63 65 73 73 6f 72 |ly the p|rocessor|
|00000f30| 20 68 6f 6c 64 69 6e 67 | 20 74 68 65 20 6c 6f 63 | holding| the loc|
|00000f40| 6b 20 0a 63 61 6e 20 62 | 65 20 69 6e 20 6b 65 72 |k .can b|e in ker|
|00000f50| 6e 65 6c 20 6d 6f 64 65 | 2c 20 6f 6e 6c 79 20 6b |nel mode|, only k|
|00000f60| 65 72 6e 65 6c 20 6d 6f | 64 65 20 70 72 6f 63 65 |ernel mo|de proce|
|00000f70| 73 73 65 73 20 63 61 6e | 20 64 69 73 61 62 6c 65 |sses can| disable|
|00000f80| 20 69 6e 74 65 72 72 75 | 70 74 73 20 0a 61 6e 64 | interru|pts .and|
|00000f90| 20 6f 6e 6c 79 20 74 68 | 65 20 70 72 6f 63 65 73 | only th|e proces|
|00000fa0| 73 6f 72 20 68 6f 6c 64 | 69 6e 67 20 74 68 65 20 |sor hold|ing the |
|00000fb0| 6c 6f 63 6b 20 6d 61 79 | 20 68 61 6e 64 6c 65 20 |lock may| handle |
|00000fc0| 61 6e 20 69 6e 74 65 72 | 72 75 70 74 2e 0a 0a 53 |an inter|rupt...S|
|00000fd0| 75 63 68 20 61 20 63 68 | 6f 69 63 65 20 69 73 20 |uch a ch|oice is |
|00000fe0| 68 6f 77 65 76 65 72 20 | 70 6f 6f 72 20 66 6f 72 |however |poor for|
|00000ff0| 20 70 65 72 66 6f 72 6d | 61 6e 63 65 2e 20 49 6e | perform|ance. In|
|00001000| 20 74 68 65 20 6c 6f 6e | 67 65 72 20 74 65 72 6d | the lon|ger term|
|00001010| 20 69 74 20 69 73 20 0a | 6e 65 63 65 73 73 61 72 | it is .|necessar|
|00001020| 79 20 74 6f 20 6d 6f 76 | 65 20 74 6f 20 66 69 6e |y to mov|e to fin|
|00001030| 65 72 20 67 72 61 69 6e | 65 64 20 70 61 72 61 6c |er grain|ed paral|
|00001040| 6c 65 6c 69 73 6d 20 69 | 6e 20 6f 72 64 65 72 20 |lelism i|n order |
|00001050| 74 6f 20 67 65 74 20 74 | 68 65 20 62 65 73 74 20 |to get t|he best |
|00001060| 0a 73 79 73 74 65 6d 20 | 70 65 72 66 6f 72 6d 61 |.system |performa|
|00001070| 6e 63 65 2e 20 54 68 69 | 73 20 63 61 6e 20 62 65 |nce. Thi|s can be|
|00001080| 20 64 6f 6e 65 20 68 69 | 65 72 61 72 63 68 69 63 | done hi|erarchic|
|00001090| 61 6c 6c 79 20 62 79 20 | 67 72 61 64 75 61 6c 6c |ally by |graduall|
|000010a0| 79 20 72 65 66 69 6e 69 | 6e 67 20 0a 74 68 65 20 |y refini|ng .the |
|000010b0| 6c 6f 63 6b 73 20 74 6f | 20 63 6f 76 65 72 20 73 |locks to| cover s|
|000010c0| 6d 61 6c 6c 65 72 20 61 | 72 65 61 73 2e 20 57 69 |maller a|reas. Wi|
|000010d0| 74 68 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 6b |th the c|urrent k|
|000010e0| 65 72 6e 65 6c 20 68 69 | 67 68 6c 79 20 43 50 55 |ernel hi|ghly CPU|
|000010f0| 20 62 6f 75 6e 64 20 0a | 70 72 6f 63 65 73 73 20 | bound .|process |
|00001100| 73 65 74 73 20 70 65 72 | 66 6f 72 6d 20 77 65 6c |sets per|form wel|
|00001110| 6c 20 62 75 74 20 49 2f | 4f 20 62 6f 75 6e 64 20 |l but I/|O bound |
|00001120| 74 61 73 6b 20 73 65 74 | 73 20 63 61 6e 20 65 61 |task set|s can ea|
|00001130| 73 69 6c 79 20 64 65 67 | 65 6e 65 72 61 74 65 20 |sily deg|enerate |
|00001140| 74 6f 20 0a 6e 65 61 72 | 20 73 69 6e 67 6c 65 20 |to .near| single |
|00001150| 70 72 6f 63 65 73 73 6f | 72 20 70 65 72 66 6f 72 |processo|r perfor|
|00001160| 6d 61 6e 63 65 20 6c 65 | 76 65 6c 73 2e 20 54 68 |mance le|vels. Th|
|00001170| 69 73 20 72 65 66 69 6e | 65 6d 65 6e 74 20 77 69 |is refin|ement wi|
|00001180| 6c 6c 20 62 65 20 6e 65 | 65 64 65 64 20 74 6f 20 |ll be ne|eded to |
|00001190| 0a 67 65 74 20 74 68 65 | 20 62 65 73 74 20 66 72 |.get the| best fr|
|000011a0| 6f 6d 20 4c 69 6e 75 78 | 2f 53 4d 50 2e 0a 0a 5c |om Linux|/SMP...\|
|000011b0| 73 75 62 73 65 63 74 69 | 6f 6e 7b 43 68 61 6e 67 |subsecti|on{Chang|
|000011c0| 65 73 20 54 6f 20 54 68 | 65 20 50 6f 72 74 61 62 |es To Th|e Portab|
|000011d0| 6c 65 20 4b 65 72 6e 65 | 6c 20 43 6f 6d 70 6f 6e |le Kerne|l Compon|
|000011e0| 65 6e 74 73 7d 0a 54 68 | 65 20 6b 65 72 6e 65 6c |ents}.Th|e kernel|
|000011f0| 20 63 68 61 6e 67 65 73 | 20 61 72 65 20 73 70 6c | changes| are spl|
|00001200| 69 74 20 69 6e 74 6f 20 | 67 65 6e 65 72 69 63 20 |it into |generic |
|00001210| 53 4d 50 20 73 75 70 70 | 6f 72 74 20 63 68 61 6e |SMP supp|ort chan|
|00001220| 67 65 73 20 61 6e 64 20 | 0a 61 72 63 68 69 74 65 |ges and |.archite|
|00001230| 63 74 75 72 65 20 73 70 | 65 63 69 66 69 63 20 63 |cture sp|ecific c|
|00001240| 68 61 6e 67 65 73 20 6e | 65 63 65 73 73 61 72 79 |hanges n|ecessary|
|00001250| 20 74 6f 20 61 63 63 6f | 6d 6d 6f 64 61 74 65 20 | to acco|mmodate |
|00001260| 65 61 63 68 20 64 69 66 | 66 65 72 65 6e 74 20 0a |each dif|ferent .|
|00001270| 70 72 6f 63 65 73 73 6f | 72 20 74 79 70 65 20 4c |processo|r type L|
|00001280| 69 6e 75 78 20 69 73 20 | 70 6f 72 74 65 64 20 74 |inux is |ported t|
|00001290| 6f 2e 0a 0a 0a 5c 73 75 | 62 73 75 62 73 65 63 74 |o....\su|bsubsect|
|000012a0| 69 6f 6e 7b 49 6e 69 74 | 69 61 6c 69 73 61 74 69 |ion{Init|ialisati|
|000012b0| 6f 6e 7d 0a 54 68 65 20 | 66 69 72 73 74 20 70 72 |on}.The |first pr|
|000012c0| 6f 62 6c 65 6d 20 77 69 | 74 68 20 61 20 6d 75 6c |oblem wi|th a mul|
|000012d0| 74 69 70 72 6f 63 65 73 | 73 6f 72 20 6b 65 72 6e |tiproces|sor kern|
|000012e0| 65 6c 20 69 73 20 73 74 | 61 72 74 69 6e 67 20 74 |el is st|arting t|
|000012f0| 68 65 20 6f 74 68 65 72 | 20 0a 70 72 6f 63 65 73 |he other| .proces|
|00001300| 73 6f 72 73 20 75 70 2e | 20 4c 69 6e 75 78 2f 53 |sors up.| Linux/S|
|00001310| 4d 50 20 64 65 66 69 6e | 65 73 20 74 68 61 74 20 |MP defin|es that |
|00001320| 61 20 73 69 6e 67 6c 65 | 20 70 72 6f 63 65 73 73 |a single| process|
|00001330| 6f 72 20 65 6e 74 65 72 | 73 20 74 68 65 20 6e 6f |or enter|s the no|
|00001340| 72 6d 61 6c 20 0a 6b 65 | 72 6e 65 6c 20 65 6e 74 |rmal .ke|rnel ent|
|00001350| 72 79 20 70 6f 69 6e 74 | 20 73 74 61 72 74 5c 5f |ry point| start\_|
|00001360| 6b 65 72 6e 65 6c 28 29 | 2e 20 4f 74 68 65 72 20 |kernel()|. Other |
|00001370| 70 72 6f 63 65 73 73 6f | 72 73 20 61 72 65 20 61 |processo|rs are a|
|00001380| 73 73 75 6d 65 64 20 6e | 6f 74 20 74 6f 20 62 65 |ssumed n|ot to be|
|00001390| 20 0a 73 74 61 72 74 65 | 64 20 6f 72 20 74 6f 20 | .starte|d or to |
|000013a0| 68 61 76 65 20 62 65 65 | 6e 20 63 61 70 74 75 72 |have bee|n captur|
|000013b0| 65 64 20 65 6c 73 65 77 | 68 65 72 65 2e 20 54 68 |ed elsew|here. Th|
|000013c0| 65 20 66 69 72 73 74 20 | 70 72 6f 63 65 73 73 6f |e first |processo|
|000013d0| 72 20 62 65 67 69 6e 73 | 20 74 68 65 20 0a 6e 6f |r begins| the .no|
|000013e0| 72 6d 61 6c 20 4c 69 6e | 75 78 20 69 6e 69 74 69 |rmal Lin|ux initi|
|000013f0| 61 6c 69 73 61 74 69 6f | 6e 20 73 65 71 75 65 6e |alisatio|n sequen|
|00001400| 63 65 73 20 61 6e 64 20 | 73 65 74 73 20 75 70 20 |ces and |sets up |
|00001410| 70 61 67 69 6e 67 2c 20 | 69 6e 74 65 72 72 75 70 |paging, |interrup|
|00001420| 74 73 20 61 6e 64 20 0a | 74 72 61 70 20 68 61 6e |ts and .|trap han|
|00001430| 64 6c 65 72 73 2e 20 41 | 66 74 65 72 20 69 74 20 |dlers. A|fter it |
|00001440| 68 61 73 20 6f 62 74 61 | 69 6e 65 64 20 74 68 65 |has obta|ined the|
|00001450| 20 70 72 6f 63 65 73 73 | 6f 72 20 69 6e 66 6f 72 | process|or infor|
|00001460| 6d 61 74 69 6f 6e 20 61 | 62 6f 75 74 20 74 68 65 |mation a|bout the|
|00001470| 20 0a 62 6f 6f 74 20 43 | 50 55 2c 20 74 68 65 20 | .boot C|PU, the |
|00001480| 61 72 63 68 69 74 65 63 | 74 75 72 65 20 73 70 65 |architec|ture spe|
|00001490| 63 69 66 69 63 20 66 75 | 6e 63 74 69 6f 6e 20 0a |cific fu|nction .|
|000014a0| 0a 0a 7b 5c 74 74 20 5c | 62 66 7b 76 6f 69 64 20 |..{\tt \|bf{void |
|000014b0| 73 6d 70 5c 5f 73 74 6f | 72 65 5c 5f 63 70 75 5c |smp\_sto|re\_cpu\|
|000014c0| 5f 69 6e 66 6f 28 69 6e | 74 20 70 72 6f 63 65 73 |_info(in|t proces|
|000014d0| 73 6f 72 5c 5f 69 64 29 | 20 7d 7d 0a 0a 69 73 20 |sor\_id)| }}..is |
|000014e0| 63 61 6c 6c 65 64 20 74 | 6f 20 73 74 6f 72 65 20 |called t|o store |
|000014f0| 61 6e 79 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |any info|rmation |
|00001500| 61 62 6f 75 74 20 74 68 | 65 20 70 72 6f 63 65 73 |about th|e proces|
|00001510| 73 6f 72 20 69 6e 74 6f | 20 61 20 70 65 72 20 70 |sor into| a per p|
|00001520| 72 6f 63 65 73 73 6f 72 | 20 0a 61 72 72 61 79 2e |rocessor| .array.|
|00001530| 20 54 68 69 73 20 69 6e | 63 6c 75 64 65 73 20 74 | This in|cludes t|
|00001540| 68 69 6e 67 73 20 6c 69 | 6b 65 20 74 68 65 20 62 |hings li|ke the b|
|00001550| 6f 67 6f 6d 69 70 73 20 | 73 70 65 65 64 20 72 61 |ogomips |speed ra|
|00001560| 74 69 6e 67 73 2e 0a 0a | 48 61 76 69 6e 67 20 63 |tings...|Having c|
|00001570| 6f 6d 70 6c 65 74 65 64 | 20 74 68 65 20 6b 65 72 |ompleted| the ker|
|00001580| 6e 65 6c 20 69 6e 69 74 | 69 61 6c 69 73 61 74 69 |nel init|ialisati|
|00001590| 6f 6e 20 74 68 65 20 61 | 72 63 68 69 74 65 63 74 |on the a|rchitect|
|000015a0| 75 72 65 20 73 70 65 63 | 69 66 69 63 20 0a 66 75 |ure spec|ific .fu|
|000015b0| 6e 63 74 69 6f 6e 0a 0a | 7b 5c 74 74 20 5c 62 66 |nction..|{\tt \bf|
|000015c0| 20 76 6f 69 64 20 73 6d | 70 5c 5f 62 6f 6f 74 5c | void sm|p\_boot\|
|000015d0| 5f 63 70 75 73 28 76 6f | 69 64 29 20 7d 0a 0a 69 |_cpus(vo|id) }..i|
|000015e0| 73 20 63 61 6c 6c 65 64 | 20 61 6e 64 20 69 73 20 |s called| and is |
|000015f0| 65 78 70 65 63 74 65 64 | 20 74 6f 20 73 74 61 72 |expected| to star|
|00001600| 74 20 75 70 20 65 61 63 | 68 20 6f 74 68 65 72 20 |t up eac|h other |
|00001610| 70 72 6f 63 65 73 73 6f | 72 20 61 6e 64 20 63 61 |processo|r and ca|
|00001620| 75 73 65 20 69 74 20 74 | 6f 20 0a 65 6e 74 65 72 |use it t|o .enter|
|00001630| 20 73 74 61 72 74 5c 5f | 6b 65 72 6e 65 6c 28 29 | start\_|kernel()|
|00001640| 20 77 69 74 68 20 69 74 | 73 20 70 61 67 69 6e 67 | with it|s paging|
|00001650| 20 72 65 67 69 73 74 65 | 72 73 20 61 6e 64 20 6f | registe|rs and o|
|00001660| 74 68 65 72 20 63 6f 6e | 74 72 6f 6c 20 0a 69 6e |ther con|trol .in|
|00001670| 66 6f 72 6d 61 74 69 6f | 6e 20 63 6f 72 72 65 63 |formatio|n correc|
|00001680| 74 6c 79 20 6c 6f 61 64 | 65 64 2e 20 45 61 63 68 |tly load|ed. Each|
|00001690| 20 6f 74 68 65 72 20 70 | 72 6f 63 65 73 73 6f 72 | other p|rocessor|
|000016a0| 20 73 6b 69 70 73 20 74 | 68 65 20 73 65 74 75 70 | skips t|he setup|
|000016b0| 20 65 78 63 65 70 74 20 | 0a 66 6f 72 20 63 61 6c | except |.for cal|
|000016c0| 6c 69 6e 67 20 74 68 65 | 20 74 72 61 70 20 61 6e |ling the| trap an|
|000016d0| 64 20 69 72 71 20 69 6e | 69 74 69 61 6c 69 73 61 |d irq in|itialisa|
|000016e0| 74 69 6f 6e 20 66 75 6e | 63 74 69 6f 6e 73 20 74 |tion fun|ctions t|
|000016f0| 68 61 74 20 61 72 65 20 | 6e 65 65 64 65 64 20 6f |hat are |needed o|
|00001700| 6e 20 0a 73 6f 6d 65 20 | 70 72 6f 63 65 73 73 6f |n .some |processo|
|00001710| 72 73 20 74 6f 20 73 65 | 74 20 65 61 63 68 20 43 |rs to se|t each C|
|00001720| 50 55 20 75 70 20 63 6f | 72 72 65 63 74 6c 79 2e |PU up co|rrectly.|
|00001730| 20 20 54 68 65 73 65 20 | 66 75 6e 63 74 69 6f 6e | These |function|
|00001740| 73 20 77 69 6c 6c 20 0a | 70 72 6f 62 61 62 6c 79 |s will .|probably|
|00001750| 20 6e 65 65 64 20 74 6f | 20 62 65 20 6d 6f 64 69 | need to| be modi|
|00001760| 66 69 65 64 20 69 6e 20 | 65 78 69 73 74 69 6e 67 |fied in |existing|
|00001770| 20 6b 65 72 6e 65 6c 73 | 20 74 6f 20 63 6f 70 65 | kernels| to cope|
|00001780| 20 77 69 74 68 20 74 68 | 69 73 2e 0a 0a 0a 45 61 | with th|is....Ea|
|00001790| 63 68 20 61 64 64 69 74 | 69 6f 6e 61 6c 20 43 50 |ch addit|ional CP|
|000017a0| 55 20 74 68 65 20 63 61 | 6c 6c 73 20 74 68 65 20 |U the ca|lls the |
|000017b0| 61 72 63 68 69 74 65 63 | 74 75 72 65 20 73 70 65 |architec|ture spe|
|000017c0| 63 69 66 69 63 20 66 75 | 6e 63 74 69 6f 6e 0a 0a |cific fu|nction..|
|000017d0| 7b 5c 74 74 20 5c 62 66 | 20 76 6f 69 64 20 73 6d |{\tt \bf| void sm|
|000017e0| 70 5c 5f 63 61 6c 6c 69 | 6e 28 76 6f 69 64 29 7d |p\_calli|n(void)}|
|000017f0| 0a 0a 77 68 69 63 68 20 | 64 6f 65 73 20 61 6e 79 |..which |does any|
|00001800| 20 66 69 6e 61 6c 20 73 | 65 74 75 70 20 61 6e 64 | final s|etup and|
|00001810| 20 74 68 65 6e 20 73 70 | 69 6e 73 20 74 68 65 20 | then sp|ins the |
|00001820| 70 72 6f 63 65 73 73 6f | 72 20 77 68 69 6c 65 20 |processo|r while |
|00001830| 74 68 65 20 62 6f 6f 74 | 20 0a 75 70 20 70 72 6f |the boot| .up pro|
|00001840| 63 65 73 73 6f 72 20 66 | 6f 72 6b 73 20 6f 66 66 |cessor f|orks off|
|00001850| 20 65 6e 6f 75 67 68 20 | 69 64 6c 65 20 74 68 72 | enough |idle thr|
|00001860| 65 61 64 73 20 66 6f 72 | 20 65 61 63 68 20 70 72 |eads for| each pr|
|00001870| 6f 63 65 73 73 6f 72 2e | 20 54 68 69 73 20 69 73 |ocessor.| This is|
|00001880| 20 0a 6e 65 63 65 73 73 | 61 72 79 20 62 65 63 61 | .necess|ary beca|
|00001890| 75 73 65 20 74 68 65 20 | 73 63 68 65 64 75 6c 65 |use the |schedule|
|000018a0| 72 20 61 73 73 75 6d 65 | 73 20 74 68 65 72 65 20 |r assume|s there |
|000018b0| 69 73 20 61 6c 77 61 79 | 73 20 73 6f 6d 65 74 68 |is alway|s someth|
|000018c0| 69 6e 67 20 74 6f 20 72 | 75 6e 2e 20 0a 48 61 76 |ing to r|un. .Hav|
|000018d0| 69 6e 67 20 67 65 6e 65 | 72 61 74 65 64 20 74 68 |ing gene|rated th|
|000018e0| 65 73 65 20 74 68 72 65 | 61 64 73 20 61 6e 64 20 |ese thre|ads and |
|000018f0| 66 6f 72 6b 65 64 20 69 | 6e 69 74 20 74 68 65 20 |forked i|nit the |
|00001900| 61 72 63 68 69 74 65 63 | 74 75 72 65 20 73 70 65 |architec|ture spe|
|00001910| 63 69 66 69 63 20 0a 0a | 7b 5c 74 74 20 5c 62 66 |cific ..|{\tt \bf|
|00001920| 20 76 6f 69 64 20 73 6d | 70 5c 5f 63 6f 6d 6d 65 | void sm|p\_comme|
|00001930| 6e 63 65 28 76 6f 69 64 | 29 7d 0a 0a 66 75 6e 63 |nce(void|)}..func|
|00001940| 74 69 6f 6e 20 69 73 20 | 69 6e 76 6f 6b 65 64 2e |tion is |invoked.|
|00001950| 20 54 68 69 73 20 64 6f | 65 73 20 61 6e 79 20 66 | This do|es any f|
|00001960| 69 6e 61 6c 20 73 65 74 | 75 70 20 61 6e 64 20 69 |inal set|up and i|
|00001970| 6e 64 69 63 61 74 65 73 | 20 74 6f 20 74 68 65 20 |ndicates| to the |
|00001980| 73 79 73 74 65 6d 20 0a | 74 68 61 74 20 6d 75 6c |system .|that mul|
|00001990| 74 69 70 72 6f 63 65 73 | 73 6f 72 20 6d 6f 64 65 |tiproces|sor mode|
|000019a0| 20 69 73 20 6e 6f 77 20 | 61 63 74 69 76 65 2e 20 | is now |active. |
|000019b0| 41 6c 6c 20 74 68 65 20 | 70 72 6f 63 65 73 73 6f |All the |processo|
|000019c0| 72 73 20 73 70 69 6e 6e | 69 6e 67 20 69 6e 20 74 |rs spinn|ing in t|
|000019d0| 68 65 20 0a 73 6d 70 5c | 5f 63 61 6c 6c 69 6e 28 |he .smp\|_callin(|
|000019e0| 29 20 66 75 6e 63 74 69 | 6f 6e 20 61 72 65 20 6e |) functi|on are n|
|000019f0| 6f 77 20 72 65 6c 65 61 | 73 65 64 20 74 6f 20 72 |ow relea|sed to r|
|00001a00| 75 6e 20 74 68 65 20 69 | 64 6c 65 20 70 72 6f 63 |un the i|dle proc|
|00001a10| 65 73 73 65 73 2c 20 77 | 68 69 63 68 20 0a 74 68 |esses, w|hich .th|
|00001a20| 65 79 20 77 69 6c 6c 20 | 72 75 6e 20 77 68 65 6e |ey will |run when|
|00001a30| 20 74 68 65 79 20 68 61 | 76 65 20 6e 6f 20 72 65 | they ha|ve no re|
|00001a40| 61 6c 20 77 6f 72 6b 20 | 74 6f 20 70 72 6f 63 65 |al work |to proce|
|00001a50| 73 73 2e 0a 0a 0a 5c 73 | 75 62 73 75 62 73 65 63 |ss....\s|ubsubsec|
|00001a60| 74 69 6f 6e 7b 53 63 68 | 65 64 75 6c 69 6e 67 7d |tion{Sch|eduling}|
|00001a70| 0a 54 68 65 20 6b 65 72 | 6e 65 6c 20 73 63 68 65 |.The ker|nel sche|
|00001a80| 64 75 6c 65 72 20 69 6d | 70 6c 65 6d 65 6e 74 73 |duler im|plements|
|00001a90| 20 61 20 73 69 6d 70 6c | 65 20 62 75 74 20 76 65 | a simpl|e but ve|
|00001aa0| 72 79 20 61 6e 64 20 65 | 66 66 65 63 74 69 76 65 |ry and e|ffective|
|00001ab0| 20 74 61 73 6b 20 0a 73 | 63 68 65 64 75 6c 65 72 | task .s|cheduler|
|00001ac0| 2e 20 54 68 65 20 62 61 | 73 69 63 20 73 74 72 75 |. The ba|sic stru|
|00001ad0| 63 74 75 72 65 20 6f 66 | 20 74 68 69 73 20 73 63 |cture of| this sc|
|00001ae0| 68 65 64 75 6c 65 72 20 | 69 73 20 75 6e 63 68 61 |heduler |is uncha|
|00001af0| 6e 67 65 64 20 69 6e 20 | 74 68 65 20 0a 6d 75 6c |nged in |the .mul|
|00001b00| 74 69 70 72 6f 63 65 73 | 73 6f 72 20 6b 65 72 6e |tiproces|sor kern|
|00001b10| 65 6c 2e 20 41 20 70 72 | 6f 63 65 73 73 6f 72 20 |el. A pr|ocessor |
|00001b20| 66 69 65 6c 64 20 69 73 | 20 61 64 64 65 64 20 74 |field is| added t|
|00001b30| 6f 20 65 61 63 68 20 74 | 61 73 6b 2c 20 61 6e 64 |o each t|ask, and|
|00001b40| 20 74 68 69 73 20 0a 6d | 61 69 6e 74 61 69 6e 73 | this .m|aintains|
|00001b50| 20 74 68 65 20 6e 75 6d | 62 65 72 20 6f 66 20 74 | the num|ber of t|
|00001b60| 68 65 20 70 72 6f 63 65 | 73 73 6f 72 20 65 78 65 |he proce|ssor exe|
|00001b70| 63 75 74 69 6e 67 20 61 | 20 67 69 76 65 6e 20 74 |cuting a| given t|
|00001b80| 61 73 6b 2c 20 6f 72 20 | 61 20 6d 61 67 69 63 20 |ask, or |a magic |
|00001b90| 0a 63 6f 6e 73 74 61 6e | 74 20 28 4e 4f 5c 5f 50 |.constan|t (NO\_P|
|00001ba0| 52 4f 43 5c 5f 49 44 29 | 20 20 69 6e 64 69 63 61 |ROC\_ID)| indica|
|00001bb0| 74 69 6e 67 20 74 68 65 | 20 6a 6f 62 20 69 73 20 |ting the| job is |
|00001bc0| 6e 6f 74 20 61 6c 6c 6f | 63 61 74 65 64 20 74 6f |not allo|cated to|
|00001bd0| 20 61 20 70 72 6f 63 65 | 73 73 6f 72 2e 20 0a 09 | a proce|ssor. ..|
|00001be0| 20 0a 45 61 63 68 20 70 | 72 6f 63 65 73 73 6f 72 | .Each p|rocessor|
|00001bf0| 20 65 78 65 63 75 74 65 | 73 20 74 68 65 20 73 63 | execute|s the sc|
|00001c00| 68 65 64 75 6c 65 72 20 | 69 74 73 65 6c 66 20 61 |heduler |itself a|
|00001c10| 6e 64 20 77 69 6c 6c 20 | 73 65 6c 65 63 74 20 74 |nd will |select t|
|00001c20| 68 65 20 6e 65 78 74 20 | 74 61 73 6b 20 0a 74 6f |he next |task .to|
|00001c30| 20 72 75 6e 20 66 72 6f | 6d 20 61 6c 6c 20 72 75 | run fro|m all ru|
|00001c40| 6e 6e 61 62 6c 65 20 70 | 72 6f 63 65 73 73 65 73 |nnable p|rocesses|
|00001c50| 20 6e 6f 74 20 61 6c 6c | 6f 63 61 74 65 64 20 74 | not all|ocated t|
|00001c60| 6f 20 61 20 64 69 66 66 | 65 72 65 6e 74 20 70 72 |o a diff|erent pr|
|00001c70| 6f 63 65 73 73 6f 72 2e | 20 0a 54 68 65 20 61 6c |ocessor.| .The al|
|00001c80| 67 6f 72 69 74 68 6d 20 | 75 73 65 64 20 62 79 20 |gorithm |used by |
|00001c90| 74 68 65 20 73 65 6c 65 | 63 74 69 6f 6e 20 69 73 |the sele|ction is|
|00001ca0| 20 6f 74 68 65 72 77 69 | 73 65 20 75 6e 63 68 61 | otherwi|se uncha|
|00001cb0| 6e 67 65 64 2e 20 54 68 | 69 73 20 69 73 20 0a 61 |nged. Th|is is .a|
|00001cc0| 63 74 75 61 6c 6c 79 20 | 69 6e 61 64 65 71 75 61 |ctually |inadequa|
|00001cd0| 74 65 20 66 6f 72 20 74 | 68 65 20 66 69 6e 61 6c |te for t|he final|
|00001ce0| 20 73 79 73 74 65 6d 20 | 62 65 63 61 75 73 65 20 | system |because |
|00001cf0| 74 68 65 72 65 20 61 72 | 65 20 61 64 76 61 6e 74 |there ar|e advant|
|00001d00| 61 67 65 73 20 74 6f 20 | 0a 6b 65 65 70 69 6e 67 |ages to |.keeping|
|00001d10| 20 61 20 70 72 6f 63 65 | 73 73 20 6f 6e 20 74 68 | a proce|ss on th|
|00001d20| 65 20 73 61 6d 65 20 43 | 50 55 2c 20 65 73 70 65 |e same C|PU, espe|
|00001d30| 63 69 61 6c 6c 79 20 6f | 6e 20 70 72 6f 63 65 73 |cially o|n proces|
|00001d40| 73 6f 72 20 62 6f 61 72 | 64 73 20 77 69 74 68 20 |sor boar|ds with |
|00001d50| 70 65 72 20 0a 70 72 6f | 63 65 73 73 6f 72 20 73 |per .pro|cessor s|
|00001d60| 65 63 6f 6e 64 20 6c 65 | 76 65 6c 20 63 61 63 68 |econd le|vel cach|
|00001d70| 65 73 2e 0a 0a 54 68 72 | 6f 75 67 68 6f 75 74 20 |es...Thr|oughout |
|00001d80| 74 68 65 20 6b 65 72 6e | 65 6c 20 74 68 65 20 76 |the kern|el the v|
|00001d90| 61 72 69 61 62 6c 65 20 | 27 63 75 72 72 65 6e 74 |ariable |'current|
|00001da0| 27 20 69 73 20 75 73 65 | 64 20 61 73 20 61 20 67 |' is use|d as a g|
|00001db0| 6c 6f 62 61 6c 20 66 6f | 72 20 74 68 65 20 0a 63 |lobal fo|r the .c|
|00001dc0| 75 72 72 65 6e 74 20 70 | 72 6f 63 65 73 73 2e 20 |urrent p|rocess. |
|00001dd0| 49 6e 20 4c 69 6e 75 78 | 2f 53 4d 50 20 74 68 69 |In Linux|/SMP thi|
|00001de0| 73 20 62 65 63 6f 6d 65 | 73 20 61 20 6d 61 63 72 |s become|s a macr|
|00001df0| 6f 20 77 68 69 63 68 20 | 65 78 70 61 6e 64 73 20 |o which |expands |
|00001e00| 74 6f 20 0a 63 75 72 72 | 65 6e 74 5c 5f 73 65 74 |to .curr|ent\_set|
|00001e10| 5b 73 6d 70 5c 5f 70 72 | 6f 63 65 73 73 6f 72 5c |[smp\_pr|ocessor\|
|00001e20| 5f 69 64 28 29 5d 2e 20 | 54 68 69 73 20 65 6e 61 |_id()]. |This ena|
|00001e30| 62 6c 65 73 20 61 6c 6d | 6f 73 74 20 74 68 65 20 |bles alm|ost the |
|00001e40| 65 6e 74 69 72 65 20 6b | 65 72 6e 65 6c 20 74 6f |entire k|ernel to|
|00001e50| 20 0a 62 65 20 75 6e 61 | 77 61 72 65 20 6f 66 20 | .be una|ware of |
|00001e60| 74 68 65 20 61 72 72 61 | 79 20 6f 66 20 72 75 6e |the arra|y of run|
|00001e70| 6e 69 6e 67 20 70 72 6f | 63 65 73 73 6f 72 73 2c |ning pro|cessors,|
|00001e80| 20 62 75 74 20 73 74 69 | 6c 6c 20 61 6c 6c 6f 77 | but sti|ll allow|
|00001e90| 73 20 74 68 65 20 53 4d | 50 20 0a 61 77 61 72 65 |s the SM|P .aware|
|00001ea0| 20 6b 65 72 6e 65 6c 20 | 6d 6f 64 75 6c 65 73 20 | kernel |modules |
|00001eb0| 74 6f 20 73 65 65 20 61 | 6c 6c 20 6f 66 20 74 68 |to see a|ll of th|
|00001ec0| 65 20 72 75 6e 6e 69 6e | 67 20 70 72 6f 63 65 73 |e runnin|g proces|
|00001ed0| 73 65 73 2e 0a 0a 54 68 | 65 20 66 6f 72 6b 20 73 |ses...Th|e fork s|
|00001ee0| 79 73 74 65 6d 20 63 61 | 6c 6c 20 69 73 20 6d 6f |ystem ca|ll is mo|
|00001ef0| 64 69 66 69 65 64 20 74 | 6f 20 67 65 6e 65 72 61 |dified t|o genera|
|00001f00| 74 65 20 6d 75 6c 74 69 | 70 6c 65 20 70 72 6f 63 |te multi|ple proc|
|00001f10| 65 73 73 65 73 20 77 69 | 74 68 20 61 20 0a 70 72 |esses wi|th a .pr|
|00001f20| 6f 63 65 73 73 20 69 64 | 20 6f 66 20 7a 65 72 6f |ocess id| of zero|
|00001f30| 20 75 6e 74 69 6c 20 74 | 68 65 20 53 4d 50 20 6b | until t|he SMP k|
|00001f40| 65 72 6e 65 6c 20 73 74 | 61 72 74 73 20 75 70 20 |ernel st|arts up |
|00001f50| 70 72 6f 70 65 72 6c 79 | 2e 20 54 68 69 73 20 69 |properly|. This i|
|00001f60| 73 20 0a 6e 65 63 65 73 | 73 61 72 79 20 62 65 63 |s .neces|sary bec|
|00001f70| 61 75 73 65 20 70 72 6f | 63 65 73 73 20 6e 75 6d |ause pro|cess num|
|00001f80| 62 65 72 20 31 20 6d 75 | 73 74 20 62 65 20 69 6e |ber 1 mu|st be in|
|00001f90| 69 74 2c 20 61 6e 64 20 | 69 74 20 69 73 20 64 65 |it, and |it is de|
|00001fa0| 73 69 72 61 62 6c 65 20 | 74 68 61 74 20 0a 61 6c |sirable |that .al|
|00001fb0| 6c 20 74 68 65 20 73 79 | 73 74 65 6d 20 74 68 72 |l the sy|stem thr|
|00001fc0| 65 61 64 73 20 61 72 65 | 20 70 72 6f 63 65 73 73 |eads are| process|
|00001fd0| 20 30 2e 20 0a 0a 54 68 | 65 20 66 69 6e 61 6c 20 | 0. ..Th|e final |
|00001fe0| 61 72 65 61 20 77 69 74 | 68 69 6e 20 74 68 65 20 |area wit|hin the |
|00001ff0| 73 63 68 65 64 75 6c 69 | 6e 67 20 6f 66 20 70 72 |scheduli|ng of pr|
|00002000| 6f 63 65 73 73 65 73 20 | 74 68 61 74 20 64 6f 65 |ocesses |that doe|
|00002010| 73 20 63 61 75 73 65 20 | 70 72 6f 62 6c 65 6d 73 |s cause |problems|
|00002020| 20 0a 69 73 20 74 68 65 | 20 66 61 63 74 20 74 68 | .is the| fact th|
|00002030| 65 20 75 6e 69 70 72 6f | 63 65 73 73 6f 72 20 6b |e unipro|cessor k|
|00002040| 65 72 6e 65 6c 20 68 61 | 72 64 20 63 6f 64 65 73 |ernel ha|rd codes|
|00002050| 20 74 65 73 74 73 20 66 | 6f 72 20 74 68 65 20 69 | tests f|or the i|
|00002060| 64 6c 65 20 74 68 72 65 | 61 64 73 20 0a 61 73 20 |dle thre|ads .as |
|00002070| 74 61 73 6b 5b 30 5d 20 | 61 6e 64 20 74 68 65 20 |task[0] |and the |
|00002080| 69 6e 69 74 20 70 72 6f | 63 65 73 73 20 61 73 20 |init pro|cess as |
|00002090| 74 61 73 6b 5b 31 5d 2e | 20 42 65 63 61 75 73 65 |task[1].| Because|
|000020a0| 20 74 68 65 72 65 20 61 | 72 65 20 6d 75 6c 74 69 | there a|re multi|
|000020b0| 70 6c 65 20 69 64 6c 65 | 20 0a 74 68 72 65 61 64 |ple idle| .thread|
|000020c0| 73 20 69 74 20 69 73 20 | 6e 65 63 65 73 73 61 72 |s it is |necessar|
|000020d0| 79 20 74 6f 20 72 65 70 | 6c 61 63 65 20 74 68 65 |y to rep|lace the|
|000020e0| 73 65 20 77 69 74 68 20 | 74 65 73 74 73 20 74 68 |se with |tests th|
|000020f0| 61 74 20 74 68 65 20 70 | 72 6f 63 65 73 73 20 69 |at the p|rocess i|
|00002100| 64 20 69 73 20 0a 30 20 | 61 6e 64 20 61 20 73 65 |d is .0 |and a se|
|00002110| 61 72 63 68 20 66 6f 72 | 20 70 72 6f 63 65 73 73 |arch for| process|
|00002120| 20 49 44 20 31 2c 20 72 | 65 73 70 65 63 74 69 76 | ID 1, r|espectiv|
|00002130| 65 6c 79 2e 0a 0a 5c 73 | 75 62 73 75 62 73 65 63 |ely...\s|ubsubsec|
|00002140| 74 69 6f 6e 7b 4d 65 6d | 6f 72 79 20 4d 61 6e 61 |tion{Mem|ory Mana|
|00002150| 67 65 6d 65 6e 74 7d 0a | 54 68 65 20 6d 65 6d 6f |gement}.|The memo|
|00002160| 72 79 20 6d 61 6e 61 67 | 65 6d 65 6e 74 20 63 6f |ry manag|ement co|
|00002170| 72 65 20 6f 66 20 74 68 | 65 20 65 78 69 73 74 69 |re of th|e existi|
|00002180| 6e 67 20 4c 69 6e 75 78 | 20 73 79 73 74 65 6d 20 |ng Linux| system |
|00002190| 66 75 6e 63 74 69 6f 6e | 73 20 0a 61 64 65 71 75 |function|s .adequ|
|000021a0| 61 74 65 6c 79 20 77 69 | 74 68 69 6e 20 74 68 65 |ately wi|thin the|
|000021b0| 20 6d 75 6c 74 69 70 72 | 6f 63 65 73 73 6f 72 20 | multipr|ocessor |
|000021c0| 66 72 61 6d 65 77 6f 72 | 6b 20 70 72 6f 76 69 64 |framewor|k provid|
|000021d0| 69 6e 67 20 74 68 65 20 | 6c 6f 63 6b 69 6e 67 20 |ing the |locking |
|000021e0| 69 73 20 0a 75 73 65 64 | 2e 20 43 65 72 74 61 69 |is .used|. Certai|
|000021f0| 6e 20 70 72 6f 63 65 73 | 73 6f 72 20 73 70 65 63 |n proces|sor spec|
|00002200| 69 66 69 63 20 61 72 65 | 61 73 20 64 6f 20 6e 65 |ific are|as do ne|
|00002210| 65 64 20 63 68 61 6e 67 | 69 6e 67 2c 20 69 6e 20 |ed chang|ing, in |
|00002220| 70 61 72 74 69 63 75 6c | 61 72 20 0a 69 6e 76 61 |particul|ar .inva|
|00002230| 6c 69 64 61 74 65 28 29 | 20 6d 75 73 74 20 69 6e |lidate()| must in|
|00002240| 76 61 6c 69 64 61 74 65 | 20 74 68 65 20 54 4c 42 |validate| the TLB|
|00002250| 73 20 6f 66 20 61 6c 6c | 20 70 72 6f 63 65 73 73 |s of all| process|
|00002260| 6f 72 73 20 62 65 66 6f | 72 65 20 69 74 20 72 65 |ors befo|re it re|
|00002270| 74 75 72 6e 73 2e 0a 0a | 0a 5c 73 75 62 73 75 62 |turns...|.\subsub|
|00002280| 73 65 63 74 69 6f 6e 7b | 4d 69 73 63 65 6c 6c 61 |section{|Miscella|
|00002290| 6e 65 6f 75 73 20 46 75 | 6e 63 74 69 6f 6e 73 7d |neous Fu|nctions}|
|000022a0| 0a 54 68 65 20 70 6f 72 | 74 61 62 6c 65 20 53 4d |.The por|table SM|
|000022b0| 50 20 63 6f 64 65 20 72 | 65 73 74 73 20 6f 6e 20 |P code r|ests on |
|000022c0| 61 20 73 6d 61 6c 6c 20 | 73 65 74 20 6f 66 20 66 |a small |set of f|
|000022d0| 75 6e 63 74 69 6f 6e 73 | 20 61 6e 64 20 76 61 72 |unctions| and var|
|000022e0| 69 61 62 6c 65 73 20 0a | 74 68 61 74 20 61 72 65 |iables .|that are|
|000022f0| 20 70 72 6f 76 69 64 65 | 64 20 62 79 20 74 68 65 | provide|d by the|
|00002300| 20 70 72 6f 63 65 73 73 | 6f 72 20 73 70 65 63 69 | process|or speci|
|00002310| 66 69 63 61 74 69 6f 6e | 20 66 75 6e 63 74 69 6f |fication| functio|
|00002320| 6e 61 6c 69 74 79 2e 20 | 54 68 65 73 65 20 61 72 |nality. |These ar|
|00002330| 65 0a 0a 7b 5c 74 74 20 | 5c 62 66 20 69 6e 74 20 |e..{\tt |\bf int |
|00002340| 73 6d 70 5c 5f 70 72 6f | 63 65 73 73 6f 72 5c 5f |smp\_pro|cessor\_|
|00002350| 69 64 28 76 6f 69 64 29 | 20 7d 0a 0a 77 68 69 63 |id(void)| }..whic|
|00002360| 68 20 72 65 74 75 72 6e | 73 20 74 68 65 20 69 64 |h return|s the id|
|00002370| 65 6e 74 69 74 79 20 6f | 66 20 74 68 65 20 70 72 |entity o|f the pr|
|00002380| 6f 63 65 73 73 20 74 68 | 65 20 63 61 6c 6c 20 69 |ocess th|e call i|
|00002390| 73 20 65 78 65 63 75 74 | 65 64 20 75 70 6f 6e 2e |s execut|ed upon.|
|000023a0| 20 54 68 69 73 20 0a 63 | 61 6c 6c 20 69 73 20 61 | This .c|all is a|
|000023b0| 73 73 75 6d 65 64 20 74 | 6f 20 62 65 20 76 61 6c |ssumed t|o be val|
|000023c0| 69 64 20 61 74 20 61 6c | 6c 20 74 69 6d 65 73 2e |id at al|l times.|
|000023d0| 20 54 68 69 73 20 6d 61 | 79 20 6d 65 61 6e 20 61 | This ma|y mean a|
|000023e0| 64 64 69 74 69 6f 6e 61 | 6c 20 74 65 73 74 73 20 |dditiona|l tests |
|000023f0| 0a 61 72 65 20 6e 65 65 | 64 65 64 20 64 75 72 69 |.are nee|ded duri|
|00002400| 6e 67 20 69 6e 69 74 69 | 61 6c 69 73 61 74 69 6f |ng initi|alisatio|
|00002410| 6e 2e 0a 0a 0a 7b 5c 74 | 74 20 5c 62 66 20 69 6e |n....{\t|t \bf in|
|00002420| 74 20 73 6d 70 5c 5f 6e | 75 6d 5c 5f 63 70 75 73 |t smp\_n|um\_cpus|
|00002430| 3b 7d 0a 0a 54 68 69 73 | 20 69 73 20 74 68 65 20 |;}..This| is the |
|00002440| 6e 75 6d 62 65 72 20 6f | 66 20 70 72 6f 63 65 73 |number o|f proces|
|00002450| 73 6f 72 73 20 69 6e 20 | 74 68 65 20 73 79 73 74 |sors in |the syst|
|00002460| 65 6d 2e 20 5c 0a 0a 7b | 5c 74 74 20 5c 62 66 20 |em. \..{|\tt \bf |
|00002470| 76 6f 69 64 20 73 6d 70 | 5c 5f 6d 65 73 73 61 67 |void smp|\_messag|
|00002480| 65 5c 5f 70 61 73 73 28 | 69 6e 74 20 74 61 72 67 |e\_pass(|int targ|
|00002490| 65 74 2c 20 69 6e 74 20 | 6d 73 67 2c 20 75 6e 73 |et, int |msg, uns|
|000024a0| 69 67 6e 65 64 20 6c 6f | 6e 67 20 64 61 74 61 2c |igned lo|ng data,|
|000024b0| 0a 09 09 69 6e 74 20 77 | 61 69 74 29 7d 0a 0a 54 |...int w|ait)}..T|
|000024c0| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 20 70 61 73 |his func|tion pas|
|000024d0| 73 65 73 20 6d 65 73 73 | 61 67 65 73 20 62 65 74 |ses mess|ages bet|
|000024e0| 77 65 65 6e 20 70 72 6f | 63 65 73 73 6f 72 73 2e |ween pro|cessors.|
|000024f0| 20 41 74 20 74 68 65 20 | 6d 6f 6d 65 6e 74 20 69 | At the |moment i|
|00002500| 74 20 69 73 20 6e 6f 74 | 20 0a 73 75 66 66 69 63 |t is not| .suffic|
|00002510| 69 65 6e 74 6c 79 20 64 | 65 66 69 6e 65 64 20 74 |iently d|efined t|
|00002520| 6f 20 73 65 6e 73 69 62 | 6c 79 20 64 6f 63 75 6d |o sensib|ly docum|
|00002530| 65 6e 74 20 61 6e 64 20 | 6e 65 65 64 73 20 63 6c |ent and |needs cl|
|00002540| 65 61 6e 69 6e 67 20 75 | 70 20 61 6e 64 20 66 75 |eaning u|p and fu|
|00002550| 72 74 68 65 72 20 0a 77 | 6f 72 6b 2e 20 52 65 66 |rther .w|ork. Ref|
|00002560| 65 72 20 74 6f 20 74 68 | 65 20 70 72 6f 63 65 73 |er to th|e proces|
|00002570| 73 6f 72 20 73 70 65 63 | 69 66 69 63 20 63 6f 64 |sor spec|ific cod|
|00002580| 65 20 64 6f 63 75 6d 65 | 6e 74 61 74 69 6f 6e 20 |e docume|ntation |
|00002590| 66 6f 72 20 6d 6f 72 65 | 20 64 65 74 61 69 6c 73 |for more| details|
|000025a0| 2e 0a 0a 0a 5c 73 75 62 | 73 65 63 74 69 6f 6e 7b |....\sub|section{|
|000025b0| 41 72 63 68 69 74 65 63 | 74 75 72 65 20 53 70 65 |Architec|ture Spe|
|000025c0| 63 69 66 69 63 20 43 6f | 64 65 20 46 6f 72 20 74 |cific Co|de For t|
|000025d0| 68 65 20 49 6e 74 65 6c | 20 4d 50 20 50 6f 72 74 |he Intel| MP Port|
|000025e0| 7d 0a 54 68 65 20 61 72 | 63 68 69 74 65 63 74 75 |}.The ar|chitectu|
|000025f0| 72 65 20 73 70 65 63 69 | 66 69 63 20 63 6f 64 65 |re speci|fic code|
|00002600| 20 66 6f 72 20 74 68 65 | 20 69 6e 74 65 6c 20 70 | for the| intel p|
|00002610| 6f 72 74 20 73 70 6c 69 | 74 73 20 66 61 69 72 6c |ort spli|ts fairl|
|00002620| 79 20 63 6c 65 61 6e 6c | 79 20 0a 69 6e 74 6f 20 |y cleanl|y .into |
|00002630| 66 6f 75 72 20 73 65 63 | 74 69 6f 6e 73 2e 20 46 |four sec|tions. F|
|00002640| 69 72 73 74 6c 79 20 74 | 68 65 20 69 6e 69 74 69 |irstly t|he initi|
|00002650| 61 6c 69 73 61 74 69 6f | 6e 20 63 6f 64 65 20 75 |alisatio|n code u|
|00002660| 73 65 64 20 74 6f 20 62 | 6f 6f 74 20 74 68 65 20 |sed to b|oot the |
|00002670| 0a 73 79 73 74 65 6d 2c | 20 73 65 63 6f 6e 64 6c |.system,| secondl|
|00002680| 79 20 74 68 65 20 6d 65 | 73 73 61 67 65 20 68 61 |y the me|ssage ha|
|00002690| 6e 64 6c 69 6e 67 20 61 | 6e 64 20 73 75 70 70 6f |ndling a|nd suppo|
|000026a0| 72 74 20 63 6f 64 65 2c | 20 74 68 69 72 64 6c 79 |rt code,| thirdly|
|000026b0| 20 74 68 65 20 0a 69 6e | 74 65 72 72 75 70 74 20 | the .in|terrupt |
|000026c0| 61 6e 64 20 6b 65 72 6e | 65 6c 20 73 79 73 63 61 |and kern|el sysca|
|000026d0| 6c 6c 20 65 6e 74 72 79 | 20 66 75 6e 63 74 69 6f |ll entry| functio|
|000026e0| 6e 20 68 61 6e 64 6c 69 | 6e 67 20 61 6e 64 20 66 |n handli|ng and f|
|000026f0| 69 6e 61 6c 6c 79 20 74 | 68 65 20 0a 65 78 74 65 |inally t|he .exte|
|00002700| 6e 73 69 6f 6e 73 20 74 | 6f 20 73 74 61 6e 64 61 |nsions t|o standa|
|00002710| 72 64 20 6b 65 72 6e 65 | 6c 20 66 61 63 69 6c 69 |rd kerne|l facili|
|00002720| 74 69 65 73 20 74 6f 20 | 63 6f 70 65 20 77 69 74 |ties to |cope wit|
|00002730| 68 20 6d 75 6c 74 69 70 | 6c 65 20 70 72 6f 63 65 |h multip|le proce|
|00002740| 73 73 6f 72 73 2e 0a 0a | 5c 73 75 62 73 75 62 73 |ssors...|\subsubs|
|00002750| 65 63 74 69 6f 6e 7b 49 | 6e 69 74 69 61 6c 69 73 |ection{I|nitialis|
|00002760| 61 74 69 6f 6e 7d 09 0a | 54 68 65 20 49 6e 74 65 |ation}..|The Inte|
|00002770| 6c 20 4d 50 20 61 72 63 | 68 69 74 65 63 74 75 72 |l MP arc|hitectur|
|00002780| 65 20 63 61 70 74 75 72 | 65 73 20 61 6c 6c 20 74 |e captur|es all t|
|00002790| 68 65 20 70 72 6f 63 65 | 73 73 6f 72 73 20 65 78 |he proce|ssors ex|
|000027a0| 63 65 70 74 20 66 6f 72 | 20 61 20 73 69 6e 67 6c |cept for| a singl|
|000027b0| 65 20 0a 70 72 6f 63 65 | 73 73 6f 72 20 6b 6e 6f |e .proce|ssor kno|
|000027c0| 77 6e 20 61 73 20 74 68 | 65 20 27 62 6f 6f 74 20 |wn as th|e 'boot |
|000027d0| 70 72 6f 63 65 73 73 6f | 72 27 20 69 6e 20 74 68 |processo|r' in th|
|000027e0| 65 20 42 49 4f 53 20 61 | 74 20 62 6f 6f 74 20 74 |e BIOS a|t boot t|
|000027f0| 69 6d 65 2e 20 54 68 75 | 73 20 61 20 0a 73 69 6e |ime. Thu|s a .sin|
|00002800| 67 6c 65 20 70 72 6f 63 | 65 73 73 6f 72 20 65 6e |gle proc|essor en|
|00002810| 74 65 72 73 20 74 68 65 | 20 6b 65 72 6e 65 6c 20 |ters the| kernel |
|00002820| 62 6f 6f 74 75 70 20 63 | 6f 64 65 2e 20 54 68 65 |bootup c|ode. The|
|00002830| 20 66 69 72 73 74 20 70 | 72 6f 63 65 73 73 6f 72 | first p|rocessor|
|00002840| 20 0a 65 78 65 63 75 74 | 65 73 20 74 68 65 20 62 | .execut|es the b|
|00002850| 6f 6f 74 73 74 72 61 70 | 20 63 6f 64 65 2c 20 6c |ootstrap| code, l|
|00002860| 6f 61 64 73 20 61 6e 64 | 20 75 6e 63 6f 6d 70 72 |oads and| uncompr|
|00002870| 65 73 73 65 73 20 74 68 | 65 20 6b 65 72 6e 65 6c |esses th|e kernel|
|00002880| 2e 20 48 61 76 69 6e 67 | 20 0a 75 6e 70 61 63 6b |. Having| .unpack|
|00002890| 65 64 20 74 68 65 20 6b | 65 72 6e 65 6c 20 69 74 |ed the k|ernel it|
|000028a0| 20 73 65 74 73 20 75 70 | 20 74 68 65 20 70 61 67 | sets up| the pag|
|000028b0| 69 6e 67 20 61 6e 64 20 | 63 6f 6e 74 72 6f 6c 20 |ing and |control |
|000028c0| 72 65 67 69 73 74 65 72 | 73 20 74 68 65 6e 20 65 |register|s then e|
|000028d0| 6e 74 65 72 73 20 0a 74 | 68 65 20 43 20 6b 65 72 |nters .t|he C ker|
|000028e0| 6e 65 6c 20 73 74 61 72 | 74 75 70 2e 0a 0a 54 68 |nel star|tup...Th|
|000028f0| 65 20 61 73 73 65 6d 62 | 6c 65 72 20 73 74 61 72 |e assemb|ler star|
|00002900| 74 75 70 20 63 6f 64 65 | 20 66 6f 72 20 74 68 65 |tup code| for the|
|00002910| 20 6b 65 72 6e 65 6c 20 | 69 73 20 6d 6f 64 69 66 | kernel |is modif|
|00002920| 69 65 64 20 73 6f 20 74 | 68 61 74 20 69 74 20 63 |ied so t|hat it c|
|00002930| 61 6e 20 62 65 20 0a 75 | 73 65 64 20 62 79 20 74 |an be .u|sed by t|
|00002940| 68 65 20 6f 74 68 65 72 | 20 70 72 6f 63 65 73 73 |he other| process|
|00002950| 6f 72 73 20 74 6f 20 64 | 6f 20 74 68 65 20 70 72 |ors to d|o the pr|
|00002960| 6f 63 65 73 73 6f 72 20 | 69 64 65 6e 74 69 66 69 |ocessor |identifi|
|00002970| 63 61 74 69 6f 6e 20 61 | 6e 64 20 76 61 72 69 6f |cation a|nd vario|
|00002980| 75 73 20 0a 6f 74 68 65 | 72 20 6c 6f 77 20 6c 65 |us .othe|r low le|
|00002990| 76 65 6c 20 63 6f 6e 66 | 69 67 75 72 61 74 69 6f |vel conf|iguratio|
|000029a0| 6e 73 20 62 75 74 20 64 | 6f 65 73 20 6e 6f 74 20 |ns but d|oes not |
|000029b0| 65 78 65 63 75 74 65 20 | 74 68 6f 73 65 20 70 61 |execute |those pa|
|000029c0| 72 74 73 20 6f 66 20 74 | 68 65 20 0a 73 74 61 72 |rts of t|he .star|
|000029d0| 74 75 70 20 63 6f 64 65 | 20 74 68 61 74 20 77 6f |tup code| that wo|
|000029e0| 75 6c 64 20 64 61 6d 61 | 67 65 20 74 68 65 20 72 |uld dama|ge the r|
|000029f0| 75 6e 6e 69 6e 67 20 73 | 79 73 74 65 6d 20 28 73 |unning s|ystem (s|
|00002a00| 75 63 68 20 61 73 20 63 | 6c 65 61 72 69 6e 67 20 |uch as c|learing |
|00002a10| 74 68 65 20 42 53 53 20 | 0a 73 65 67 6d 65 6e 74 |the BSS |.segment|
|00002a20| 29 2e 20 0a 0a 49 6e 20 | 74 68 65 20 69 6e 69 74 |). ..In |the init|
|00002a30| 69 61 6c 69 73 61 74 69 | 6f 6e 20 64 6f 6e 65 20 |ialisati|on done |
|00002a40| 62 79 20 74 68 65 20 66 | 69 72 73 74 20 70 72 6f |by the f|irst pro|
|00002a50| 63 65 73 73 6f 72 20 74 | 68 65 20 61 72 63 68 2f |cessor t|he arch/|
|00002a60| 69 33 38 36 2f 6d 6d 2f | 69 6e 69 74 20 0a 63 6f |i386/mm/|init .co|
|00002a70| 64 65 20 69 73 20 6d 6f | 64 69 66 69 65 64 20 74 |de is mo|dified t|
|00002a80| 6f 20 73 63 61 6e 20 74 | 68 65 20 6c 6f 77 20 70 |o scan t|he low p|
|00002a90| 61 67 65 2c 20 74 6f 70 | 20 70 61 67 65 20 61 6e |age, top| page an|
|00002aa0| 64 20 42 49 4f 53 20 66 | 6f 72 20 69 6e 74 65 6c |d BIOS f|or intel|
|00002ab0| 20 4d 50 20 0a 73 69 67 | 6e 61 74 75 72 65 20 62 | MP .sig|nature b|
|00002ac0| 6c 6f 63 6b 73 2e 20 54 | 68 69 73 20 69 73 20 6e |locks. T|his is n|
|00002ad0| 65 63 65 73 73 61 72 79 | 20 62 65 63 61 75 73 65 |ecessary| because|
|00002ae0| 20 74 68 65 20 4d 50 20 | 73 69 67 6e 61 74 75 72 | the MP |signatur|
|00002af0| 65 20 62 6c 6f 63 6b 73 | 20 6d 75 73 74 20 0a 62 |e blocks| must .b|
|00002b00| 65 20 72 65 61 64 20 61 | 6e 64 20 70 72 6f 63 65 |e read a|nd proce|
|00002b10| 73 73 65 64 20 62 65 66 | 6f 72 65 20 74 68 65 20 |ssed bef|ore the |
|00002b20| 6b 65 72 6e 65 6c 20 69 | 73 20 61 6c 6c 6f 77 65 |kernel i|s allowe|
|00002b30| 64 20 74 6f 20 61 6c 6c | 6f 63 61 74 65 20 61 6e |d to all|ocate an|
|00002b40| 64 20 64 65 73 74 72 6f | 79 20 0a 74 68 65 20 70 |d destro|y .the p|
|00002b50| 61 67 65 20 61 74 20 74 | 68 65 20 74 6f 70 20 6f |age at t|he top o|
|00002b60| 66 20 6c 6f 77 20 6d 65 | 6d 6f 72 79 2e 20 48 61 |f low me|mory. Ha|
|00002b70| 76 69 6e 67 20 65 73 74 | 61 62 6c 69 73 68 65 64 |ving est|ablished|
|00002b80| 20 74 68 65 20 6e 75 6d | 62 65 72 20 6f 66 20 0a | the num|ber of .|
|00002b90| 70 72 6f 63 65 73 73 6f | 72 73 20 69 74 20 72 65 |processo|rs it re|
|00002ba0| 73 65 72 76 65 73 20 61 | 20 73 65 74 20 6f 66 20 |serves a| set of |
|00002bb0| 70 61 67 65 73 20 74 6f | 20 70 72 6f 76 69 64 65 |pages to| provide|
|00002bc0| 20 61 20 73 74 61 63 6b | 20 63 6f 6d 65 20 62 6f | a stack| come bo|
|00002bd0| 6f 74 20 75 70 20 61 72 | 65 61 20 0a 66 6f 72 20 |ot up ar|ea .for |
|00002be0| 65 61 63 68 20 70 72 6f | 63 65 73 73 6f 72 20 69 |each pro|cessor i|
|00002bf0| 6e 20 74 68 65 20 73 79 | 73 74 65 6d 2e 20 54 68 |n the sy|stem. Th|
|00002c00| 65 73 65 20 6d 75 73 74 | 20 62 65 20 61 6c 6c 6f |ese must| be allo|
|00002c10| 63 61 74 65 64 20 61 74 | 20 73 74 61 72 74 75 70 |cated at| startup|
|00002c20| 20 74 6f 20 0a 65 6e 73 | 75 72 65 20 74 68 65 79 | to .ens|ure they|
|00002c30| 20 66 61 6c 6c 20 62 65 | 6c 6f 77 20 74 68 65 20 | fall be|low the |
|00002c40| 31 4d 62 20 62 6f 75 6e | 64 61 72 79 2e 0a 0a 46 |1Mb boun|dary...F|
|00002c50| 75 72 74 68 65 72 20 70 | 72 6f 63 65 73 73 6f 72 |urther p|rocessor|
|00002c60| 73 20 61 72 65 20 73 74 | 61 72 74 65 64 20 75 70 |s are st|arted up|
|00002c70| 20 69 6e 20 73 6d 70 5c | 5f 62 6f 6f 74 5c 5f 63 | in smp\|_boot\_c|
|00002c80| 70 75 73 28 29 20 62 79 | 20 70 72 6f 67 72 61 6d |pus() by| program|
|00002c90| 6d 69 6e 67 20 74 68 65 | 20 0a 41 50 49 43 20 63 |ming the| .APIC c|
|00002ca0| 6f 6e 74 72 6f 6c 6c 65 | 72 20 72 65 67 69 73 74 |ontrolle|r regist|
|00002cb0| 65 72 73 20 61 6e 64 20 | 73 65 6e 64 69 6e 67 20 |ers and |sending |
|00002cc0| 61 6e 20 69 6e 74 65 72 | 2d 70 72 6f 63 65 73 73 |an inter|-process|
|00002cd0| 6f 72 20 69 6e 74 65 72 | 72 75 70 74 20 28 49 50 |or inter|rupt (IP|
|00002ce0| 49 29 20 74 6f 20 0a 74 | 68 65 20 70 72 6f 63 65 |I) to .t|he proce|
|00002cf0| 73 73 6f 72 2e 20 54 68 | 69 73 20 6d 65 73 73 61 |ssor. Th|is messa|
|00002d00| 67 65 20 63 61 75 73 65 | 73 20 74 68 65 20 74 61 |ge cause|s the ta|
|00002d10| 72 67 65 74 20 70 72 6f | 63 65 73 73 6f 72 20 74 |rget pro|cessor t|
|00002d20| 6f 20 62 65 67 69 6e 20 | 65 78 65 63 75 74 69 6e |o begin |executin|
|00002d30| 67 20 0a 63 6f 64 65 20 | 61 74 20 74 68 65 20 73 |g .code |at the s|
|00002d40| 74 61 72 74 20 6f 66 20 | 61 6e 79 20 70 61 67 65 |tart of |any page|
|00002d50| 20 6f 66 20 6d 65 6d 6f | 72 79 20 77 69 74 68 69 | of memo|ry withi|
|00002d60| 6e 20 74 68 65 20 6c 6f | 77 65 73 74 20 31 4d 62 |n the lo|west 1Mb|
|00002d70| 2c 20 69 6e 20 31 36 62 | 69 74 20 0a 72 65 61 6c |, in 16b|it .real|
|00002d80| 20 6d 6f 64 65 2e 20 54 | 68 65 20 6b 65 72 6e 65 | mode. T|he kerne|
|00002d90| 6c 20 75 73 65 73 20 74 | 68 65 20 73 69 6e 67 6c |l uses t|he singl|
|00002da0| 65 20 70 61 67 65 20 69 | 74 20 61 6c 6c 6f 63 61 |e page i|t alloca|
|00002db0| 74 65 64 20 66 6f 72 20 | 65 61 63 68 20 70 72 6f |ted for |each pro|
|00002dc0| 63 65 73 73 6f 72 20 0a | 74 6f 20 75 73 65 20 61 |cessor .|to use a|
|00002dd0| 73 20 73 74 61 63 6b 2e | 20 42 65 66 6f 72 65 20 |s stack.| Before |
|00002de0| 62 6f 6f 74 69 6e 67 20 | 61 20 67 69 76 65 6e 20 |booting |a given |
|00002df0| 43 50 55 20 74 68 65 20 | 72 65 6c 6f 63 61 74 61 |CPU the |relocata|
|00002e00| 62 6c 65 20 63 6f 64 65 | 20 66 72 6f 6d 20 0a 74 |ble code| from .t|
|00002e10| 72 61 6d 70 6f 6c 69 6e | 65 2e 53 20 61 6e 64 20 |rampolin|e.S and |
|00002e20| 74 72 61 6d 70 6f 6c 69 | 6e 65 33 32 2e 53 20 69 |trampoli|ne32.S i|
|00002e30| 73 20 63 6f 70 69 65 64 | 20 74 6f 20 74 68 65 20 |s copied| to the |
|00002e40| 62 6f 74 74 6f 6d 20 6f | 66 20 69 74 73 20 73 74 |bottom o|f its st|
|00002e50| 61 63 6b 20 70 61 67 65 | 20 0a 61 6e 64 20 75 73 |ack page| .and us|
|00002e60| 65 64 20 61 73 20 74 68 | 65 20 74 61 72 67 65 74 |ed as th|e target|
|00002e70| 20 66 6f 72 20 74 68 65 | 20 73 74 61 72 74 75 70 | for the| startup|
|00002e80| 2e 20 0a 0a 54 68 65 20 | 74 72 61 6d 70 6f 6c 69 |. ..The |trampoli|
|00002e90| 6e 65 20 63 6f 64 65 20 | 63 61 6c 63 75 6c 61 74 |ne code |calculat|
|00002ea0| 65 73 20 74 68 65 20 64 | 65 73 69 72 65 64 20 73 |es the d|esired s|
|00002eb0| 74 61 63 6b 20 62 61 73 | 65 20 66 72 6f 6d 20 74 |tack bas|e from t|
|00002ec0| 68 65 20 63 6f 64 65 20 | 0a 73 65 67 6d 65 6e 74 |he code |.segment|
|00002ed0| 20 28 73 69 6e 63 65 20 | 74 68 65 20 63 6f 64 65 | (since |the code|
|00002ee0| 20 73 65 67 6d 65 6e 74 | 20 6f 6e 20 73 74 61 72 | segment| on star|
|00002ef0| 74 75 70 20 69 73 20 74 | 68 65 20 62 6f 74 74 6f |tup is t|he botto|
|00002f00| 6d 20 6f 66 20 74 68 65 | 20 73 74 61 63 6b 29 2c |m of the| stack),|
|00002f10| 20 0a 20 65 6e 74 65 72 | 73 20 33 32 62 69 74 20 | . enter|s 32bit |
|00002f20| 6d 6f 64 65 20 61 6e 64 | 20 6a 75 6d 70 73 20 74 |mode and| jumps t|
|00002f30| 6f 20 74 68 65 20 6b 65 | 72 6e 65 6c 20 65 6e 74 |o the ke|rnel ent|
|00002f40| 72 79 20 61 73 73 65 6d | 62 6c 65 72 2e 20 54 68 |ry assem|bler. Th|
|00002f50| 69 73 20 61 73 20 0a 64 | 65 73 63 72 69 62 65 64 |is as .d|escribed|
|00002f60| 20 61 62 6f 76 65 20 69 | 73 20 6d 6f 64 69 66 69 | above i|s modifi|
|00002f70| 65 64 20 74 6f 20 6f 6e | 6c 79 20 65 78 65 63 75 |ed to on|ly execu|
|00002f80| 74 65 20 74 68 65 20 70 | 61 72 74 73 20 6e 65 63 |te the p|arts nec|
|00002f90| 65 73 73 61 72 79 20 66 | 6f 72 20 65 61 63 68 20 |essary f|or each |
|00002fa0| 0a 70 72 6f 63 65 73 73 | 6f 72 2c 20 61 6e 64 20 |.process|or, and |
|00002fb0| 74 68 65 6e 20 74 6f 20 | 65 6e 74 65 72 20 73 74 |then to |enter st|
|00002fc0| 61 72 74 5c 5f 6b 65 72 | 6e 65 6c 28 29 2e 20 4f |art\_ker|nel(). O|
|00002fd0| 6e 20 65 6e 74 65 72 69 | 6e 67 20 74 68 65 20 6b |n enteri|ng the k|
|00002fe0| 65 72 6e 65 6c 20 74 68 | 65 20 0a 70 72 6f 63 65 |ernel th|e .proce|
|00002ff0| 73 73 6f 72 20 69 6e 69 | 74 69 61 6c 69 73 65 73 |ssor ini|tialises|
|00003000| 20 69 74 73 20 74 72 61 | 70 20 61 6e 64 20 69 6e | its tra|p and in|
|00003010| 74 65 72 72 75 70 74 20 | 68 61 6e 64 6c 65 72 73 |terrupt |handlers|
|00003020| 20 62 65 66 6f 72 65 20 | 65 6e 74 65 72 69 6e 67 | before |entering|
|00003030| 20 0a 73 6d 70 5c 5f 63 | 61 6c 6c 69 6e 28 29 2c | .smp\_c|allin(),|
|00003040| 20 77 68 65 72 65 20 69 | 74 20 72 65 70 6f 72 74 | where i|t report|
|00003050| 73 20 69 74 73 20 73 74 | 61 74 75 73 20 61 6e 64 |s its st|atus and|
|00003060| 20 73 65 74 73 20 61 20 | 66 6c 61 67 20 74 68 61 | sets a |flag tha|
|00003070| 74 20 63 61 75 73 65 73 | 20 74 68 65 20 0a 62 6f |t causes| the .bo|
|00003080| 6f 74 20 70 72 6f 63 65 | 73 73 6f 72 20 74 6f 20 |ot proce|ssor to |
|00003090| 63 6f 6e 74 69 6e 75 65 | 20 61 6e 64 20 6c 6f 6f |continue| and loo|
|000030a0| 6b 20 66 6f 72 20 66 75 | 72 74 68 65 72 20 70 72 |k for fu|rther pr|
|000030b0| 6f 63 65 73 73 6f 72 73 | 2e 20 54 68 65 20 70 72 |ocessors|. The pr|
|000030c0| 6f 63 65 73 73 6f 72 20 | 0a 74 68 65 6e 20 73 70 |ocessor |.then sp|
|000030d0| 69 6e 73 20 75 6e 74 69 | 6c 20 73 6d 70 5c 5f 63 |ins unti|l smp\_c|
|000030e0| 6f 6d 6d 65 6e 63 65 28 | 29 20 69 73 20 69 6e 76 |ommence(|) is inv|
|000030f0| 6f 6b 65 64 2e 0a 0a 48 | 61 76 69 6e 67 20 73 74 |oked...H|aving st|
|00003100| 61 72 74 65 64 20 65 61 | 63 68 20 70 72 6f 63 65 |arted ea|ch proce|
|00003110| 73 73 6f 72 20 75 70 20 | 74 68 65 20 73 6d 70 5c |ssor up |the smp\|
|00003120| 5f 63 6f 6d 6d 65 6e 63 | 65 28 20 29 20 66 75 6e |_commenc|e( ) fun|
|00003130| 63 74 69 6f 6e 20 66 6c | 69 70 73 20 61 20 0a 66 |ction fl|ips a .f|
|00003140| 6c 61 67 2e 20 45 61 63 | 68 20 70 72 6f 63 65 73 |lag. Eac|h proces|
|00003150| 73 6f 72 20 73 70 69 6e | 6e 69 6e 67 20 69 6e 20 |sor spin|ning in |
|00003160| 73 6d 70 5c 5f 63 61 6c | 6c 69 6e 28 29 20 74 68 |smp\_cal|lin() th|
|00003170| 65 6e 20 6c 6f 61 64 73 | 20 74 68 65 20 74 61 73 |en loads| the tas|
|00003180| 6b 20 72 65 67 69 73 74 | 65 72 20 0a 77 69 74 68 |k regist|er .with|
|00003190| 20 74 68 65 20 74 61 73 | 6b 20 73 74 61 74 65 20 | the tas|k state |
|000031a0| 73 65 67 6d 65 6e 74 20 | 28 54 53 53 29 20 6f 66 |segment |(TSS) of|
|000031b0| 20 69 74 73 20 69 64 6c | 65 20 74 68 72 65 61 64 | its idl|e thread|
|000031c0| 20 61 73 20 69 73 20 6e | 65 65 64 65 64 20 66 6f | as is n|eeded fo|
|000031d0| 72 20 74 61 73 6b 20 0a | 73 77 69 74 63 68 69 6e |r task .|switchin|
|000031e0| 67 2e 0a 0a 5c 73 75 62 | 73 75 62 73 65 63 74 69 |g...\sub|subsecti|
|000031f0| 6f 6e 7b 4d 65 73 73 61 | 67 65 20 48 61 6e 64 6c |on{Messa|ge Handl|
|00003200| 69 6e 67 20 61 6e 64 20 | 53 75 70 70 6f 72 74 20 |ing and |Support |
|00003210| 43 6f 64 65 7d 0a 54 68 | 65 20 61 72 63 68 69 74 |Code}.Th|e archit|
|00003220| 65 63 74 75 72 65 20 73 | 70 65 63 69 66 69 63 20 |ecture s|pecific |
|00003230| 63 6f 64 65 20 69 6d 70 | 6c 65 6d 65 6e 74 73 20 |code imp|lements |
|00003240| 74 68 65 20 73 6d 70 5c | 5f 70 72 6f 63 65 73 73 |the smp\|_process|
|00003250| 6f 72 5c 5f 69 64 28 29 | 20 66 75 6e 63 74 69 6f |or\_id()| functio|
|00003260| 6e 20 0a 62 79 20 71 75 | 65 72 79 69 6e 67 20 74 |n .by qu|erying t|
|00003270| 68 65 20 41 50 49 43 20 | 6c 6f 67 69 63 61 6c 20 |he APIC |logical |
|00003280| 69 64 65 6e 74 69 74 79 | 20 72 65 67 69 73 74 65 |identity| registe|
|00003290| 72 2e 20 42 65 63 61 75 | 73 65 20 74 68 65 20 41 |r. Becau|se the A|
|000032a0| 50 49 43 20 69 73 6e 27 | 74 20 0a 6d 61 70 70 65 |PIC isn'|t .mappe|
|000032b0| 64 20 69 6e 74 6f 20 74 | 68 65 20 6b 65 72 6e 65 |d into t|he kerne|
|000032c0| 6c 20 61 64 64 72 65 73 | 73 20 73 70 61 63 65 20 |l addres|s space |
|000032d0| 61 74 20 62 6f 6f 74 2c | 20 74 68 65 20 69 6e 69 |at boot,| the ini|
|000032e0| 74 69 61 6c 20 76 61 6c | 75 65 20 72 65 74 75 72 |tial val|ue retur|
|000032f0| 6e 65 64 20 69 73 20 0a | 72 69 67 67 65 64 20 62 |ned is .|rigged b|
|00003300| 79 20 73 65 74 74 69 6e | 67 20 74 68 65 20 41 50 |y settin|g the AP|
|00003310| 49 43 20 62 61 73 65 20 | 70 6f 69 6e 74 65 72 20 |IC base |pointer |
|00003320| 74 6f 20 70 6f 69 6e 74 | 20 61 74 20 61 20 73 75 |to point| at a su|
|00003330| 69 74 61 62 6c 65 20 63 | 6f 6e 73 74 61 6e 74 2e |itable c|onstant.|
|00003340| 20 0a 4f 6e 63 65 20 74 | 68 65 20 73 79 73 74 65 | .Once t|he syste|
|00003350| 6d 20 73 74 61 72 74 73 | 20 64 6f 69 6e 67 20 74 |m starts| doing t|
|00003360| 68 65 20 53 4d 50 20 73 | 65 74 75 70 20 28 69 6e |he SMP s|etup (in|
|00003370| 20 73 6d 70 5c 5f 62 6f | 6f 74 5c 5f 63 70 75 73 | smp\_bo|ot\_cpus|
|00003380| 28 29 29 2c 20 74 68 65 | 20 41 50 49 43 20 0a 69 |()), the| APIC .i|
|00003390| 73 20 6d 61 70 70 65 64 | 20 77 69 74 68 20 61 20 |s mapped| with a |
|000033a0| 76 72 65 6d 61 70 28 29 | 20 63 61 6c 6c 20 61 6e |vremap()| call an|
|000033b0| 64 20 74 68 65 20 61 70 | 69 63 20 70 6f 69 6e 74 |d the ap|ic point|
|000033c0| 65 72 20 69 73 20 61 64 | 6a 75 73 74 65 64 20 0a |er is ad|justed .|
|000033d0| 61 70 70 72 6f 70 72 69 | 61 74 65 6c 79 2e 20 46 |appropri|ately. F|
|000033e0| 72 6f 6d 20 74 68 65 6e | 20 6f 6e 20 74 68 65 20 |rom then| on the |
|000033f0| 72 65 61 6c 20 41 50 49 | 43 20 6c 6f 67 69 63 61 |real API|C logica|
|00003400| 6c 20 69 64 65 6e 74 69 | 74 79 20 72 65 67 69 73 |l identi|ty regis|
|00003410| 74 65 72 20 69 73 20 0a | 72 65 61 64 2e 0a 0a 4d |ter is .|read...M|
|00003420| 65 73 73 61 67 65 20 70 | 61 73 73 69 6e 67 20 69 |essage p|assing i|
|00003430| 73 20 61 63 63 6f 6d 70 | 6c 69 73 68 65 64 20 75 |s accomp|lished u|
|00003440| 73 69 6e 67 20 61 20 70 | 61 69 72 20 6f 66 20 49 |sing a p|air of I|
|00003450| 50 49 73 20 6f 6e 20 69 | 6e 74 65 72 72 75 70 74 |PIs on i|nterrupt|
|00003460| 20 31 33 20 0a 28 75 6e | 75 73 65 64 20 62 79 20 | 13 .(un|used by |
|00003470| 74 68 65 20 38 30 34 38 | 36 20 46 50 55 73 20 69 |the 8048|6 FPUs i|
|00003480| 6e 20 53 4d 50 20 6d 6f | 64 65 29 20 61 6e 64 20 |n SMP mo|de) and |
|00003490| 69 6e 74 65 72 72 75 70 | 74 20 31 36 2e 20 54 77 |interrup|t 16. Tw|
|000034a0| 6f 20 61 72 65 20 75 73 | 65 64 20 69 6e 20 0a 6f |o are us|ed in .o|
|000034b0| 72 64 65 72 20 74 6f 20 | 73 65 70 61 72 61 74 65 |rder to |separate|
|000034c0| 20 6d 65 73 73 61 67 65 | 73 20 74 68 61 74 20 63 | message|s that c|
|000034d0| 61 6e 6e 6f 74 20 62 65 | 20 70 72 6f 63 65 73 73 |annot be| process|
|000034e0| 65 64 20 75 6e 74 69 6c | 20 74 68 65 20 72 65 63 |ed until| the rec|
|000034f0| 65 69 76 65 72 20 0a 6f | 62 74 61 69 6e 73 20 74 |eiver .o|btains t|
|00003500| 68 65 20 6b 65 72 6e 65 | 6c 20 73 70 69 6e 6c 6f |he kerne|l spinlo|
|00003510| 63 6b 20 66 72 6f 6d 20 | 6d 65 73 73 61 67 65 73 |ck from |messages|
|00003520| 20 74 68 61 74 20 63 61 | 6e 20 62 65 20 70 72 6f | that ca|n be pro|
|00003530| 63 65 73 73 65 64 20 0a | 69 6d 6d 65 64 69 61 74 |cessed .|immediat|
|00003540| 65 6c 79 2e 20 49 6e 20 | 65 66 66 65 63 74 20 49 |ely. In |effect I|
|00003550| 52 51 20 31 33 20 69 73 | 20 61 20 66 61 73 74 20 |RQ 13 is| a fast |
|00003560| 49 52 51 20 68 61 6e 64 | 6c 65 72 20 74 68 61 74 |IRQ hand|ler that|
|00003570| 20 64 6f 65 73 20 6e 6f | 74 20 6f 62 74 61 69 6e | does no|t obtain|
|00003580| 20 0a 74 68 65 20 6c 6f | 63 6b 73 2c 20 61 6e 64 | .the lo|cks, and|
|00003590| 20 63 61 6e 6e 6f 74 20 | 63 61 75 73 65 20 61 20 | cannot |cause a |
|000035a0| 72 65 73 63 68 65 64 75 | 6c 65 2c 20 77 68 69 6c |reschedu|le, whil|
|000035b0| 65 20 49 52 51 20 31 36 | 20 69 73 20 61 20 73 6c |e IRQ 16| is a sl|
|000035c0| 6f 77 20 49 52 51 20 74 | 68 61 74 20 0a 6d 75 73 |ow IRQ t|hat .mus|
|000035d0| 74 20 61 63 71 75 69 72 | 65 20 74 68 65 20 6b 65 |t acquir|e the ke|
|000035e0| 72 6e 65 6c 20 73 70 69 | 6e 6c 6f 63 6b 73 20 61 |rnel spi|nlocks a|
|000035f0| 6e 64 20 63 61 6e 20 63 | 61 75 73 65 20 61 20 72 |nd can c|ause a r|
|00003600| 65 73 63 68 65 64 75 6c | 65 2e 20 54 68 69 73 20 |eschedul|e. This |
|00003610| 0a 69 6e 74 65 72 72 75 | 70 74 20 69 73 20 75 73 |.interru|pt is us|
|00003620| 65 64 20 66 6f 72 20 70 | 61 73 73 69 6e 67 20 6f |ed for p|assing o|
|00003630| 6e 20 73 6c 61 76 65 20 | 74 69 6d 65 72 20 6d 65 |n slave |timer me|
|00003640| 73 73 61 67 65 73 20 66 | 72 6f 6d 20 74 68 65 20 |ssages f|rom the |
|00003650| 70 72 6f 63 65 73 73 6f | 72 20 0a 74 68 61 74 20 |processo|r .that |
|00003660| 72 65 63 65 69 76 65 73 | 20 74 68 65 20 74 69 6d |receives| the tim|
|00003670| 65 72 20 69 6e 74 65 72 | 72 75 70 74 20 74 6f 20 |er inter|rupt to |
|00003680| 74 68 65 20 72 65 73 74 | 20 6f 66 20 74 68 65 20 |the rest| of the |
|00003690| 70 72 6f 63 65 73 73 6f | 72 73 2c 20 73 6f 20 74 |processo|rs, so t|
|000036a0| 68 61 74 20 0a 74 68 65 | 79 20 63 61 6e 20 72 65 |hat .the|y can re|
|000036b0| 73 63 68 65 64 75 6c 65 | 20 72 75 6e 6e 69 6e 67 |schedule| running|
|000036c0| 20 74 61 73 6b 73 2e 0a | 0a 0a 5c 73 75 62 73 75 | tasks..|..\subsu|
|000036d0| 62 73 65 63 74 69 6f 6e | 7b 45 6e 74 72 79 20 41 |bsection|{Entry A|
|000036e0| 6e 64 20 45 78 69 74 20 | 43 6f 64 65 7d 0a 41 20 |nd Exit |Code}.A |
|000036f0| 73 69 6e 67 6c 65 20 73 | 70 69 6e 6c 6f 63 6b 20 |single s|pinlock |
|00003700| 70 72 6f 74 65 63 74 73 | 20 74 68 65 20 65 6e 74 |protects| the ent|
|00003710| 69 72 65 20 6b 65 72 6e | 65 6c 2e 20 54 68 65 20 |ire kern|el. The |
|00003720| 69 6e 74 65 72 72 75 70 | 74 20 68 61 6e 64 6c 65 |interrup|t handle|
|00003730| 72 73 2c 20 74 68 65 20 | 0a 73 79 73 63 61 6c 6c |rs, the |.syscall|
|00003740| 20 65 6e 74 72 79 20 63 | 6f 64 65 20 61 6e 64 20 | entry c|ode and |
|00003750| 74 68 65 20 65 78 63 65 | 70 74 69 6f 6e 20 68 61 |the exce|ption ha|
|00003760| 6e 64 6c 65 72 73 20 61 | 6c 6c 20 61 63 71 75 69 |ndlers a|ll acqui|
|00003770| 72 65 20 74 68 65 20 6c | 6f 63 6b 20 62 65 66 6f |re the l|ock befo|
|00003780| 72 65 20 0a 65 6e 74 65 | 72 69 6e 67 20 74 68 65 |re .ente|ring the|
|00003790| 20 6b 65 72 6e 65 6c 20 | 70 72 6f 70 65 72 2e 20 | kernel |proper. |
|000037a0| 57 68 65 6e 20 74 68 65 | 20 70 72 6f 63 65 73 73 |When the| process|
|000037b0| 6f 72 20 69 73 20 74 72 | 79 69 6e 67 20 74 6f 20 |or is tr|ying to |
|000037c0| 61 63 71 75 69 72 65 20 | 74 68 65 20 0a 73 70 69 |acquire |the .spi|
|000037d0| 6e 6c 6f 63 6b 20 69 74 | 20 73 70 69 6e 73 20 63 |nlock it| spins c|
|000037e0| 6f 6e 74 69 6e 75 61 6c | 6c 79 20 6f 6e 20 74 68 |ontinual|ly on th|
|000037f0| 65 20 6c 6f 63 6b 20 77 | 69 74 68 20 69 6e 74 65 |e lock w|ith inte|
|00003800| 72 72 75 70 74 73 20 64 | 69 73 61 62 6c 65 64 2e |rrupts d|isabled.|
|00003810| 20 54 68 69 73 20 0a 63 | 61 75 73 65 73 20 61 20 | This .c|auses a |
|00003820| 73 70 65 63 69 66 69 63 | 20 64 65 61 64 6c 6f 63 |specific| deadloc|
|00003830| 6b 20 70 72 6f 62 6c 65 | 6d 2e 20 54 68 65 20 6c |k proble|m. The l|
|00003840| 6f 63 6b 20 6f 77 6e 65 | 72 20 6d 61 79 20 6e 65 |ock owne|r may ne|
|00003850| 65 64 20 74 6f 20 73 65 | 6e 64 20 61 6e 20 0a 69 |ed to se|nd an .i|
|00003860| 6e 76 61 6c 69 64 61 74 | 65 20 72 65 71 75 65 73 |nvalidat|e reques|
|00003870| 74 20 74 6f 20 74 68 65 | 20 72 65 73 74 20 6f 66 |t to the| rest of|
|00003880| 20 74 68 65 20 70 72 6f | 63 65 73 73 6f 72 73 20 | the pro|cessors |
|00003890| 61 6e 64 20 77 61 69 74 | 20 66 6f 72 20 74 68 65 |and wait| for the|
|000038a0| 73 65 20 74 6f 20 0a 63 | 6f 6d 70 6c 65 74 65 20 |se to .c|omplete |
|000038b0| 62 65 66 6f 72 65 20 63 | 6f 6e 74 69 6e 75 69 6e |before c|ontinuin|
|000038c0| 67 2e 20 41 20 70 72 6f | 63 65 73 73 6f 72 20 73 |g. A pro|cessor s|
|000038d0| 70 69 6e 6e 69 6e 67 20 | 6f 6e 20 74 68 65 20 6c |pinning |on the l|
|000038e0| 6f 63 6b 20 77 6f 75 6c | 64 20 6e 6f 74 20 62 65 |ock woul|d not be|
|000038f0| 20 0a 61 62 6c 65 20 74 | 6f 20 64 6f 20 74 68 75 | .able t|o do thu|
|00003900| 73 2e 20 54 68 75 73 20 | 74 68 65 20 6c 6f 6f 70 |s. Thus |the loop|
|00003910| 20 6f 66 20 74 68 65 20 | 73 70 69 6e 6c 6f 63 6b | of the |spinlock|
|00003920| 20 74 65 73 74 73 20 61 | 6e 64 20 68 61 6e 64 6c | tests a|nd handl|
|00003930| 65 73 20 69 6e 76 61 6c | 69 64 61 74 65 20 0a 72 |es inval|idate .r|
|00003940| 65 71 75 65 73 74 73 2e | 20 49 66 20 74 68 65 20 |equests.| If the |
|00003950| 69 6e 76 61 6c 69 64 61 | 74 65 20 62 69 74 20 66 |invalida|te bit f|
|00003960| 6f 72 20 74 68 65 20 73 | 70 69 6e 6e 69 6e 67 20 |or the s|pinning |
|00003970| 43 50 55 20 69 73 20 73 | 65 74 20 74 68 65 20 70 |CPU is s|et the p|
|00003980| 72 6f 63 65 73 73 6f 72 | 20 0a 69 6e 76 61 6c 69 |rocessor| .invali|
|00003990| 64 61 74 65 73 20 69 74 | 73 20 54 4c 42 20 61 6e |dates it|s TLB an|
|000039a0| 64 20 61 74 6f 6d 69 63 | 61 6c 6c 79 20 63 6c 65 |d atomic|ally cle|
|000039b0| 61 72 73 20 74 68 65 20 | 62 69 74 2e 20 57 68 65 |ars the |bit. Whe|
|000039c0| 6e 20 74 68 65 20 73 70 | 69 6e 6c 6f 63 6b 20 69 |n the sp|inlock i|
|000039d0| 73 20 0a 6f 62 74 61 69 | 6e 65 64 20 74 68 61 74 |s .obtai|ned that|
|000039e0| 20 70 72 6f 63 65 73 73 | 6f 72 20 77 69 6c 6c 20 | process|or will |
|000039f0| 74 61 6b 65 20 61 6e 20 | 49 50 49 20 61 6e 64 20 |take an |IPI and |
|00003a00| 69 6e 20 74 68 65 20 49 | 50 49 20 74 65 73 74 20 |in the I|PI test |
|00003a10| 74 68 65 20 62 69 74 20 | 61 6e 64 20 0a 73 6b 69 |the bit |and .ski|
|00003a20| 70 20 74 68 65 20 69 6e | 76 61 6c 69 64 61 74 65 |p the in|validate|
|00003a30| 20 61 73 20 74 68 65 20 | 62 69 74 20 69 73 20 63 | as the |bit is c|
|00003a40| 6c 65 61 72 2e 0a 0a 4f | 6e 65 20 63 6f 6d 70 6c |lear...O|ne compl|
|00003a50| 65 78 69 74 79 20 6f 66 | 20 74 68 65 20 73 70 69 |exity of| the spi|
|00003a60| 6e 6c 6f 63 6b 20 69 73 | 20 74 68 61 74 20 61 20 |nlock is| that a |
|00003a70| 70 72 6f 63 65 73 73 20 | 72 75 6e 6e 69 6e 67 20 |process |running |
|00003a80| 69 6e 20 6b 65 72 6e 65 | 6c 20 6d 6f 64 65 20 0a |in kerne|l mode .|
|00003a90| 63 61 6e 20 73 6c 65 65 | 70 20 76 6f 6c 75 6e 74 |can slee|p volunt|
|00003aa0| 61 72 69 6c 79 20 61 6e | 64 20 62 65 20 70 72 65 |arily an|d be pre|
|00003ab0| 2d 65 6d 70 74 65 64 2e | 20 41 20 73 77 69 74 63 |-empted.| A switc|
|00003ac0| 68 20 66 72 6f 6d 20 73 | 75 63 68 20 61 20 70 72 |h from s|uch a pr|
|00003ad0| 6f 63 65 73 73 20 74 6f | 20 61 20 0a 70 72 6f 63 |ocess to| a .proc|
|00003ae0| 65 73 73 20 65 78 65 63 | 75 74 69 6e 67 20 69 6e |ess exec|uting in|
|00003af0| 20 75 73 65 72 20 73 70 | 61 63 65 20 6d 61 79 20 | user sp|ace may |
|00003b00| 72 65 64 75 63 65 20 74 | 68 65 20 6c 6f 63 6b 20 |reduce t|he lock |
|00003b10| 63 6f 75 6e 74 2e 20 54 | 6f 20 74 72 61 63 6b 20 |count. T|o track |
|00003b20| 74 68 69 73 20 0a 74 68 | 65 20 6b 65 72 6e 65 6c |this .th|e kernel|
|00003b30| 20 75 73 65 73 20 61 20 | 73 79 73 63 61 6c 6c 5c | uses a |syscall\|
|00003b40| 5f 63 6f 75 6e 74 20 61 | 6e 64 20 61 20 70 65 72 |_count a|nd a per|
|00003b50| 20 70 72 6f 63 65 73 73 | 20 6c 6f 63 6b 5c 5f 64 | process| lock\_d|
|00003b60| 65 70 74 68 20 70 61 72 | 61 6d 65 74 65 72 20 74 |epth par|ameter t|
|00003b70| 6f 20 0a 74 72 61 63 6b | 20 74 68 65 20 6b 65 72 |o .track| the ker|
|00003b80| 6e 65 6c 20 6c 6f 63 6b | 20 73 74 61 74 65 2e 20 |nel lock| state. |
|00003b90| 54 68 65 20 73 77 69 74 | 63 68 5c 5f 74 6f 28 29 |The swit|ch\_to()|
|00003ba0| 20 66 75 6e 63 74 69 6f | 6e 20 69 73 20 6d 6f 64 | functio|n is mod|
|00003bb0| 69 66 69 65 64 20 69 6e | 20 53 4d 50 20 0a 6d 6f |ified in| SMP .mo|
|00003bc0| 64 65 20 74 6f 20 61 64 | 6a 75 73 74 20 74 68 65 |de to ad|just the|
|00003bd0| 20 6c 6f 63 6b 20 61 70 | 70 72 6f 70 72 69 61 74 | lock ap|propriat|
|00003be0| 65 6c 79 2e 0a 0a 54 68 | 65 20 66 69 6e 61 6c 20 |ely...Th|e final |
|00003bf0| 70 72 6f 62 6c 65 6d 20 | 69 73 20 74 68 65 20 69 |problem |is the i|
|00003c00| 64 6c 65 20 74 68 72 65 | 61 64 2e 20 49 6e 20 74 |dle thre|ad. In t|
|00003c10| 68 65 20 73 69 6e 67 6c | 65 20 70 72 6f 63 65 73 |he singl|e proces|
|00003c20| 73 6f 72 20 6b 65 72 6e | 65 6c 20 74 68 65 20 0a |sor kern|el the .|
|00003c30| 69 64 6c 65 20 74 68 72 | 65 61 64 20 65 78 65 63 |idle thr|ead exec|
|00003c40| 75 74 65 73 20 27 68 6c | 74 27 20 69 6e 73 74 72 |utes 'hl|t' instr|
|00003c50| 75 63 74 69 6f 6e 73 2e | 20 54 68 69 73 20 73 61 |uctions.| This sa|
|00003c60| 76 65 73 20 70 6f 77 65 | 72 20 61 6e 64 20 72 65 |ves powe|r and re|
|00003c70| 64 75 63 65 73 20 74 68 | 65 20 0a 72 75 6e 6e 69 |duces th|e .runni|
|00003c80| 6e 67 20 74 65 6d 70 65 | 72 61 74 75 72 65 20 6f |ng tempe|rature o|
|00003c90| 66 20 74 68 65 20 70 72 | 6f 63 65 73 73 6f 72 73 |f the pr|ocessors|
|00003ca0| 20 77 68 65 6e 20 74 68 | 65 79 20 61 72 65 20 69 | when th|ey are i|
|00003cb0| 64 6c 65 2e 20 48 6f 77 | 65 76 65 72 20 69 74 20 |dle. How|ever it |
|00003cc0| 6d 65 61 6e 73 20 0a 74 | 68 65 20 70 72 6f 63 65 |means .t|he proce|
|00003cd0| 73 73 20 73 70 65 6e 64 | 73 20 61 6c 6c 20 69 74 |ss spend|s all it|
|00003ce0| 73 20 74 69 6d 65 20 69 | 6e 20 6b 65 72 6e 65 6c |s time i|n kernel|
|00003cf0| 20 6d 6f 64 65 20 61 6e | 64 20 77 6f 75 6c 64 20 | mode an|d would |
|00003d00| 74 68 75 73 20 68 6f 6c | 64 20 74 68 65 20 0a 6b |thus hol|d the .k|
|00003d10| 65 72 6e 65 6c 20 73 70 | 69 6e 6c 6f 63 6b 2e 20 |ernel sp|inlock. |
|00003d20| 54 68 65 20 53 4d 50 20 | 69 64 6c 65 20 74 68 72 |The SMP |idle thr|
|00003d30| 65 61 64 20 63 6f 6e 74 | 69 6e 75 61 6c 6c 79 20 |ead cont|inually |
|00003d40| 72 65 73 63 68 65 64 75 | 6c 65 73 20 61 20 6e 65 |reschedu|les a ne|
|00003d50| 77 20 74 61 73 6b 20 61 | 6e 64 20 0a 72 65 74 75 |w task a|nd .retu|
|00003d60| 72 6e 73 20 74 6f 20 75 | 73 65 72 20 6d 6f 64 65 |rns to u|ser mode|
|00003d70| 2e 20 54 68 69 73 20 69 | 73 20 66 61 72 20 66 72 |. This i|s far fr|
|00003d80| 6f 6d 20 69 64 65 61 6c | 20 61 6e 64 20 77 69 6c |om ideal| and wil|
|00003d90| 6c 20 62 65 20 6d 6f 64 | 69 66 69 65 64 20 74 6f |l be mod|ified to|
|00003da0| 20 75 73 65 20 0a 27 68 | 6c 74 27 20 69 6e 73 74 | use .'h|lt' inst|
|00003db0| 72 75 63 74 69 6f 6e 73 | 20 61 6e 64 20 72 65 6c |ructions| and rel|
|00003dc0| 65 61 73 65 20 74 68 65 | 20 73 70 69 6e 6c 6f 63 |ease the| spinloc|
|00003dd0| 6b 20 73 6f 6f 6e 2e 20 | 55 73 69 6e 67 20 27 68 |k soon. |Using 'h|
|00003de0| 6c 74 27 20 69 73 20 65 | 76 65 6e 20 6d 6f 72 65 |lt' is e|ven more|
|00003df0| 20 0a 62 65 6e 65 66 69 | 63 69 61 6c 20 6f 6e 20 | .benefi|cial on |
|00003e00| 61 20 6d 75 6c 74 69 70 | 72 6f 63 65 73 73 6f 72 |a multip|rocessor|
|00003e10| 20 73 79 73 74 65 6d 20 | 61 73 20 69 74 20 61 6c | system |as it al|
|00003e20| 6d 6f 73 74 20 63 6f 6d | 70 6c 65 74 65 6c 79 20 |most com|pletely |
|00003e30| 74 61 6b 65 73 20 61 6e | 20 69 64 6c 65 20 0a 70 |takes an| idle .p|
|00003e40| 72 6f 63 65 73 73 6f 72 | 20 6f 66 66 20 74 68 65 |rocessor| off the|
|00003e50| 20 62 75 73 2e 0a 0a 49 | 6e 74 65 72 72 75 70 74 | bus...I|nterrupt|
|00003e60| 73 20 61 72 65 20 64 69 | 73 74 72 69 62 75 74 65 |s are di|stribute|
|00003e70| 64 20 62 79 20 61 6e 20 | 69 38 32 34 38 39 20 41 |d by an |i82489 A|
|00003e80| 50 49 43 2e 20 54 68 69 | 73 20 63 68 69 70 20 69 |PIC. Thi|s chip i|
|00003e90| 73 20 73 65 74 20 75 70 | 20 74 6f 20 77 6f 72 6b |s set up| to work|
|00003ea0| 20 0a 61 73 20 61 6e 20 | 65 6d 75 6c 61 74 69 6f | .as an |emulatio|
|00003eb0| 6e 20 6f 66 20 74 68 65 | 20 74 72 61 64 69 74 69 |n of the| traditi|
|00003ec0| 6f 6e 61 6c 20 50 43 20 | 69 6e 74 65 72 72 75 70 |onal PC |interrup|
|00003ed0| 74 20 63 6f 6e 74 72 6f | 6c 6c 65 72 73 20 77 68 |t contro|llers wh|
|00003ee0| 65 6e 20 74 68 65 20 0a | 6d 61 63 68 69 6e 65 20 |en the .|machine |
|00003ef0| 62 6f 6f 74 73 20 28 73 | 6f 20 74 68 61 74 20 61 |boots (s|o that a|
|00003f00| 6e 20 49 6e 74 65 6c 20 | 4d 50 20 6d 61 63 68 69 |n Intel |MP machi|
|00003f10| 6e 65 20 62 6f 6f 74 73 | 20 6f 6e 65 20 43 50 55 |ne boots| one CPU|
|00003f20| 20 61 6e 64 20 50 43 20 | 0a 63 6f 6d 70 61 74 69 | and PC |.compati|
|00003f30| 62 6c 65 29 2e 20 54 68 | 65 20 6b 65 72 6e 65 6c |ble). Th|e kernel|
|00003f40| 20 68 61 73 20 61 6c 6c | 20 74 68 65 20 72 65 6c | has all| the rel|
|00003f50| 65 76 61 6e 74 20 6c 6f | 63 6b 73 20 62 75 74 20 |evant lo|cks but |
|00003f60| 64 6f 65 73 20 6e 6f 74 | 20 79 65 74 20 0a 72 65 |does not| yet .re|
|00003f70| 70 72 6f 67 72 61 6d 20 | 74 68 65 20 38 32 34 38 |program |the 8248|
|00003f80| 39 20 74 6f 20 64 65 6c | 69 76 65 72 20 69 6e 74 |9 to del|iver int|
|00003f90| 65 72 72 75 70 74 73 20 | 74 6f 20 61 72 62 69 74 |errupts |to arbit|
|00003fa0| 72 61 72 79 20 70 72 6f | 63 65 73 73 6f 72 73 20 |rary pro|cessors |
|00003fb0| 61 73 20 69 74 20 0a 73 | 68 6f 75 6c 64 2e 20 54 |as it .s|hould. T|
|00003fc0| 68 69 73 20 72 65 71 75 | 69 72 65 73 20 66 75 72 |his requ|ires fur|
|00003fd0| 74 68 65 72 20 6d 6f 64 | 69 66 69 63 61 74 69 6f |ther mod|ificatio|
|00003fe0| 6e 20 6f 66 20 74 68 65 | 20 73 74 61 6e 64 61 72 |n of the| standar|
|00003ff0| 64 20 4c 69 6e 75 78 20 | 69 6e 74 65 72 72 75 70 |d Linux |interrup|
|00004000| 74 20 0a 68 61 6e 64 6c | 69 6e 67 20 63 6f 64 65 |t .handl|ing code|
|00004010| 2c 20 61 6e 64 20 69 73 | 20 70 61 72 74 69 63 75 |, and is| particu|
|00004020| 6c 61 72 6c 79 20 6d 65 | 73 73 79 20 61 73 20 74 |larly me|ssy as t|
|00004030| 68 65 20 69 6e 74 65 72 | 72 75 70 74 20 68 61 6e |he inter|rupt han|
|00004040| 64 6c 65 72 20 62 65 68 | 61 76 69 6f 75 72 20 0a |dler beh|aviour .|
|00004050| 68 61 73 20 74 6f 20 63 | 68 61 6e 67 65 20 61 73 |has to c|hange as|
|00004060| 20 73 6f 6f 6e 20 61 73 | 20 74 68 65 20 38 32 34 | soon as| the 824|
|00004070| 38 39 20 69 73 20 73 77 | 69 74 63 68 65 64 20 69 |89 is sw|itched i|
|00004080| 6e 74 6f 20 53 4d 50 20 | 6d 6f 64 65 2e 0a 0a 0a |nto SMP |mode....|
|00004090| 5c 73 75 62 73 75 62 73 | 65 63 74 69 6f 6e 7b 45 |\subsubs|ection{E|
|000040a0| 78 74 65 6e 73 69 6f 6e | 73 20 54 6f 20 53 74 61 |xtension|s To Sta|
|000040b0| 6e 64 61 72 64 20 46 61 | 63 69 6c 69 74 69 65 73 |ndard Fa|cilities|
|000040c0| 7d 0a 54 68 65 20 6b 65 | 72 6e 65 6c 20 6d 61 69 |}.The ke|rnel mai|
|000040d0| 6e 74 61 69 6e 73 20 61 | 20 73 65 74 20 6f 66 20 |ntains a| set of |
|000040e0| 70 65 72 20 70 72 6f 63 | 65 73 73 6f 72 20 63 6f |per proc|essor co|
|000040f0| 6e 74 72 6f 6c 20 69 6e | 66 6f 72 6d 61 74 69 6f |ntrol in|formatio|
|00004100| 6e 20 73 75 63 68 20 61 | 73 20 0a 74 68 65 20 73 |n such a|s .the s|
|00004110| 70 65 65 64 20 6f 66 20 | 74 68 65 20 70 72 6f 63 |peed of |the proc|
|00004120| 65 73 73 6f 72 20 66 6f | 72 20 64 65 6c 61 79 20 |essor fo|r delay |
|00004130| 6c 6f 6f 70 73 2e 20 54 | 68 65 73 65 20 66 75 6e |loops. T|hese fun|
|00004140| 63 74 69 6f 6e 73 20 6f | 6e 20 74 68 65 20 53 4d |ctions o|n the SM|
|00004150| 50 20 0a 6b 65 72 6e 65 | 6c 20 6c 6f 6f 6b 20 74 |P .kerne|l look t|
|00004160| 68 65 20 76 61 6c 75 65 | 73 20 75 70 20 69 6e 20 |he value|s up in |
|00004170| 61 20 70 65 72 20 70 72 | 6f 63 65 73 73 6f 72 20 |a per pr|ocessor |
|00004180| 61 72 72 61 79 20 74 68 | 61 74 20 69 73 20 73 65 |array th|at is se|
|00004190| 74 20 75 70 20 66 72 6f | 6d 20 74 68 65 20 0a 64 |t up fro|m the .d|
|000041a0| 61 74 61 20 67 65 6e 65 | 72 61 74 65 64 20 61 74 |ata gene|rated at|
|000041b0| 20 62 6f 6f 74 20 75 70 | 20 62 79 20 74 68 65 20 | boot up| by the |
|000041c0| 73 6d 70 5c 5f 73 74 6f | 72 65 5c 5f 63 70 75 5c |smp\_sto|re\_cpu\|
|000041d0| 5f 69 6e 66 6f 28 29 20 | 66 75 6e 63 74 69 6f 6e |_info() |function|
|000041e0| 2e 20 54 68 69 73 20 0a | 69 6e 63 6c 75 64 65 73 |. This .|includes|
|000041f0| 20 6f 74 68 65 72 20 66 | 61 63 74 73 20 73 75 63 | other f|acts suc|
|00004200| 68 20 61 73 20 77 68 65 | 74 68 65 72 20 74 68 65 |h as whe|ther the|
|00004210| 72 65 20 69 73 20 61 6e | 20 46 50 55 20 6f 6e 20 |re is an| FPU on |
|00004220| 74 68 65 20 70 72 6f 63 | 65 73 73 6f 72 2e 20 54 |the proc|essor. T|
|00004230| 68 65 20 0a 63 75 72 72 | 65 6e 74 20 6b 65 72 6e |he .curr|ent kern|
|00004240| 65 6c 20 64 6f 65 73 20 | 6e 6f 74 20 68 61 6e 64 |el does |not hand|
|00004250| 6c 65 20 66 6c 6f 61 74 | 69 6e 67 20 70 6f 69 6e |le float|ing poin|
|00004260| 74 20 63 6f 72 72 65 63 | 74 6c 79 2c 20 74 68 69 |t correc|tly, thi|
|00004270| 73 20 72 65 71 75 69 72 | 65 73 20 73 6f 6d 65 20 |s requir|es some |
|00004280| 0a 63 68 61 6e 67 65 73 | 20 74 6f 20 74 68 65 20 |.changes| to the |
|00004290| 74 65 63 68 6e 69 71 75 | 65 73 20 74 68 65 20 73 |techniqu|es the s|
|000042a0| 69 6e 67 6c 65 20 43 50 | 55 20 6b 65 72 6e 65 6c |ingle CP|U kernel|
|000042b0| 20 75 73 65 73 20 74 6f | 20 6d 69 6e 69 6d 69 73 | uses to| minimis|
|000042c0| 65 20 66 6c 6f 61 74 69 | 6e 67 20 0a 70 6f 69 6e |e floati|ng .poin|
|000042d0| 74 20 70 72 6f 63 65 73 | 73 6f 72 20 72 65 6c 6f |t proces|sor relo|
|000042e0| 61 64 73 2e 0a 0a 54 68 | 65 20 68 69 67 68 6c 79 |ads...Th|e highly|
|000042f0| 20 75 73 65 66 75 6c 20 | 61 74 6f 6d 69 63 20 62 | useful |atomic b|
|00004300| 69 74 20 6f 70 65 72 61 | 74 69 6f 6e 73 20 61 72 |it opera|tions ar|
|00004310| 65 20 70 72 65 66 69 78 | 65 64 20 77 69 74 68 20 |e prefix|ed with |
|00004320| 74 68 65 20 27 6c 6f 63 | 6b 27 20 0a 70 72 65 66 |the 'loc|k' .pref|
|00004330| 69 78 20 69 6e 20 74 68 | 65 20 53 4d 50 20 6b 65 |ix in th|e SMP ke|
|00004340| 72 6e 65 6c 20 74 6f 20 | 6d 61 69 6e 74 61 69 6e |rnel to |maintain|
|00004350| 20 74 68 65 69 72 20 61 | 74 6f 6d 69 63 20 70 72 | their a|tomic pr|
|00004360| 6f 70 65 72 74 69 65 73 | 20 77 68 65 6e 20 75 73 |operties| when us|
|00004370| 65 64 20 0a 6f 75 74 73 | 69 64 65 20 6f 66 20 28 |ed .outs|ide of (|
|00004380| 61 6e 64 20 62 79 29 20 | 74 68 65 20 73 70 69 6e |and by) |the spin|
|00004390| 6c 6f 63 6b 20 61 6e 64 | 20 6d 65 73 73 61 67 65 |lock and| message|
|000043a0| 20 63 6f 64 65 2e 20 41 | 6d 6f 6e 67 73 74 20 6f | code. A|mongst o|
|000043b0| 74 68 65 72 20 74 68 69 | 6e 67 73 20 0a 74 68 69 |ther thi|ngs .thi|
|000043c0| 73 20 69 73 20 6e 65 65 | 64 65 64 20 66 6f 72 20 |s is nee|ded for |
|000043d0| 74 68 65 20 69 6e 76 61 | 6c 69 64 61 74 65 20 68 |the inva|lidate h|
|000043e0| 61 6e 64 6c 65 72 2c 20 | 61 73 20 61 6c 6c 20 20 |andler, |as all |
|000043f0| 43 50 55 27 73 20 77 69 | 6c 6c 20 69 6e 76 61 6c |CPU's wi|ll inval|
|00004400| 69 64 61 74 65 20 61 74 | 20 0a 74 68 65 20 73 61 |idate at| .the sa|
|00004410| 6d 65 20 74 69 6d 65 20 | 77 69 74 68 6f 75 74 20 |me time |without |
|00004420| 61 6e 79 20 6c 6f 63 6b | 73 2e 0a 0a 49 6e 74 65 |any lock|s...Inte|
|00004430| 72 72 75 70 74 20 31 33 | 20 66 6c 6f 61 74 69 6e |rrupt 13| floatin|
|00004440| 67 20 70 6f 69 6e 74 20 | 65 72 72 6f 72 20 72 65 |g point |error re|
|00004450| 70 6f 72 74 69 6e 67 20 | 69 73 20 72 65 6d 6f 76 |porting |is remov|
|00004460| 65 64 2e 20 54 68 69 73 | 20 66 61 63 69 6c 69 74 |ed. This| facilit|
|00004470| 79 20 69 73 20 0a 6e 6f | 74 20 75 73 61 62 6c 65 |y is .no|t usable|
|00004480| 20 6f 6e 20 61 20 6d 75 | 6c 74 69 70 72 6f 63 65 | on a mu|ltiproce|
|00004490| 73 73 6f 72 20 62 6f 61 | 72 64 2c 20 6e 6f 72 20 |ssor boa|rd, nor |
|000044a0| 72 65 6c 65 76 61 6e 74 | 20 74 6f 20 74 68 65 20 |relevant| to the |
|000044b0| 49 6e 74 65 6c 20 4d 50 | 20 0a 61 72 63 68 69 74 |Intel MP| .archit|
|000044c0| 65 63 74 75 72 65 20 77 | 68 69 63 68 20 64 6f 65 |ecture w|hich doe|
|000044d0| 73 20 6e 6f 74 20 63 6f | 76 65 72 20 74 68 65 20 |s not co|ver the |
|000044e0| 38 30 33 38 36 2f 38 30 | 33 38 37 20 70 72 6f 63 |80386/80|387 proc|
|000044f0| 65 73 73 6f 72 20 70 61 | 69 72 2e 20 5c 0a 0a 54 |essor pa|ir. \..T|
|00004500| 68 65 20 2f 70 72 6f 63 | 20 66 69 6c 65 73 79 73 |he /proc| filesys|
|00004510| 74 65 6d 20 73 75 70 70 | 6f 72 74 20 69 73 20 63 |tem supp|ort is c|
|00004520| 68 61 6e 67 65 64 20 73 | 6f 20 74 68 61 74 20 74 |hanged s|o that t|
|00004530| 68 65 20 2f 70 72 6f 63 | 2f 63 70 75 69 6e 66 6f |he /proc|/cpuinfo|
|00004540| 20 66 69 6c 65 20 0a 63 | 6f 6e 74 61 69 6e 73 20 | file .c|ontains |
|00004550| 61 20 63 6f 6c 75 6d 6e | 20 66 6f 72 20 65 61 63 |a column| for eac|
|00004560| 68 20 70 72 6f 63 65 73 | 73 6f 72 20 70 72 65 73 |h proces|sor pres|
|00004570| 65 6e 74 2e 20 54 68 69 | 73 20 69 6e 66 6f 72 6d |ent. Thi|s inform|
|00004580| 61 74 69 6f 6e 20 69 73 | 20 65 78 74 72 61 63 74 |ation is| extract|
|00004590| 65 64 20 0a 66 72 6f 6d | 20 74 68 65 20 64 61 74 |ed .from| the dat|
|000045a0| 61 20 73 61 76 65 20 62 | 79 20 73 6d 70 5c 5f 73 |a save b|y smp\_s|
|000045b0| 74 6f 72 65 5c 5f 63 70 | 75 5c 5f 69 6e 66 6f 28 |tore\_cp|u\_info(|
|000045c0| 29 2e 0a 0a 5c 65 6e 64 | 7b 64 6f 63 75 6d 65 6e |)...\end|{documen|
|000045d0| 74 7d 0a | |t}. | |
+--------+-------------------------+-------------------------+--------+--------+