#ifndef DEFINES_KERNEL_H
#define DEFINES_KERNEL_H

/*
    *** Automatically generated from '/home/aros/ABIv0/Build/20110803/AROS/rom/kernel/kernel.conf'. Edits will be lost. ***
    Copyright © 1995-2011, The AROS Development Team. All rights reserved.
*/

/*
    Desc: Defines for kernel
*/

#include <aros/libcall.h>
#include <exec/types.h>
#include <aros/preprocessor/variadic/cast2iptr.hpp>

__BEGIN_DECLS


#define __KrnGetScheduler_WB(__KernelBase) \
        AROS_LC0(KRN_SchedType, KrnGetScheduler, \
        APTR , (__KernelBase), 1, Kernel)

#define KrnGetScheduler() \
    __KrnGetScheduler_WB(KernelBase)

#define __KrnSetScheduler_WB(__KernelBase, __arg1) \
        AROS_LC1NR(void, KrnSetScheduler, \
                  AROS_LCA(KRN_SchedType,(__arg1),D0), \
        APTR , (__KernelBase), 2, Kernel)

#define KrnSetScheduler(arg1) \
    __KrnSetScheduler_WB(KernelBase, (arg1))

#define __KrnCause_WB(__KernelBase) \
        AROS_LC0NR(void, KrnCause, \
        APTR , (__KernelBase), 3, Kernel)

#define KrnCause() \
    __KrnCause_WB(KernelBase)

#define __KrnDispatch_WB(__KernelBase) \
        AROS_LC0NR(void, KrnDispatch, \
        APTR , (__KernelBase), 4, Kernel)

#define KrnDispatch() \
    __KrnDispatch_WB(KernelBase)

#define __KrnSwitch_WB(__KernelBase) \
        AROS_LC0NR(void, KrnSwitch, \
        APTR , (__KernelBase), 5, Kernel)

#define KrnSwitch() \
    __KrnSwitch_WB(KernelBase)

#define __KrnSchedule_WB(__KernelBase) \
        AROS_LC0NR(void, KrnSchedule, \
        APTR , (__KernelBase), 6, Kernel)

#define KrnSchedule() \
    __KrnSchedule_WB(KernelBase)

#define __KrnAddIRQHandler_WB(__KernelBase, __arg1, __arg2, __arg3, __arg4) \
        AROS_LC4(void *, KrnAddIRQHandler, \
                  AROS_LCA(uint8_t,(__arg1),D0), \
                  AROS_LCA(void *,(__arg2),A0), \
                  AROS_LCA(void *,(__arg3),A1), \
                  AROS_LCA(void *,(__arg4),A2), \
        APTR , (__KernelBase), 7, Kernel)

#define KrnAddIRQHandler(arg1, arg2, arg3, arg4) \
    __KrnAddIRQHandler_WB(KernelBase, (arg1), (arg2), (arg3), (arg4))

#define __KrnRemIRQHandler_WB(__KernelBase, __arg1) \
        AROS_LC1NR(void, KrnRemIRQHandler, \
                  AROS_LCA(void *,(__arg1),A0), \
        APTR , (__KernelBase), 8, Kernel)

#define KrnRemIRQHandler(arg1) \
    __KrnRemIRQHandler_WB(KernelBase, (arg1))

#define __KrnCli_WB(__KernelBase) \
        AROS_LC0NR(void, KrnCli, \
        APTR , (__KernelBase), 9, Kernel)

#define KrnCli() \
    __KrnCli_WB(KernelBase)

#define __KrnSti_WB(__KernelBase) \
        AROS_LC0NR(void, KrnSti, \
        APTR , (__KernelBase), 10, Kernel)

#define KrnSti() \
    __KrnSti_WB(KernelBase)

#define __KrnGetBootInfo_WB(__KernelBase) \
        AROS_LC0(struct TagItem *, KrnGetBootInfo, \
        APTR , (__KernelBase), 11, Kernel)

#define KrnGetBootInfo() \
    __KrnGetBootInfo_WB(KernelBase)

#define __KrnBug_WB(__KernelBase, __arg1, __arg2) \
        AROS_LC2(int, KrnBug, \
                  AROS_LCA(const char *,(__arg1),A0), \
                  AROS_LCA(va_list,(__arg2),A1), \
        APTR , (__KernelBase), 12, Kernel)

#define KrnBug(arg1, arg2) \
    __KrnBug_WB(KernelBase, (arg1), (arg2))

#define __KrnIsSuper_WB(__KernelBase) \
        AROS_LC0(int, KrnIsSuper, \
        APTR , (__KernelBase), 13, Kernel)

#define KrnIsSuper() \
    __KrnIsSuper_WB(KernelBase)

#define __KrnAddExceptionHandler_WB(__KernelBase, __arg1, __arg2, __arg3, __arg4) \
        AROS_LC4(void *, KrnAddExceptionHandler, \
                  AROS_LCA(uint8_t,(__arg1),D0), \
                  AROS_LCA(void *,(__arg2),A0), \
                  AROS_LCA(void *,(__arg3),A1), \
                  AROS_LCA(void *,(__arg4),A2), \
        APTR , (__KernelBase), 14, Kernel)

#define KrnAddExceptionHandler(arg1, arg2, arg3, arg4) \
    __KrnAddExceptionHandler_WB(KernelBase, (arg1), (arg2), (arg3), (arg4))

#define __KrnRemExceptionHandler_WB(__KernelBase, __arg1) \
        AROS_LC1NR(void, KrnRemExceptionHandler, \
                  AROS_LCA(void *,(__arg1),A0), \
        APTR , (__KernelBase), 15, Kernel)

#define KrnRemExceptionHandler(arg1) \
    __KrnRemExceptionHandler_WB(KernelBase, (arg1))

#define __KrnMapGlobal_WB(__KernelBase, __arg1, __arg2, __arg3, __arg4) \
        AROS_LC4(int, KrnMapGlobal, \
                  AROS_LCA(void *,(__arg1),A0), \
                  AROS_LCA(void *,(__arg2),A1), \
                  AROS_LCA(uint32_t,(__arg3),D0), \
                  AROS_LCA(KRN_MapAttr,(__arg4),D1), \
        APTR , (__KernelBase), 16, Kernel)

#define KrnMapGlobal(arg1, arg2, arg3, arg4) \
    __KrnMapGlobal_WB(KernelBase, (arg1), (arg2), (arg3), (arg4))

#define __KrnUnmapGlobal_WB(__KernelBase, __arg1, __arg2) \
        AROS_LC2(int, KrnUnmapGlobal, \
                  AROS_LCA(void *,(__arg1),A0), \
                  AROS_LCA(uint32_t,(__arg2),D0), \
        APTR , (__KernelBase), 17, Kernel)

#define KrnUnmapGlobal(arg1, arg2) \
    __KrnUnmapGlobal_WB(KernelBase, (arg1), (arg2))

#define __KrnCreateContext_WB(__KernelBase) \
        AROS_LC0(void *, KrnCreateContext, \
        APTR , (__KernelBase), 18, Kernel)

#define KrnCreateContext() \
    __KrnCreateContext_WB(KernelBase)

#define __KrnDeleteContext_WB(__KernelBase, __arg1) \
        AROS_LC1NR(void, KrnDeleteContext, \
                  AROS_LCA(void *,(__arg1),A0), \
        APTR , (__KernelBase), 19, Kernel)

#define KrnDeleteContext(arg1) \
    __KrnDeleteContext_WB(KernelBase, (arg1))

#define __KrnVirtualToPhysical_WB(__KernelBase, __arg1) \
        AROS_LC1(void *, KrnVirtualToPhysical, \
                  AROS_LCA(void *,(__arg1),A0), \
        APTR , (__KernelBase), 20, Kernel)

#define KrnVirtualToPhysical(arg1) \
    __KrnVirtualToPhysical_WB(KernelBase, (arg1))

#define __KrnSetProtection_WB(__KernelBase, __arg1, __arg2, __arg3) \
        AROS_LC3NR(void, KrnSetProtection, \
                  AROS_LCA(void *,(__arg1),A0), \
                  AROS_LCA(uint32_t,(__arg2),D0), \
                  AROS_LCA(KRN_MapAttr,(__arg3),D1), \
        APTR , (__KernelBase), 21, Kernel)

#define KrnSetProtection(arg1, arg2, arg3) \
    __KrnSetProtection_WB(KernelBase, (arg1), (arg2), (arg3))

#define __KrnRegisterModule_WB(__KernelBase, __arg1, __arg2, __arg3, __arg4) \
        AROS_LC4NR(void, KrnRegisterModule, \
                  AROS_LCA(const char *,(__arg1),A0), \
                  AROS_LCA(BPTR,(__arg2),A1), \
                  AROS_LCA(ULONG,(__arg3),D0), \
                  AROS_LCA(APTR,(__arg4),A2), \
        APTR , (__KernelBase), 22, Kernel)

#define KrnRegisterModule(arg1, arg2, arg3, arg4) \
    __KrnRegisterModule_WB(KernelBase, (arg1), (arg2), (arg3), (arg4))

#define __KrnUnregisterModule_WB(__KernelBase, __arg1) \
        AROS_LC1NR(void, KrnUnregisterModule, \
                  AROS_LCA(BPTR,(__arg1),A0), \
        APTR , (__KernelBase), 23, Kernel)

#define KrnUnregisterModule(arg1) \
    __KrnUnregisterModule_WB(KernelBase, (arg1))

#define __KrnDecodeLocationA_WB(__KernelBase, __arg1, __arg2) \
        AROS_LC2(int, KrnDecodeLocationA, \
                  AROS_LCA(void *,(__arg1),A0), \
                  AROS_LCA(struct TagItem *,(__arg2),A1), \
        APTR , (__KernelBase), 24, Kernel)

#define KrnDecodeLocationA(arg1, arg2) \
    __KrnDecodeLocationA_WB(KernelBase, (arg1), (arg2))

#if !defined(NO_INLINE_STDARG) && !defined(KERNEL_NO_INLINE_STDARG)
#define KrnDecodeLocation(arg1, ...) \
({ \
    IPTR __args[] = { AROS_PP_VARIADIC_CAST2IPTR(__VA_ARGS__) }; \
    KrnDecodeLocationA((arg1), (struct TagItem *)__args); \
})
#endif /* !NO_INLINE_STDARG */

#define __KrnPutChar_WB(__KernelBase, __arg1) \
        AROS_LC1NR(void, KrnPutChar, \
                  AROS_LCA(char,(__arg1),D0), \
        APTR , (__KernelBase), 25, Kernel)

#define KrnPutChar(arg1) \
    __KrnPutChar_WB(KernelBase, (arg1))

#define __KrnMayGetChar_WB(__KernelBase) \
        AROS_LC0(int, KrnMayGetChar, \
        APTR , (__KernelBase), 26, Kernel)

#define KrnMayGetChar() \
    __KrnMayGetChar_WB(KernelBase)

#define __KrnAllocPages_WB(__KernelBase, __arg1, __arg2, __arg3) \
        AROS_LC3(void *, KrnAllocPages, \
                  AROS_LCA(void *,(__arg1),A0), \
                  AROS_LCA(uintptr_t,(__arg2),D0), \
                  AROS_LCA(uint32_t,(__arg3),D1), \
        APTR , (__KernelBase), 27, Kernel)

#define KrnAllocPages(arg1, arg2, arg3) \
    __KrnAllocPages_WB(KernelBase, (arg1), (arg2), (arg3))

#define __KrnFreePages_WB(__KernelBase, __arg1, __arg2) \
        AROS_LC2NR(void, KrnFreePages, \
                  AROS_LCA(void *,(__arg1),A0), \
                  AROS_LCA(uintptr_t,(__arg2),D0), \
        APTR , (__KernelBase), 28, Kernel)

#define KrnFreePages(arg1, arg2) \
    __KrnFreePages_WB(KernelBase, (arg1), (arg2))

#define __KrnGetSystemAttr_WB(__KernelBase, __arg1) \
        AROS_LC1(intptr_t, KrnGetSystemAttr, \
                  AROS_LCA(uint32_t,(__arg1),D0), \
        APTR , (__KernelBase), 29, Kernel)

#define KrnGetSystemAttr(arg1) \
    __KrnGetSystemAttr_WB(KernelBase, (arg1))

#define __KrnSetSystemAttr_WB(__KernelBase, __arg1, __arg2) \
        AROS_LC2(int, KrnSetSystemAttr, \
                  AROS_LCA(uint32_t,(__arg1),D0), \
                  AROS_LCA(intptr_t,(__arg2),D1), \
        APTR , (__KernelBase), 30, Kernel)

#define KrnSetSystemAttr(arg1, arg2) \
    __KrnSetSystemAttr_WB(KernelBase, (arg1), (arg2))

#define __KrnInitMemory_WB(__KernelBase, __arg1) \
        AROS_LC1NR(void, KrnInitMemory, \
                  AROS_LCA(struct MemHeader *,(__arg1),A0), \
        APTR , (__KernelBase), 31, Kernel)

#define KrnInitMemory(arg1) \
    __KrnInitMemory_WB(KernelBase, (arg1))

#define __KrnStatMemoryA_WB(__KernelBase, __arg1, __arg2) \
        AROS_LC2(ULONG, KrnStatMemoryA, \
                  AROS_LCA(uint32_t,(__arg1),D0), \
                  AROS_LCA(struct TagItem *,(__arg2),A0), \
        APTR , (__KernelBase), 32, Kernel)

#define KrnStatMemoryA(arg1, arg2) \
    __KrnStatMemoryA_WB(KernelBase, (arg1), (arg2))

#if !defined(NO_INLINE_STDARG) && !defined(KERNEL_NO_INLINE_STDARG)
#define KrnStatMemory(arg1, ...) \
({ \
    IPTR __args[] = { AROS_PP_VARIADIC_CAST2IPTR(__VA_ARGS__) }; \
    KrnStatMemoryA((arg1), (struct TagItem *)__args); \
})
#endif /* !NO_INLINE_STDARG */

__END_DECLS

#endif /* DEFINES_KERNEL_H*/
