Changeset 3533


Ignore:
Timestamp:
Feb 4, 2013, 8:50:34 AM (15 months ago)
Author:
quozl
Message:

OLPC - allocate any heap during driver open rather than during an alarm handler, for the /ap-sp, /keyboard, and /usb/keyboard drivers, fixes #12466, tested with 128,000 boot cycles across four units.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpu/arm/olpc/spcmd.fth

    r3497 r3533  
    5050#queues /n* buffer: tails  : tail  ( -- adr )  tails queue# na+  ; 
    5151 
    52 #queues /q * buffer: qs    : q  ( adr -- )  qs queue# /q * +  ; 
     52#queues /q * buffer: qs    : q  ( -- adr )  qs queue# /q * +  ; 
    5353 
    5454/q 1- value   q-end 
     
    5757   #queues  0  do 
    5858      i to queue# 
    59       0 head !  0 tail !   /q 1- to q-end 
     59      0 head !  0 tail !   q drop  /q 1- to q-end 
    6060   loop 
    6161; 
     
    6464; 
    6565 
    66 false value locked?               \ Interrupt lockout for get-scan 
     66false value locked?               \ Interrupt lockout for get-data? 
    6767 
    6868: lock    ( -- )  true  to locked?  ; 
     
    126126: open  ( -- flag ) 
    127127   open-count  0=  if 
     128      init-queues 
    128129      my-address my-space  h# 1000  " map-in" $call-parent  is reg-base 
    129130      data? 0=  if  send-rdy  then 
  • dev/pckbd.fth

    r2604 r3533  
    56561-     value   q-end 
    5757 
    58 : init-q  ( -- )  0 head !  0 tail !  /q 1- to q-end  ; 
     58: init-q  ( -- )  0 head !  0 tail !  q drop /q 1- to q-end  ; 
    5959: inc-q-ptr  ( pointer-addr -- ) 
    6060   dup @ q-end >=  if  0 swap !  else  /c swap +!  then 
  • dev/usb2/device/keyboard/kbd.fth

    r2590 r3533  
    6868/qe         buffer:  null-entry         \ Buffer to hold a null entry 
    6969 
    70 : init-q  ( -- )  0 head !  0 tail !   #qe 1- to q-end  ; 
     70: init-q  ( -- ) 
     71   0 head !  0 tail !   q drop  #qe 1- to q-end 
     72   last-entry drop  new-entry drop  cur-entry drop  null-entry drop 
     73; 
    7174: inc-q-ptr  ( pointer-addr -- ) 
    7275   dup @ q-end >=  if  0 swap !  else  1 swap +!  then 
     
    371374: open  ( -- flag ) 
    372375   kbd-refcount @  if  1 +refcnt true exit  then 
     376   init-q 
    373377   init-kbd-buf 
    374378   setup-hardware?  if 
Note: See TracChangeset for help on using the changeset viewer.