Changeset 2840


Ignore:
Timestamp:
Oct 29, 2006, 2:32:25 AM (19 years ago)
Author:
bird
Message:

think I got the state stuff right now.

Location:
trunk/kLdr
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/kLdr/kLdr.h

    r2837 r2840  
    5454 * @{ */
    5555
     56/**
     57 * Memory Mapping Protections.
     58 *
     59 * @remark Shared segments can be mapped using the non copy-on-write variant.
     60 *         (Normally the copy-on-write variant is used because changes must
     61 *         be private and not shared with other processes mapping the file.)
     62 */
    5663typedef enum KLDRPROT
    5764{
  • trunk/kLdr/kLdrInternal.h

    r2837 r2840  
    6565/**
    6666 * The state of a dynamic loader module.
     67 * @image html KLDRSTATE.gif "The state diagram"
    6768 */
    6869typedef enum KLDRSTATE
     
    7071    /** The usual invalid 0 enum. */
    7172    KLDRSTATE_INVALID = 0,
    72     /** The module has just been opened and has no references.
     73
     74    /** The module has just been opened and linked into the load list.
     75     *
    7376     * Prev state: -
    74      * Next state: MAPPED, DESTROYED
     77     * Next state: MAPPED, PENDING_DESTROY
    7578     */
    7679    KLDRSTATE_OPEN,
    77     /** The module been mapped.
     80
     81    /** The module segments has been mapped into the process memory.
     82     *
    7883     * Prev state: OPEN
    79      * Next state: LOADED_PREREQUISITES, DESTROYED
     84     * Next state: LOADED_PREREQUISITES, PENDING_DESTROY
    8085     */
    8186    KLDRSTATE_MAPPED,
    8287    /** The module has been reloaded and needs to be fixed up again.
    83      * (The loader can still be in a re-entrant mode.)
     88     * This can occure when the loader is called recursivly.
     89     *
     90     * The reason RELOADED modules must go back to the PENDING_GC state is
     91     * because we want to guard against uninit order issues, and therefore
     92     * doesn't unmap modules untill all pending termintation callbacks has
     93     * been executed.
     94     *
    8495     * Prev state: PENDING_GC
    85      * Next state: LOADED_PREREQUISITES, PENDING_GC
     96     * Next state: RELOADED_LOADED_PREREQUISITES, PENDING_GC
    8697     */
    8798    KLDRSTATE_RELOADED,
     99
    88100    /** The immediate prerequisites have been loaded.
    89      * Prev state: MAPPED, RELOADED
    90      * Next state: FIXED_UP, DESTROYED
     101     *
     102     * Prev state: MAPPED
     103     * Next state: FIXED_UP, PENDING_DESTROY
    91104     */
    92105    KLDRSTATE_LOADED_PREREQUISITES,
     106    /** The immediate prerequisites have been loaded for a reloaded module.
     107     *
     108     * Prev state: RELOADED
     109     * Next state: RELOADED_FIXED_UP, PENDING_GC
     110     */
     111    KLDRSTATE_RELOADED_LOADED_PREREQUISITES,
     112
    93113    /** Fixups has been applied.
     114     *
    94115     * Prev state: LOADED_PREREQUISITES
    95      * Next state: PENDING_INIT, DESTROYED
     116     * Next state: PENDING_INITIALIZATION, PENDING_DESTROY
    96117     */
    97118    KLDRSTATE_FIXED_UP,
     119    /** Fixups has been applied.
     120     *
     121     * Prev state: RELOADED_LOADED_PREREQUISITES
     122     * Next state: PENDING_INITIALIZATION, PENDING_GC
     123     */
     124    KLDRSTATE_RELOADED_FIXED_UP,
     125
    98126    /** Pending initialization.
    99      * (The loader can now be in a re-entrant mode.)
    100      * Prev state: FIXED_UP
    101      * Next state: PENDING_INITIALIZATION, PENDING_GC
     127     * While the module is in this state the loader is in reentrant mode.
     128     *
     129     * Prev state: FIXED_UP, RELOADED_FIXED_UP
     130     * Next state: INITIALIZATION, PENDING_GC
    102131     */
    103132    KLDRSTATE_PENDING_INITIALIZATION,
     133
    104134    /** Initializing.
    105      * (The loader is now in a re-entrant mode.)
     135     * While the module is in this state the loader is in reentrant mode.
     136     *
    106137     * Prev state: PENDING_INITIALIZATION
    107138     * Next state: GOOD, PENDING_GC
    108139     */
    109140    KLDRSTATE_INITIALIZING,
     141
     142    /** Initialization failed.
     143     *
     144     * This is somewhat similar to PENDING_GC except that, a module
     145     * in this state cannot be reloaded untill we've done GC. This ensures
     146     * that a init failure during recursive loading is propagated up.
     147     *
     148     * While the module is in this state the loader is in reentrant mode.
     149     *
     150     * Prev state: INITIALIZING
     151     * Next state: GC
     152     */
     153    KLDRSTATE_INITIALIZATION_FAILED,
     154
    110155    /** The module has been successfully loaded and initialized.
    111      * (The loader can still be in a re-entrant mode.)
     156     * While the module is in this state the loader can be in reentrant
     157     * or 'unused' mode.
     158     *
    112159     * Prev state: INITIALIZING
    113160     * Next state: PENDING_TERMINATION
    114      * Re-entrant.
    115161     */
    116162    KLDRSTATE_GOOD,
     163
    117164    /** Pending termination, reference count is 0.
    118      * (The loader can now be in a re-entrant mode.)
     165     * While the module is in this state the loader is in reentrant mode.
     166     *
    119167     * Prev state: GOOD
    120168     * Next state: TERMINATING, GOOD
    121169     */
    122170    KLDRSTATE_PENDING_TERMINATION,
     171
    123172    /** Terminating, reference count is still 0.
    124      * (The loader is now in a re-entrant mode, but loading is a bit restricted.)
     173     * While the module is in this state the loader is in reentrant mode.
     174     *
    125175     * Prev state: PENDING_TERMINATION
    126176     * Next state: PENDING_GC
    127177     */
    128178    KLDRSTATE_TERMINATING,
     179
    129180    /** Pending garbage collection.
    130      * (The loader can still be in a re-entrant mode.)
    131      * Prev state: TERMINATING, INITIALIZING, PENDING_INITIALIZATION
     181     *
     182     * Prev state: TERMINATING, PENDING_INITIALIZATION, INITIALIZATION_FAILED
    132183     * Next state: GC, RELOADED
    133184     */
    134185    KLDRSTATE_PENDING_GC,
     186
    135187    /** Being garbage collected.
    136      * Prev state: PENDING_GC
     188     *
     189     * Prev state: PENDING_GC, INITIALIZATION_FAILED
    137190     * Next state: PENDING_DESTROY, DESTROYED
    138191     */
    139192    KLDRSTATE_GC,
     193
    140194    /** The module has be unlinked, but there are still stack references to it.
    141      * Prev state: GC
     195     *
     196     * Prev state: GC, FIXED_UP, LOADED_PREREQUISITES, MAPPED, OPEN
    142197     * Next state: DESTROYED
    143198     */
    144199    KLDRSTATE_PENDING_DESTROY,
     200
    145201    /** The module has been destroyed and is no longer valid.
     202     *
    146203     * Prev state: GC, PENDING_DESTROY
    147204     */
    148205    KLDRSTATE_DESTROYED,
     206
    149207    /** The end of valid states (exclusive) */
    150208    KLDRSTATE_END = KLDRSTATE_DESTROYED,
     
    194252        struct KLDRDYLDMOD *pPrev;
    195253    } Load;
    196     /** The termination list linkage. */
     254    /** The termination list linkage.
     255     * A module will be linked into the termination list upon a successful
     256     * return from module initialization. */
    197257    struct
    198258    {
  • trunk/kLdr/tg/KLDRSTATE.txvstc

    r2838 r2840  
    1515            <reference referencedUin="design:link:::id83t9setug73fpetug74ah.nodeid4wa62etug73fpetug7hpd.linkid14j0oetug73fpetugbmyx:id83t9setug73fpetug74ah.nodeid4wa62etug73fpetug7hpd">
    1616                <property name="sourceAnchor" value="90,70"/>
    17                 <property name="bendpoints" value="30,70,30,980"/>
    18                 <property name="targetAnchor" value="150,980"/>
     17                <property name="bendpoints" value="30,70,30,1000"/>
     18                <property name="targetAnchor" value="150,1000"/>
    1919                <property name="bounds_setted_by_user" value="true"/>
    2020                <reference referencedUin="linklabel:$transitionInplaceEditing:design:link:::id83t9setug73fpetug74ah.nodeid4wa62etug73fpetug7hpd.linkid14j0oetug73fpetugbmyx:id83t9setug73fpetug74ah.nodeid4wa62etug73fpetug7hpd">
    21                     <property name="bounds" value="0,50,81,15"/>
     21                    <property name="bounds" value="10,50,77,16"/>
    2222                </reference>
    2323            </reference>
     
    6464                <property name="bounds_setted_by_user" value="true"/>
    6565                <reference referencedUin="linklabel:$transitionInplaceEditing:design:link:::id83t9setug73fpetug74ah.nodeidq28metug73fpetug8uf9.linkid2yl8cetug73fpetugl74g:id83t9setug73fpetug74ah.nodeidq28metug73fpetug8uf9">
    66                     <property name="bounds" value="470,120,81,15"/>
     66                    <property name="bounds" value="470,120,77,16"/>
    6767                </reference>
    6868            </reference>
     
    7070        <reference df-class-name="reference4" referencedUin="design:node:::id83t9setug73fpetug74ah.nodeid7et8etug73fpetug938l">
    7171            <property name="$shortcutReference" value="true"/>
    72             <property name="bounds" value="80,190,137,40"/>
     72            <property name="bounds" value="80,190,135,40"/>
    7373            <reference referencedUin="design:link:::id83t9setug73fpetug74ah.nodeid7et8etug73fpetug938l.linkidr4phetug73fpetugcezv:id83t9setug73fpetug74ah.nodeid7et8etug73fpetug938l">
    7474                <property name="sourceAnchor" value="130,230"/>
     
    7878            <reference referencedUin="design:link:::id83t9setug73fpetug74ah.nodeid7et8etug73fpetug938l.linkid82puetug73fpetugbwui:id83t9setug73fpetug74ah.nodeid7et8etug73fpetug938l">
    7979                <property name="sourceAnchor" value="80,220"/>
    80                 <property name="bendpoints" value="30,220,30,970"/>
    81                 <property name="targetAnchor" value="150,970"/>
     80                <property name="bendpoints" value="30,220,30,980"/>
     81                <property name="targetAnchor" value="150,980"/>
    8282                <property name="bounds_setted_by_user" value="true"/>
    8383            </reference>
     
    8989            <reference referencedUin="design:link:::id83t9setug73fpetug74ah.nodeid71qrcetug73fpetuga3zj.linkid4fiuhetug73fpetugbs4x:id83t9setug73fpetug74ah.nodeid71qrcetug73fpetuga3zj">
    9090                <property name="sourceAnchor" value="90,300"/>
    91                 <property name="bendpoints" value="30,300,30,1000"/>
    92                 <property name="targetAnchor" value="150,1000"/>
     91                <property name="bendpoints" value="30,300,30,970"/>
     92                <property name="targetAnchor" value="150,970"/>
    9393                <property name="bounds_setted_by_user" value="true"/>
    9494            </reference>
     
    145145                <property name="bounds_setted_by_user" value="true"/>
    146146                <reference referencedUin="linklabel:$transitionInplaceEditing:design:link:::id83t9setug73fpetug74ah.nodeid7q41getug73fpetugejq5.linkid1izxmetug73fpetugesem:id83t9setug73fpetug74ah.nodeid7q41getug73fpetugejq5">
    147                     <property name="bounds" value="290,750,71,15"/>
     147                    <property name="bounds" value="290,750,84,16"/>
    148148                </reference>
    149149            </reference>
     
    156156        <reference df-class-name="reference11" referencedUin="design:node:::id83t9setug73fpetug74ah.nodeid6b4f8etug73fpetugfa3i">
    157157            <property name="$shortcutReference" value="true"/>
    158             <property name="bounds" value="150,380,133,40"/>
     158            <property name="bounds" value="150,380,129,40"/>
    159159            <reference referencedUin="design:link:::id83t9setug73fpetug74ah.nodeid6b4f8etug73fpetugfa3i.linkidy5coetug73fpetughmwy:id83t9setug73fpetug74ah.nodeid6b4f8etug73fpetugfa3i">
    160160                <property name="sourceAnchor" value="210,420"/>
     
    163163            </reference>
    164164            <reference referencedUin="design:link:::id83t9setug73fpetug74ah.nodeid6b4f8etug73fpetugfa3i.linkid989qmetug73fpetugi623:id83t9setug73fpetug74ah.nodeid6b4f8etug73fpetugfa3i">
    165                 <property name="sourceAnchor" value="150,390"/>
    166                 <property name="bendpoints" value="100,390,100,820"/>
    167                 <property name="targetAnchor" value="150,820"/>
    168                 <property name="bounds_setted_by_user" value="true"/>
     165                <property name="sourceAnchor" value="150,410"/>
     166                <property name="bendpoints" value="60,410,60,810"/>
     167                <property name="targetAnchor" value="150,810"/>
     168                <property name="bounds_setted_by_user" value="true"/>
     169                <reference referencedUin="linklabel:$transitionInplaceEditing:design:link:::id83t9setug73fpetug74ah.nodeid6b4f8etug73fpetugfa3i.linkid989qmetug73fpetugi623:id83t9setug73fpetug74ah.nodeid6b4f8etug73fpetugfa3i">
     170                    <property name="bounds" value="50,390,94,16"/>
     171                </reference>
    169172            </reference>
    170173        </reference>
     
    179182                <property name="bounds_setted_by_user" value="true"/>
    180183                <reference referencedUin="linklabel:$transitionInplaceEditing:design:link:::id83t9setug73fpetug74ah.nodeid2vt9ietug73fpetugfjhj.linkid7b0d0etug73fpetughibe:id83t9setug73fpetug74ah.nodeid2vt9ietug73fpetugfjhj">
    181                     <property name="bounds" value="351,500,42,15"/>
     184                    <property name="bounds" value="290,490,42,16"/>
    182185                </reference>
    183186            </reference>
     
    200203        <reference df-class-name="reference14" referencedUin="design:node:::id83t9setug73fpetug74ah.nodeidswftetug73fpetugfwd3">
    201204            <property name="$shortcutReference" value="true"/>
    202             <property name="bounds" value="150,630,134,40"/>
     205            <property name="bounds" value="150,630,131,40"/>
     206            <reference referencedUin="design:link:::id83t9setug73fpetug74ah.nodeidswftetug73fpetugfwd3.linkid7ockpetuqdc66etuqdq4c:id83t9setug73fpetug74ah.nodeidswftetug73fpetugfwd3">
     207                <property name="sourceAnchor" value="281,650"/>
     208                <property name="bendpoints" value="310,650,310,570"/>
     209                <property name="targetAnchor" value="284,570"/>
     210                <property name="bounds_setted_by_user" value="true"/>
     211                <reference referencedUin="linklabel:$transitionInplaceEditing:design:link:::id83t9setug73fpetug74ah.nodeidswftetug73fpetugfwd3.linkid7ockpetuqdc66etuqdq4c:id83t9setug73fpetug74ah.nodeidswftetug73fpetugfwd3">
     212                    <property name="bounds" value="290,650,84,16"/>
     213                </reference>
     214            </reference>
    203215            <reference referencedUin="design:link:::id83t9setug73fpetug74ah.nodeidswftetug73fpetugfwd3.linkid3jvhdetug73fpetugiz5h:id83t9setug73fpetug74ah.nodeidswftetug73fpetugfwd3">
    204216                <property name="sourceAnchor" value="210,670"/>
     
    217229                <property name="bounds_setted_by_user" value="true"/>
    218230                <reference referencedUin="linklabel:$transitionInplaceEditing:design:link:::id83t9setug73fpetug74ah.nodeid3z4oketug73fpetuggjl4.linkidotudetug73fpetugilak:id83t9setug73fpetug74ah.nodeid3z4oketug73fpetuggjl4">
    219                     <property name="bounds" value="470,600,45,15"/>
     231                    <property name="bounds" value="470,600,45,16"/>
    220232                </reference>
    221233            </reference>
     
    233245        <reference df-class-name="reference17" referencedUin="design:node:::id83t9setug73fpetug74ah.nodeid6t6upetug73fpetugj6k4">
    234246            <property name="$shortcutReference" value="true"/>
    235             <property name="bounds" value="290,190,192,40"/>
     247            <property name="bounds" value="290,190,189,40"/>
    236248            <reference referencedUin="design:link:::id83t9setug73fpetug74ah.nodeid6t6upetug73fpetugj6k4.linkid529snetug73fpetuglmq0:id83t9setug73fpetug74ah.nodeid6t6upetug73fpetugj6k4">
    237                 <property name="sourceAnchor" value="482,220"/>
     249                <property name="sourceAnchor" value="479,220"/>
    238250                <property name="bendpoints" value="550,220,550,830"/>
    239251                <property name="targetAnchor" value="284,830"/>
     
    248260        <reference df-class-name="reference18" referencedUin="design:node:::id83t9setug73fpetug74ah.nodeid5e0mxetug73fpetugjk65">
    249261            <property name="$shortcutReference" value="true"/>
    250             <property name="bounds" value="320,270,121,40"/>
     262            <property name="bounds" value="320,270,118,40"/>
    251263            <reference referencedUin="design:link:::id83t9setug73fpetug74ah.nodeid5e0mxetug73fpetugjk65.linkidcf8yetug73fpetuglj2g:id83t9setug73fpetug74ah.nodeid5e0mxetug73fpetugjk65">
    252                 <property name="sourceAnchor" value="441,300"/>
     264                <property name="sourceAnchor" value="438,300"/>
    253265                <property name="bendpoints" value="550,300,550,820"/>
    254266                <property name="targetAnchor" value="284,820"/>
     
    271283                <property name="targetAnchor" value="210,380"/>
    272284                <reference referencedUin="linklabel:$transitionInplaceEditing:design:link:::id83t9setug73fpetug74ah.nodeid6yrvpetui3nn8etui62p3.linkid4uffpetui3nn8etui6xmx:id83t9setug73fpetug74ah.nodeid6yrvpetui3nn8etui62p3">
    273                     <property name="bounds" value="220,360,128,15"/>
     285                    <property name="bounds" value="220,360,122,16"/>
    274286                </reference>
    275287            </reference>
     
    396408            <participant role="Client" referencedUin="design:node:::id83t9setug73fpetug74ah.nodeid7q41getug73fpetugejq5"/>
    397409            <property name="$metaclass" value="Transition"/>
    398             <property name="$event_name" value="Load again"/>
     410            <property name="$event_name" value="Loaded again"/>
    399411        </link>
    400412    </node>
     
    415427            <participant role="Client" referencedUin="design:node:::id83t9setug73fpetug74ah.nodeid6b4f8etug73fpetugfa3i"/>
    416428            <property name="$metaclass" value="Transition"/>
     429            <property name="$event_name" value="Other init failure"/>
    417430        </link>
    418431    </node>
     
    448461            <participant role="Client" referencedUin="design:node:::id83t9setug73fpetug74ah.nodeidswftetug73fpetugfwd3"/>
    449462            <property name="$metaclass" value="Transition"/>
     463        </link>
     464        <link uin="id83t9setug73fpetug74ah.nodeidswftetug73fpetugfwd3.linkid7ockpetuqdc66etuqdq4c">
     465            <property name="$metaclass" value="Transition"/>
     466            <participant role="Supplier" referencedUin="design:node:::id83t9setug73fpetug74ah.nodeid8048etug73fpetugfpwv"/>
     467            <participant role="Client" referencedUin="design:node:::id83t9setug73fpetug74ah.nodeidswftetug73fpetugfwd3"/>
     468            <property name="$event_name" value="Loaded again"/>
    450469        </link>
    451470    </node>
     
    502521        <property name="$name" value="SyncBar1"/>
    503522        <link uin="id83t9setug73fpetug74ah.nodeid6yrvpetui3nn8etui62p3.linkid4uffpetui3nn8etui6xmx">
    504             <property name="$metaclass" value="Transition"/>
    505523            <participant role="Supplier" referencedUin="design:node:::id83t9setug73fpetug74ah.nodeid6b4f8etug73fpetugfa3i"/>
    506524            <participant role="Client" referencedUin="design:node:::id83t9setug73fpetug74ah.nodeid6yrvpetui3nn8etui62p3"/>
     525            <property name="$metaclass" value="Transition"/>
    507526            <property name="$event_name" value="Fixed up all modules"/>
    508527        </link>
  • trunk/kLdr/tg/kLdr.tpr

    r2838 r2840  
    66Root.0.package_prefix=
    77Version=3.0
    8 projectfile.encoding=MacRoman
     8projectfile.encoding=MS932
     9Root.1=$TGH$/jdk/jre/lib/rt.jar
     10Root.1.access=import
     11Root.1.non_removable=
    912[workspace]
    1013Developer.CodingWorkspace={{0,2,-1,0,0,0,0,0,0,1,0,50,75,25,-1,-1,-1,-1}${0,1,-1,0,0,0,0,1,0,1,0,50,75,25,-1,-1,-1,-1}${0,3,-1,0,0,0,0,1,0,1,0,66,50,25,-1,-1,-1,-1}${0,3,-1,0,0,0,0,1,0,1,0,66,50,25,-1,-1,-1,-1}${0,-1,-1,0,0,0,0,0,0,1,0,5,5,5,-1,-1,-1,-1}${0,5,-1,0,0,0,0,0,0,1,0,50,50,25,-1,-1,-1,-1}${0,4,-1,0,0,0,0,1,0,1,1,66,50,25,-1,-1,-1,-1}${0,7,-1,0,0,0,0,0,0,1,0,50,50,75,-1,-1,-1,-1}}
Note: See TracChangeset for help on using the changeset viewer.