| ... | @@ -1771,6 +1771,226 @@ pub const E = enum(u16) { | ... | @@ -1771,6 +1771,226 @@ pub const E = enum(u16) { |
| 1771 | _, | 1771 | _, |
| 1772 | }; | 1772 | }; |
| 1773 | | 1773 | |
| | 1774 | /// Kernel return values |
| | 1775 | pub const KernE = enum(u8) { |
| | 1776 | SUCCESS = 0, |
| | 1777 | |
| | 1778 | /// Specified address is not currently valid |
| | 1779 | INVALID_ADDRESS = 1, |
| | 1780 | |
| | 1781 | /// Specified memory is valid, but does not permit the |
| | 1782 | /// required forms of access. |
| | 1783 | PROTECTION_FAILURE = 2, |
| | 1784 | |
| | 1785 | /// The address range specified is already in use, or |
| | 1786 | /// no address range of the size specified could be |
| | 1787 | /// found. |
| | 1788 | NO_SPACE = 3, |
| | 1789 | |
| | 1790 | /// The function requested was not applicable to this |
| | 1791 | /// type of argument, or an argument is invalid |
| | 1792 | INVALID_ARGUMENT = 4, |
| | 1793 | |
| | 1794 | /// The function could not be performed. A catch-all. |
| | 1795 | FAILURE = 5, |
| | 1796 | |
| | 1797 | /// A system resource could not be allocated to fulfill |
| | 1798 | /// this request. This failure may not be permanent. |
| | 1799 | RESOURCE_SHORTAGE = 6, |
| | 1800 | |
| | 1801 | /// The task in question does not hold receive rights |
| | 1802 | /// for the port argument. |
| | 1803 | NOT_RECEIVER = 7, |
| | 1804 | |
| | 1805 | /// Bogus access restriction. |
| | 1806 | NO_ACCESS = 8, |
| | 1807 | |
| | 1808 | /// During a page fault, the target address refers to a |
| | 1809 | /// memory object that has been destroyed. This |
| | 1810 | /// failure is permanent. |
| | 1811 | MEMORY_FAILURE = 9, |
| | 1812 | |
| | 1813 | /// During a page fault, the memory object indicated |
| | 1814 | /// that the data could not be returned. This failure |
| | 1815 | /// may be temporary; future attempts to access this |
| | 1816 | /// same data may succeed, as defined by the memory |
| | 1817 | /// object. |
| | 1818 | MEMORY_ERROR = 10, |
| | 1819 | |
| | 1820 | /// The receive right is already a member of the portset. |
| | 1821 | ALREADY_IN_SET = 11, |
| | 1822 | |
| | 1823 | /// The receive right is not a member of a port set. |
| | 1824 | NOT_IN_SET = 12, |
| | 1825 | |
| | 1826 | /// The name already denotes a right in the task. |
| | 1827 | NAME_EXISTS = 13, |
| | 1828 | |
| | 1829 | /// The operation was aborted. Ipc code will |
| | 1830 | /// catch this and reflect it as a message error. |
| | 1831 | ABORTED = 14, |
| | 1832 | |
| | 1833 | /// The name doesn't denote a right in the task. |
| | 1834 | INVALID_NAME = 15, |
| | 1835 | |
| | 1836 | /// Target task isn't an active task. |
| | 1837 | INVALID_TASK = 16, |
| | 1838 | |
| | 1839 | /// The name denotes a right, but not an appropriate right. |
| | 1840 | INVALID_RIGHT = 17, |
| | 1841 | |
| | 1842 | /// A blatant range error. |
| | 1843 | INVALID_VALUE = 18, |
| | 1844 | |
| | 1845 | /// Operation would overflow limit on user-references. |
| | 1846 | UREFS_OVERFLOW = 19, |
| | 1847 | |
| | 1848 | /// The supplied (port) capability is improper. |
| | 1849 | INVALID_CAPABILITY = 20, |
| | 1850 | |
| | 1851 | /// The task already has send or receive rights |
| | 1852 | /// for the port under another name. |
| | 1853 | RIGHT_EXISTS = 21, |
| | 1854 | |
| | 1855 | /// Target host isn't actually a host. |
| | 1856 | INVALID_HOST = 22, |
| | 1857 | |
| | 1858 | /// An attempt was made to supply "precious" data |
| | 1859 | /// for memory that is already present in a |
| | 1860 | /// memory object. |
| | 1861 | MEMORY_PRESENT = 23, |
| | 1862 | |
| | 1863 | /// A page was requested of a memory manager via |
| | 1864 | /// memory_object_data_request for an object using |
| | 1865 | /// a MEMORY_OBJECT_COPY_CALL strategy, with the |
| | 1866 | /// VM_PROT_WANTS_COPY flag being used to specify |
| | 1867 | /// that the page desired is for a copy of the |
| | 1868 | /// object, and the memory manager has detected |
| | 1869 | /// the page was pushed into a copy of the object |
| | 1870 | /// while the kernel was walking the shadow chain |
| | 1871 | /// from the copy to the object. This error code |
| | 1872 | /// is delivered via memory_object_data_error |
| | 1873 | /// and is handled by the kernel (it forces the |
| | 1874 | /// kernel to restart the fault). It will not be |
| | 1875 | /// seen by users. |
| | 1876 | MEMORY_DATA_MOVED = 24, |
| | 1877 | |
| | 1878 | /// A strategic copy was attempted of an object |
| | 1879 | /// upon which a quicker copy is now possible. |
| | 1880 | /// The caller should retry the copy using |
| | 1881 | /// vm_object_copy_quickly. This error code |
| | 1882 | /// is seen only by the kernel. |
| | 1883 | MEMORY_RESTART_COPY = 25, |
| | 1884 | |
| | 1885 | /// An argument applied to assert processor set privilege |
| | 1886 | /// was not a processor set control port. |
| | 1887 | INVALID_PROCESSOR_SET = 26, |
| | 1888 | |
| | 1889 | /// The specified scheduling attributes exceed the thread's |
| | 1890 | /// limits. |
| | 1891 | POLICY_LIMIT = 27, |
| | 1892 | |
| | 1893 | /// The specified scheduling policy is not currently |
| | 1894 | /// enabled for the processor set. |
| | 1895 | INVALID_POLICY = 28, |
| | 1896 | |
| | 1897 | /// The external memory manager failed to initialize the |
| | 1898 | /// memory object. |
| | 1899 | INVALID_OBJECT = 29, |
| | 1900 | |
| | 1901 | /// A thread is attempting to wait for an event for which |
| | 1902 | /// there is already a waiting thread. |
| | 1903 | ALREADY_WAITING = 30, |
| | 1904 | |
| | 1905 | /// An attempt was made to destroy the default processor |
| | 1906 | /// set. |
| | 1907 | DEFAULT_SET = 31, |
| | 1908 | |
| | 1909 | /// An attempt was made to fetch an exception port that is |
| | 1910 | /// protected, or to abort a thread while processing a |
| | 1911 | /// protected exception. |
| | 1912 | EXCEPTION_PROTECTED = 32, |
| | 1913 | |
| | 1914 | /// A ledger was required but not supplied. |
| | 1915 | INVALID_LEDGER = 33, |
| | 1916 | |
| | 1917 | /// The port was not a memory cache control port. |
| | 1918 | INVALID_MEMORY_CONTROL = 34, |
| | 1919 | |
| | 1920 | /// An argument supplied to assert security privilege |
| | 1921 | /// was not a host security port. |
| | 1922 | INVALID_SECURITY = 35, |
| | 1923 | |
| | 1924 | /// thread_depress_abort was called on a thread which |
| | 1925 | /// was not currently depressed. |
| | 1926 | NOT_DEPRESSED = 36, |
| | 1927 | |
| | 1928 | /// Object has been terminated and is no longer available |
| | 1929 | TERMINATED = 37, |
| | 1930 | |
| | 1931 | /// Lock set has been destroyed and is no longer available. |
| | 1932 | LOCK_SET_DESTROYED = 38, |
| | 1933 | |
| | 1934 | /// The thread holding the lock terminated before releasing |
| | 1935 | /// the lock |
| | 1936 | LOCK_UNSTABLE = 39, |
| | 1937 | |
| | 1938 | /// The lock is already owned by another thread |
| | 1939 | LOCK_OWNED = 40, |
| | 1940 | |
| | 1941 | /// The lock is already owned by the calling thread |
| | 1942 | LOCK_OWNED_SELF = 41, |
| | 1943 | |
| | 1944 | /// Semaphore has been destroyed and is no longer available. |
| | 1945 | SEMAPHORE_DESTROYED = 42, |
| | 1946 | |
| | 1947 | /// Return from RPC indicating the target server was |
| | 1948 | /// terminated before it successfully replied |
| | 1949 | RPC_SERVER_TERMINATED = 43, |
| | 1950 | |
| | 1951 | /// Terminate an orphaned activation. |
| | 1952 | RPC_TERMINATE_ORPHAN = 44, |
| | 1953 | |
| | 1954 | /// Allow an orphaned activation to continue executing. |
| | 1955 | RPC_CONTINUE_ORPHAN = 45, |
| | 1956 | |
| | 1957 | /// Empty thread activation (No thread linked to it) |
| | 1958 | NOT_SUPPORTED = 46, |
| | 1959 | |
| | 1960 | /// Remote node down or inaccessible. |
| | 1961 | NODE_DOWN = 47, |
| | 1962 | |
| | 1963 | /// A signalled thread was not actually waiting. |
| | 1964 | NOT_WAITING = 48, |
| | 1965 | |
| | 1966 | /// Some thread-oriented operation (semaphore_wait) timed out |
| | 1967 | OPERATION_TIMED_OUT = 49, |
| | 1968 | |
| | 1969 | /// During a page fault, indicates that the page was rejected |
| | 1970 | /// as a result of a signature check. |
| | 1971 | CODESIGN_ERROR = 50, |
| | 1972 | |
| | 1973 | /// The requested property cannot be changed at this time. |
| | 1974 | POLICY_STATIC = 51, |
| | 1975 | |
| | 1976 | /// The provided buffer is of insufficient size for the requested data. |
| | 1977 | INSUFFICIENT_BUFFER_SIZE = 52, |
| | 1978 | |
| | 1979 | /// Denied by security policy |
| | 1980 | DENIED = 53, |
| | 1981 | |
| | 1982 | /// The KC on which the function is operating is missing |
| | 1983 | MISSING_KC = 54, |
| | 1984 | |
| | 1985 | /// The KC on which the function is operating is invalid |
| | 1986 | INVALID_KC = 55, |
| | 1987 | |
| | 1988 | /// A search or query operation did not return a result |
| | 1989 | NOT_FOUND = 56, |
| | 1990 | |
| | 1991 | _, |
| | 1992 | }; |
| | 1993 | |
| 1774 | pub const SIGSTKSZ = 131072; | 1994 | pub const SIGSTKSZ = 131072; |
| 1775 | pub const MINSIGSTKSZ = 32768; | 1995 | pub const MINSIGSTKSZ = 32768; |
| 1776 | | 1996 | |