Subversion Repositories Kolibri OS

Rev

Rev 1676 | Rev 2409 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1676 Rev 2090
Line 1875... Line 1875...
1875
  * Events prohibited in the mask are saved anyway, when come;
1875
  * Events prohibited in the mask are saved anyway, when come;
1876
    they are simply not informed with event functions.
1876
    they are simply not informed with event functions.
1877
  * Event functions take into account the mask on moment of
1877
  * Event functions take into account the mask on moment of
1878
    function call, not on moment of event arrival.
1878
    function call, not on moment of event arrival.
Line 1879... Line -...
1879
 
-
 
1880
======================================================================
-
 
1881
==================== Function 41 - get IRQ owner. ====================
-
 
1882
======================================================================
-
 
1883
Parameters:
-
 
1884
  * eax = 41 - function number
-
 
1885
  * ebx = IRQ number, 0..15
-
 
1886
Returned value:
-
 
1887
  * eax = owner PID
-
 
1888
  * eax = 0, if there is no owner
-
 
1889
  * eax = -1 for incorrect ebx
-
 
1890
 
-
 
1891
======================================================================
-
 
1892
================== Function 42 - work with IRQ data. =================
-
 
1893
======================================================================
-
 
1894
When an IRQ occurs, the system reads data from ports indicated
-
 
1895
earlier by function 44 and writes this data to
-
 
1896
internal buffer. This function reads out data from that buffer.
-
 
1897
 
-
 
1898
--------------------- Subfunction 0 - read data ----------------------
-
 
1899
Parameters:
-
 
1900
  * eax = 42 - function number
-
 
1901
  * bl = IRQ number, 0..15
-
 
1902
  * bh = 0 - subfunction number
-
 
1903
  * rest of ebx must be zeroed
-
 
1904
  * ecx = pointer to a buffer with size not less than 4000 bytes
-
 
1905
Returned value: (use value of eax to distinguish)
-
 
1906
  * if the thread is not IRQ owner
-
 
1907
    (or IRQ number is incorrect): eax = -1
-
 
1908
  * if there is no data: eax = 0
-
 
1909
  * if all is ok:
-
 
1910
    eax = size of data read (in bytes)
-
 
1911
 
-
 
1912
------------- Subfunction 1 - get size of data in buffer -------------
-
 
1913
Parameters:
-
 
1914
  * eax = 42 - function number
-
 
1915
  * bl = IRQ number, 0..15
-
 
1916
  * bh = 0 - subfunction number
-
 
1917
  * rest of ebx must be zeroed
-
 
1918
Returned value:
-
 
1919
  * if the thread is not IRQ owner
-
 
1920
    (or IRQ number is incorrect): eax = -1
-
 
1921
  * otherwise eax = size of data in buffer
-
 
1922
Remarks:
-
 
1923
  * Previously the thread must reserve indicated IRQ for itself
-
 
1924
    by function 45.
-
 
1925
  * The size of data buffer is 4000 bytes, on overflow
-
 
Line 1926... Line 1879...
1926
    "fresh" data cease to be written in the buffer.
1879
 
1927
 
1880
 
1928
======================================================================
1881
======================================================================
Line 1951... Line 1904...
1951
    for itself by function 46.
1904
    for itself by function 46.
1952
  * Instead of call to this function it is better to use
1905
  * Instead of call to this function it is better to use
1953
    processor instructions in/out - this is much
1906
    processor instructions in/out - this is much
1954
    faster and a bit shorter and easier.
1907
    faster and a bit shorter and easier.
Line 1955... Line -...
1955
 
-
 
1956
======================================================================
-
 
1957
=========== Function 44 - define operations at IRQ arrival. ==========
-
 
1958
======================================================================
-
 
1959
At IRQ arrival the system can read the data from ports defined
-
 
1960
by this function and write these data to internal buffer, whence
-
 
1961
they can be read by ôóíêöèåé 42.
-
 
1962
Parameters:
-
 
1963
  * eax = 44 - function number
-
 
1964
  * ebx = pointer to the array of structures each describing one port:
-
 
1965
    * +0: word: 0 means end of array, otherwise port number
-
 
1966
    * +2: byte: reserved (ignored)
-
 
1967
    * +3: byte: 1=read byte from this port, 2=read word
-
 
1968
  * ecx = IRQ number, 0..15
-
 
1969
Returned value:
-
 
1970
  * eax = 0 - success
-
 
1971
  * eax = 1 - the thread is not owner of selected IRQ
-
 
1972
Remarks:
-
 
1973
  * Previously the thread must reserve for itself selected IRQ
-
 
1974
    by function 45.
-
 
1975
  * First 16 ports are considered only.
-
 
1976
  * The current implementation considers incorrect value of field +3
-
 
1977
    as a signal to terminate IRQ processing.
-
 
1978
 
-
 
1979
======================================================================
-
 
1980
=================== Function 45 - reserve/free IRQ. ==================
-
 
1981
======================================================================
-
 
1982
Parameters:
-
 
1983
  * eax = 45 - function number
-
 
1984
  * ebx = 0 - reserve, 1 = free
-
 
1985
  * ecx = IRQ number, 0..15
-
 
1986
Returned value:
-
 
1987
  * eax = 0 - success
-
 
1988
  * eax = 1 - error (invalid IRQ number
-
 
1989
    or attempt to reserve not free IRQ
-
 
1990
    or to free IRQ, not reserved by this thread)
-
 
1991
Remarks:
-
 
1992
  * IRQ reservation is required for functions 42 and 44.
-
 
1993
  * Only one thread can reserve the specific IRQ.
-
 
1994
  * IRQs, handled by the system itself, are reserved by the system
-
 
1995
    (thread 1) at booting.
-
 
1996
  * When a thread terminates, all reserved by it IRQs
-
 
Line 1997... Line 1908...
1997
    are freed automatically.
1908
 
1998
 
1909
 
1999
======================================================================
1910
======================================================================
2000
====== Function 46 - reserve/free a group of input/output ports. =====
1911
====== Function 46 - reserve/free a group of input/output ports. =====