anchor.diff:  0 VALUE dma-window-size         \ Size of the window
   
   0 VALUE bm-handle               \ Bitmap allocator handle
  -0 VALUE my-virt
  -0 VALUE my-size
  -0 VALUE dev-addr
  -0 VALUE tmp-dev-addr
   
   \ Read helper variables (LIOBN, DMA window base and size) from the
   \ "ibm,dma-window" property. This property can be either located
  
positive.code: 
  : dma-alloc ( size -- virt )
     phb-debug? IF cr ." dma-alloc called: " .s cr THEN
     fff + fff not and                  \ Align size to next 4k boundary
     alloc-mem
     \ alloc-mem always returns aligned memory - double check just to be sure
     dup fff and IF
        ." Warning: dma-alloc got unaligned memory!" cr
     THEN
  ;
  
  : dma-free ( virt size -- )
     phb-debug? IF cr ." dma-free called: " .s cr THEN
     fff + fff not and                  \ Align size to next 4k boundary
     free-mem
  ;
  
  
negative.code:    decode-64 TO dma-window-size
     2drop
     bm-handle 0= IF
         dma-window-base dma-window-size tce-ps bm-allocator-init to bm-handle
         \ Sometimes the window-base appears as zero, that does not
         \ go well with NULL pointers. So block this address
         dma-window-base 0= IF
            bm-handle tce-ps bm-alloc drop
         THEN
     THEN
  ;
  