lcd.txt 2.99 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56


========================================
LCD STATUS
========================================

An lcd can be in one of five states:

   E = Embryo       -  just after it is created, not configured with a starting
                       stack pointer, etc.
   C = Configured   -  stack pointer, starting program counter configured
   R = Running      -  kthread is runnable or running, and may be running 
                       inside vm
   S = Suspended    -  kthread is asleep or will soon sleep
   D = Dead         -  kthread has stopped or will soon stop; lcd may be in
                       the process of being torn down

                                  _____________________________________
                                 /          lcd_destroy                \
          lcd_run               |                                       |
          lcd_suspend           |            lcd_run, lcd_config        |
           .__.                 ^                .__.                   |
          |   |    .----------->|               |   |                   |
          \   |   / lcd_destroy |               \   |                   |
           \  |  /              ^                \  |                   |
            \ V /               |                 \ V                   V
   create  +---+  lcd_config  +---+   lcd_run    +---+  lcd_destroy   +---+
  -------->| E |------------->| C |------------->| R |--------------->| D |
           +---+           .->+---+              +---+                +---+
                          /   /                   / ^                  ^ \
                         /   /                   /   \                 |  \
                        /   /                   /    |                 |   \
                       '---'        lcd_suspend |    | lcd_run         '---'
                   lcd_config,                  \    /              lcd_run
                   lcd_suspend                   V  /               lcd_suspend
                                                 +---+              lcd_destroy
                                                 | S |              lcd_config
                                                 +---+
                                                  ^ \
                                                  |  \
                                                  |   \
                                                  '---'
                                             lcd_config, lcd_suspend


The following transitions are an error (return non-zero), and have no effect:

    E: lcd_run, lcd_suspend    -  you must configure the lcd first
    C: lcd_config, lcd_suspend -  lcd already configured; cannot suspend either
    R: lcd_run, lcd_config     -  lcd already running and config'd
    S: lcd_suspend, lcd_config -  lcd already suspended and config'd
    D: all                     -  lcd is dead

Some of these may be too restrictive, and could change in the future (e.g.,
allow re-config, allow multiple suspend calls - only first one has effect,
rest are no-ops).