From: mazze Date: Sat, 20 Jul 2013 11:30:00 +0000 (+0000) Subject: Removed autodocs of arch specific variants of ROM modules. X-Git-Url: https://repo.or.cz/w/AROS.git/commitdiff_plain/a91b73964645629a8b27ef28232c5329da47f87a Removed autodocs of arch specific variants of ROM modules. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@47740 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- diff --git a/arch/all-unix/exec/allocmem.c b/arch/all-unix/exec/allocmem.c index 1f54b75ff1..601d401dd6 100644 --- a/arch/all-unix/exec/allocmem.c +++ b/arch/all-unix/exec/allocmem.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2012, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: Allocate some memory @@ -36,46 +36,12 @@ #include "exec_intern.h" -/***************************************************************************** +/* See rom/exec/allocmem.c for documentation */ - NAME */ - - AROS_LH2(APTR, AllocMem, - -/* SYNOPSIS */ - AROS_LHA(IPTR, byteSize, D0), - AROS_LHA(ULONG, requirements, D1), - -/* LOCATION */ - struct ExecBase *, SysBase, 33, Exec) - -/* FUNCTION - Allocate some memory from the sytem memory pool with the given - requirements. - - INPUTS - byteSize - Number of bytes you want to get - requirements - Type of memory - - RESULT - A pointer to the number of bytes you wanted or NULL if the memory - couldn't be allocated - - NOTES - The memory is aligned to sizeof(struct MemChunk). All requests - are rounded up to a multiple of that size. - - EXAMPLE - mytask=(struct Task *)AllocMem(sizeof(struct Task),MEMF_PUBLIC|MEMF_CLEAR); - - BUGS - - SEE ALSO - FreeMem() - - INTERNALS - -******************************************************************************/ +AROS_LH2(APTR, AllocMem, + AROS_LHA(IPTR, byteSize, D0), + AROS_LHA(ULONG, requirements, D1), + struct ExecBase *, SysBase, 33, Exec) { AROS_LIBFUNC_INIT diff --git a/arch/all-unix/exec/freemem.c b/arch/all-unix/exec/freemem.c index f2688eee48..a6a422229f 100644 --- a/arch/all-unix/exec/freemem.c +++ b/arch/all-unix/exec/freemem.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2012, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: Free memory allocated by AllocMem() @@ -35,40 +35,12 @@ #undef FreeMem /* If we're debugging, AROS Clib will try to remap this */ -/***************************************************************************** +/* See rom/exec/freemem.c for documentation */ - NAME */ - - AROS_LH2(void, FreeMem, - -/* SYNOPSIS */ - AROS_LHA(APTR, memoryBlock, A1), - AROS_LHA(IPTR, byteSize, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 35, Exec) - -/* FUNCTION - Give a block of memory back to the system pool. - - INPUTS - memoryBlock - Pointer to the memory to be freed - byteSize - Size of the block - - RESULT - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - AllocMem() - - INTERNALS - -******************************************************************************/ +AROS_LH2(void, FreeMem, + AROS_LHA(APTR, memoryBlock, A1), + AROS_LHA(IPTR, byteSize, D0), + struct ExecBase *, SysBase, 35, Exec) { AROS_LIBFUNC_INIT diff --git a/arch/all-unix/exec/shutdowna.c b/arch/all-unix/exec/shutdowna.c index 6def8dc515..4aa256bc9a 100644 --- a/arch/all-unix/exec/shutdowna.c +++ b/arch/all-unix/exec/shutdowna.c @@ -15,43 +15,11 @@ #include "exec_intern.h" #include "exec_util.h" -/***************************************************************************** +/* See rom/exec/shutdowna.c for documentation */ - NAME */ - - AROS_LH1(ULONG, ShutdownA, - -/* SYNOPSIS */ - AROS_LHA(ULONG, action, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 173, Exec) - -/* FUNCTION - This function will shut down the operating system. - - INPUTS - action - what to do: - * SD_ACTION_POWEROFF - power off the machine. - * SD_ACTION_COLDREBOOT - cold reboot the machine (not only AROS). - - RESULT - This function does not return in case of success. Otherwise is returns - zero. - - NOTES - It can be quite harmful to call this function. It may be possible that - you will lose data from other tasks not having saved, or disk buffers - not being flushed. Plus you could annoy the (other) users. - - EXAMPLE - - BUGS - - SEE ALSO - ColdReboot() - -******************************************************************************/ +AROS_LH1(ULONG, ShutdownA, + AROS_LHA(ULONG, action, D0), + struct ExecBase *, SysBase, 173, Exec) { AROS_LIBFUNC_INIT diff --git a/arch/all-unix/kernel/cli.c b/arch/all-unix/kernel/cli.c index 6ebb156241..adcfdb8db0 100644 --- a/arch/all-unix/kernel/cli.c +++ b/arch/all-unix/kernel/cli.c @@ -5,35 +5,12 @@ #include "kernel_base.h" #include "kernel_intern.h" -/***************************************************************************** - - NAME */ #include -AROS_LH0(void, KrnCli, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 9, Kernel) - -/* FUNCTION - - INPUTS - - RESULT +/* See rom/kernel/cli.c for documentation */ - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ +AROS_LH0(void, KrnCli, + struct KernelBase *, KernelBase, 9, Kernel) { AROS_LIBFUNC_INIT diff --git a/arch/arm-raspi/exec/coldreboot.c b/arch/arm-raspi/exec/coldreboot.c index 6a8b903524..ad5a17d0b3 100644 --- a/arch/arm-raspi/exec/coldreboot.c +++ b/arch/arm-raspi/exec/coldreboot.c @@ -16,36 +16,10 @@ #include "exec_intern.h" #include "exec_util.h" -/***************************************************************************** +/* See rom/exec/coldreboot.c for documentation */ - NAME */ - - AROS_LH0(void, ColdReboot, - -/* LOCATION */ - struct ExecBase *, SysBase, 121, Exec) - -/* FUNCTION - This function will reboot the computer. - - INPUTS - None. - - RESULT - This function does not return. - - NOTES - It can be quite harmful to call this function. It may be possible that - you will lose data from other tasks not having saved, or disk buffers - not being flushed. Plus you could annoy the (other) users. - - EXAMPLE - - BUGS - - SEE ALSO - -******************************************************************************/ +AROS_LH0(void, ColdReboot, + struct ExecBase *, SysBase, 121, Exec) { AROS_LIBFUNC_INIT diff --git a/arch/arm-raspi/exec/superstate.c b/arch/arm-raspi/exec/superstate.c index f0c7984f39..2ba7cfc365 100644 --- a/arch/arm-raspi/exec/superstate.c +++ b/arch/arm-raspi/exec/superstate.c @@ -6,45 +6,12 @@ Lang: english */ -/***************************************************************************** - - NAME */ #include - AROS_LH0(APTR, SuperState, - -/* LOCATION */ - struct ExecBase *, SysBase, 25, Exec) - -/* FUNCTION - Enter supervisor mode (like Supervisor()), but return on the user - stack. This will mean that the user stack variables are still there. - A call to UserState() will end this mode. - - INPUTS - None. - - RESULT - The old supervisor stack. This must be passed to UserState(). If the - processor was already in supervisor mode, then this function will - return NULL. In that case do NOT call UserState(). - - NOTES - This is not a good function to use, it has limited scope, and will - probably be even less useful in the future. - - EXAMPLE - - BUGS - You can easily cause your system to cease operating normally. - - SEE ALSO - Supervisor(), UserState() - - INTERNALS - For extra details see Supervisor(). +/* See rom/exec/superstate.c for documentation */ -******************************************************************************/ +AROS_LH0(APTR, SuperState, + struct ExecBase *, SysBase, 25, Exec) { AROS_LIBFUNC_INIT diff --git a/arch/arm-raspi/exec/userstate.c b/arch/arm-raspi/exec/userstate.c index 08c8bb0d21..3b5f5bffa7 100644 --- a/arch/arm-raspi/exec/userstate.c +++ b/arch/arm-raspi/exec/userstate.c @@ -6,41 +6,13 @@ Lang: english */ -/***************************************************************************** - - NAME */ #include - AROS_LH1(void, UserState, - -/* SYNOPSIS */ - AROS_LHA(APTR, superSP, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 26, Exec) - -/* FUNCTION - Return to user mode after a call to SuperState(). - - INPUTS - superSP - The return value from SuperState() - - RESULT - The system will be back to normal. - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - SuperState(), Supervisor() - - INTERNALS - Undo SuperState() +/* See rom/exec/userstate.c for documentation */ -******************************************************************************/ +AROS_LH1(void, UserState, + AROS_LHA(APTR, superSP, D0), + struct ExecBase *, SysBase, 26, Exec) { AROS_LIBFUNC_INIT diff --git a/arch/arm-raspi/kernel/cli.c b/arch/arm-raspi/kernel/cli.c dissimilarity index 67% index 8c0875dde2..3bee81eb97 100644 --- a/arch/arm-raspi/kernel/cli.c +++ b/arch/arm-raspi/kernel/cli.c @@ -1,53 +1,23 @@ -/* - Copyright © 2013, The AROS Development Team. All rights reserved. - $Id$ -*/ - -#include - -#include -#include - -/***************************************************************************** - - NAME */ -#include - -AROS_LH0I(void, KrnCli, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 9, Kernel) - -/* FUNCTION - Instantly disable interrupts. - - INPUTS - None - - RESULT - None - - NOTES - This is low level function, it does not have nesting count - and state tracking mechanism. It operates directly on the CPU. - Normal applications should consider using exec.library/Disable(). - - EXAMPLE - - BUGS - - SEE ALSO - KrnSti() - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - krnSysCall(SC_CLI); - - AROS_LIBFUNC_EXIT -} +/* + Copyright © 2013, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#include + +#include +#include + +#include + +/* See rom/kernel/cli.c for documentation */ + +AROS_LH0I(void, KrnCli, + struct KernelBase *, KernelBase, 9, Kernel) +{ + AROS_LIBFUNC_INIT + + krnSysCall(SC_CLI); + + AROS_LIBFUNC_EXIT +} diff --git a/arch/arm-raspi/kernel/issuper.c b/arch/arm-raspi/kernel/issuper.c index d4f667660c..7822d68213 100644 --- a/arch/arm-raspi/kernel/issuper.c +++ b/arch/arm-raspi/kernel/issuper.c @@ -10,42 +10,12 @@ #include -/***************************************************************************** - - NAME */ #include -AROS_LH0I(int, KrnIsSuper, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 13, Kernel) - -/* FUNCTION - Determine if the caller is running in supervisor mode - - INPUTS - None - - RESULT - Nonzero for supervisor mode, zero for user mode +/* See rom/kernel/issuper.c for documentation */ - NOTES - Callers should only test the return value against zero. - Nonzero values may actually be different, since they - may carry some private implementation-dependent information - (like CPU privilege level, for example). - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ +AROS_LH0I(int, KrnIsSuper, + struct KernelBase *, KernelBase, 13, Kernel) { AROS_LIBFUNC_INIT diff --git a/arch/arm-raspi/kernel/maygetchar.c b/arch/arm-raspi/kernel/maygetchar.c index e2db80c4f7..8bd4da98ba 100644 --- a/arch/arm-raspi/kernel/maygetchar.c +++ b/arch/arm-raspi/kernel/maygetchar.c @@ -11,41 +11,12 @@ #include #include -/***************************************************************************** - - NAME */ #include -AROS_LH0(int, KrnMayGetChar, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 26, Kernel) - -/* FUNCTION - Read a single character from low-level debug input stream - - INPUTS - None - - RESULT - An ASCII code of the character or -1 if there's no character - available +/* See rom/kernel/maygetchar.c for documentation */ - NOTES - This function never waits. If there is no character available on - the stream it just returns with -1 - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ +AROS_LH0(int, KrnMayGetChar, + struct KernelBase *, KernelBase, 26, Kernel) { AROS_LIBFUNC_INIT diff --git a/arch/arm-raspi/kernel/sti.c b/arch/arm-raspi/kernel/sti.c dissimilarity index 67% index 22d79156ee..132ac970df 100644 --- a/arch/arm-raspi/kernel/sti.c +++ b/arch/arm-raspi/kernel/sti.c @@ -1,53 +1,23 @@ -/* - Copyright © 2013, The AROS Development Team. All rights reserved. - $Id$ -*/ - -#include - -#include -#include - -/***************************************************************************** - - NAME */ -#include - -AROS_LH0I(void, KrnSti, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 10, Kernel) - -/* FUNCTION - Instantly enable interrupts. - - INPUTS - None - - RESULT - None - - NOTES - This is low level function, it does not have nesting count - and state tracking mechanism. It operates directly on the CPU. - Normal applications should consider using exec.library/Enable(). - - EXAMPLE - - BUGS - - SEE ALSO - KrnCli() - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - krnSysCall(SC_STI); - - AROS_LIBFUNC_EXIT -} +/* + Copyright © 2013, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#include + +#include +#include + +#include + +/* See rom/kernel/sti.c for documentation */ + +AROS_LH0I(void, KrnSti, + struct KernelBase *, KernelBase, 10, Kernel) +{ + AROS_LIBFUNC_INIT + + krnSysCall(SC_STI); + + AROS_LIBFUNC_EXIT +} diff --git a/arch/arm-raspi/processor/getcpuinfo.c b/arch/arm-raspi/processor/getcpuinfo.c index d1f60a644c..af8388e30b 100644 --- a/arch/arm-raspi/processor/getcpuinfo.c +++ b/arch/arm-raspi/processor/getcpuinfo.c @@ -18,38 +18,13 @@ static void ProcessFeaturesTag(struct ARMProcessorInformation * info, struct TagItem * tag); -/***************************************************************************** - - NAME */ #include - AROS_LH1(void, GetCPUInfo, - -/* SYNOPSIS */ - AROS_LHA(struct TagItem *, tagList, A0), - -/* LOCATION */ - struct ProcessorBase *, ProcessorBase, 1, Processor) - -/* FUNCTION - - INPUTS - - TAGS - - RESULT - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS +/* See rom/processor/getcpuinfo.c for documentation */ -******************************************************************************/ +AROS_LH1(void, GetCPUInfo, + AROS_LHA(struct TagItem *, tagList, A0), + struct ProcessorBase *, ProcessorBase, 1, Processor) { AROS_LIBFUNC_INIT diff --git a/arch/i386-pc/exec/debug.c b/arch/i386-pc/exec/debug.c index 3f4bd2f495..f708bfb1d1 100644 --- a/arch/i386-pc/exec/debug.c +++ b/arch/i386-pc/exec/debug.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2011, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: Start the internal debugger. @@ -12,6 +12,8 @@ #include #include +/* See rom/exec/debug.c for documentation */ + /****************************************************************************************/ #define Prompt kprintf("SAD(%ld,%ld)>",SysBase->TDNestCnt,SysBase->IDNestCnt) @@ -36,41 +38,9 @@ int get_irq_list(char *buf); /****************************************************************************************/ - -/***************************************************************************** - - NAME */ - - AROS_LH1(void, Debug, - -/* SYNOPSIS */ - AROS_LHA(unsigned long, flags, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 19, Exec) - -/* FUNCTION - Runs SAD - internal debuger. - - INPUTS - flags not used. Should be 0 now. - - RESULT - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - - HISTORY - 18-01-99 initial PC version. - -*****************************************************************************/ +AROS_LH1(void, Debug, + AROS_LHA(unsigned long, flags, D0), + struct ExecBase *, SysBase, 19, Exec) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-all/dos/callglobvec.c b/arch/m68k-all/dos/callglobvec.c index ae8c9e4a2b..3d807973ed 100644 --- a/arch/m68k-all/dos/callglobvec.c +++ b/arch/m68k-all/dos/callglobvec.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2011, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: Open a file with the specified mode. @@ -22,45 +22,16 @@ extern void BCPL_thunk(void); #define __is_process(task) (((struct Task *)task)->tc_Node.ln_Type == NT_PROCESS) -/***************************************************************************** - - NAME */ #include - AROS_UFH5(LONG, CallGlobVec, - -/* SYNOPSIS */ - AROS_UFHA(LONG, function, D0), - AROS_UFHA(LONG, d1, D1), - AROS_UFHA(LONG, d2, D2), - AROS_UFHA(LONG, d3, D3), - AROS_UFHA(LONG, d4, D4) - -/* LOCATION */ - ) - -/* FUNCTION - Private function to call a BCPL routine from C - - INPUTS - function - BCPL Global Vector function index - d1..d4 - Parameter to the function - - RESULT - return value of the BCPL routine - - NOTES - This works only on m68k. - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS +/* See rom/dos/callglobvec.c for documentation */ -*****************************************************************************/ +AROS_UFH5(LONG, CallGlobVec, + AROS_UFHA(LONG, function, D0), + AROS_UFHA(LONG, d1, D1), + AROS_UFHA(LONG, d2, D2), + AROS_UFHA(LONG, d3, D3), + AROS_UFHA(LONG, d4, D4)) { AROS_USERFUNC_INIT diff --git a/arch/m68k-all/exec/cachecleare.c b/arch/m68k-all/exec/cachecleare.c index dcf498a613..4d7f3eb465 100644 --- a/arch/m68k-all/exec/cachecleare.c +++ b/arch/m68k-all/exec/cachecleare.c @@ -14,65 +14,15 @@ extern void AROS_SLIB_ENTRY(CacheClearE_00,Exec,107)(void); extern void AROS_SLIB_ENTRY(CacheClearE_20,Exec,107)(void); extern void AROS_SLIB_ENTRY(CacheClearE_4060,Exec,107)(void); -/***************************************************************************** - - NAME */ #include - AROS_LH3(void, CacheClearE, - -/* SYNOPSIS */ - AROS_LHA(APTR, address, A0), - AROS_LHA(ULONG, length, D0), - AROS_LHA(ULONG, caches, D1), - -/* LOCATION */ - struct ExecBase *, SysBase, 107, Exec) - -/* FUNCTION - Flush the contents of the CPU instruction or data caches. If some - of the cache contains dirty data, push it to memory first. - - For most systems DMA will not effect processor caches. If *any* - external (non-processor) event changes system memory, you MUST - clear the cache. For example: - - DMA - Code relocation to run at a different address - Building jump tables - Loading code from disk - - INPUTS - address - Address to start the operation. This address may be - rounded DOWN due to hardware granularity. - length - Length of the memory to flush. This will be rounded - up, of $FFFFFFFF to indicate that all addresses - should be cleared. - caches - Bit flags to indicate which caches should be cleared - - CACRF_ClearI - Clear the instruction cache - CACRF_ClearD - Clear the data cache - - All other bits are reserved. - - RESULT - The caches will be flushed. - - NOTES - It is possible that on some systems the entire cache will be - even if this was not the specific request. - - EXAMPLE - - BUGS - - SEE ALSO - CacheClearU(), CacheControl() - - INTERNALS - This is a rather CPU dependant function. +/* See rom/exec/cachecleare.c for documentation */ -******************************************************************************/ +AROS_LH3(void, CacheClearE, + AROS_LHA(APTR, address, A0), + AROS_LHA(ULONG, length, D0), + AROS_LHA(ULONG, caches, D1), + struct ExecBase *, SysBase, 107, Exec) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-all/exec/cacheclearu.c b/arch/m68k-all/exec/cacheclearu.c index 1c96e56d03..f5baf3311a 100644 --- a/arch/m68k-all/exec/cacheclearu.c +++ b/arch/m68k-all/exec/cacheclearu.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2001, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: CacheClearU - Simple way of clearing the caches. @@ -14,50 +14,13 @@ extern void AROS_SLIB_ENTRY(CacheClearU_00,Exec,106)(void); extern void AROS_SLIB_ENTRY(CacheClearU_20,Exec,106)(void); extern void AROS_SLIB_ENTRY(CacheClearU_40,Exec,106)(void); extern void AROS_SLIB_ENTRY(CacheClearU_60,Exec,106)(void); -/***************************************************************************** - NAME */ #include - AROS_LH0(void, CacheClearU, +/* See rom/exec/cacheclearu.c for documentation */ -/* LOCATION */ - struct ExecBase *, SysBase, 106, Exec) - -/* FUNCTION - Flush the entire contents of the CPU instruction and data caches. - If some of the cache contains dirty data, push it to memory first. - - For most systems DMA will not effect processor caches. If *any* - external (non-processor) event changes system memory, you MUST - clear the cache. For example: - - DMA - Code relocation to run at a different address - Building jump tables - Loading code from disk - - INPUTS - - RESULT - The caches will be flushed. - - NOTES - It is possible that on some systems the entire cache will be - even if this was not the specific request. - - EXAMPLE - - BUGS - - SEE ALSO - CacheClearE(), CacheControl(), CachePreDMA(), CachePostDMA() - - INTERNALS - Although it is not necessary, but it could be more efficient if - this function was replaced by a function in $(KERNEL). - -******************************************************************************/ +AROS_LH0(void, CacheClearU, + struct ExecBase *, SysBase, 106, Exec) { AROS_LIBFUNC_INIT void (*func)(void); diff --git a/arch/m68k-all/exec/cachecontrol.c b/arch/m68k-all/exec/cachecontrol.c index 1e82c85f8e..073c1dc7bd 100644 --- a/arch/m68k-all/exec/cachecontrol.c +++ b/arch/m68k-all/exec/cachecontrol.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2011, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: CacheControl() - Global control of the system caches. @@ -10,64 +10,18 @@ #include #include +/* See rom/exec/cachecontrol.c for documentation */ + extern void AROS_SLIB_ENTRY(CacheControl_00,Exec,108)(void); extern void AROS_SLIB_ENTRY(CacheControl_20,Exec,108)(void); extern void AROS_SLIB_ENTRY(CacheControl_40,Exec,108)(void); -/***************************************************************************** - - NAME */ #include - AROS_LH2(ULONG, CacheControl, - -/* SYNOPSIS */ - AROS_LHA(ULONG, cacheBits, D0), - AROS_LHA(ULONG, cacheMask, D1), - -/* LOCATION */ - struct ExecBase *, SysBase, 108, Exec) - -/* FUNCTION - This function will provide global control of all the processor - instruction and data caches. It is not possible to have per - task control. - - The actions undertaken by this function are very CPU dependant, - however the actions performed will match the specified options - as close as is possible. - - The commands currently defined in the include file exec/execbase.h - are closely related to the cache control register of the Motorola - MC68030 CPU. - - INPUTS - cacheBits - The new state of the bits - cacheMask - A mask of the bits you wish to change. - - RESULT - oldBits - The complete value of the cache control bits - prior to the call of this function. - - Your requested actions will have been performed. As a side effect - this function will also cause the caches to be cleared. - - NOTES - On CPU's without a separate instruction and data cache, these will - be considered as equal. - - EXAMPLE - - BUGS - - SEE ALSO - CacheClearE(), CacheClearU() - - INTERNALS - This function requires replacing in $(KERNEL), or possibly - even $(ARCH) in some cases. - -******************************************************************************/ +AROS_LH2(ULONG, CacheControl, + AROS_LHA(ULONG, cacheBits, D0), + AROS_LHA(ULONG, cacheMask, D1), + struct ExecBase *, SysBase, 108, Exec) { AROS_LIBFUNC_INIT void (*func)(void); diff --git a/arch/m68k-all/exec/cachepostdma.c b/arch/m68k-all/exec/cachepostdma.c index 2ba600ae53..e8db93529d 100644 --- a/arch/m68k-all/exec/cachepostdma.c +++ b/arch/m68k-all/exec/cachepostdma.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2010, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: CachePostDMA() - Do what is necessary for DMA. @@ -14,49 +14,16 @@ extern void AROS_SLIB_ENTRY(CachePostDMA_00,Exec,128)(void); extern void AROS_SLIB_ENTRY(CachePostDMA_30,Exec,128)(void); extern void AROS_SLIB_ENTRY(CachePostDMA_40,Exec,128)(void); -/***************************************************************************** - NAME */ #include - AROS_LH3(void, CachePostDMA, +/* See rom/exec/cachepostdma.c for documentation */ -/* SYNOPSIS */ - AROS_LHA(APTR, address, A0), - AROS_LHA(ULONG *, length, A1), - AROS_LHA(ULONG, flags, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 128, Exec) - -/* FUNCTION - Do everything necessary to make CPU caches aware that a DMA has - happened. - - INPUTS - address - Virtual address of memory affected by the DMA - *length - Number of bytes affected - flags - DMA_NoModify - Indicate that the memory did not change. - DMA_ReadFromRAM - Indicate that the DMA goes from RAM - to the device. Set this bit in - both calls. - - RESULT - - NOTES - DMA must follow a call to CachePostDMA() and must be followed - by a call to CachePostDMA(). - - EXAMPLE - - BUGS - - SEE ALSO - CachePostDMA() - - INTERNALS - -******************************************************************************/ +AROS_LH3(void, CachePostDMA, + AROS_LHA(APTR, address, A0), + AROS_LHA(ULONG *, length, A1), + AROS_LHA(ULONG, flags, D0), + struct ExecBase *, SysBase, 128, Exec) { AROS_LIBFUNC_INIT void (*func)(void); diff --git a/arch/m68k-all/exec/cachepredma.c b/arch/m68k-all/exec/cachepredma.c index 06a853a617..338bf4b7d0 100644 --- a/arch/m68k-all/exec/cachepredma.c +++ b/arch/m68k-all/exec/cachepredma.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2010, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: CachePreDMA() - Do what is necessary for DMA. @@ -14,58 +14,16 @@ extern void AROS_SLIB_ENTRY(CachePreDMA_00,Exec,127)(void); extern void AROS_SLIB_ENTRY(CachePreDMA_40,Exec,127)(void); -/***************************************************************************** - NAME */ #include - AROS_LH3(APTR, CachePreDMA, +/* See rom/exec/cachepredma.c for documentation */ -/* SYNOPSIS */ - AROS_LHA(APTR, address, A0), - AROS_LHA(ULONG *, length, A1), - AROS_LHA(ULONG, flags, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 127, Exec) - -/* FUNCTION - Do everything necessary to make CPU caches aware that a DMA - will happen. Virtual memory systems will make it possible - that your memory is not at one block and not at the address - you thought. This function gives you all the information - you need to split the DMA request up and to convert virtual - to physical addresses. - - INPUTS - address - Virtual address of memory affected by the DMA - *length - Number of bytes affected - flags - DMA_Continue - This is a call to continue a - request that was broken up. - DMA_ReadFromRAM - Indicate that the DMA goes from - RAM to the device. Set this bit - in both calls. - - RESULT - The physical address in memory. - *length contains the number of contiguous bytes in physical - memory. - - NOTES - DMA must follow a call to CachePreDMA() and must be followed - by a call to CachePostDMA(). - - EXAMPLE - - BUGS - - SEE ALSO - CachePostDMA() - - INTERNALS - This function should be replaced by a function in $(KERNEL). - -******************************************************************************/ +AROS_LH3(APTR, CachePreDMA, + AROS_LHA(APTR, address, A0), + AROS_LHA(ULONG *, length, A1), + AROS_LHA(ULONG, flags, D0), + struct ExecBase *, SysBase, 127, Exec) { AROS_LIBFUNC_INIT void (*func)(void); diff --git a/arch/m68k-all/exec/copymem.c b/arch/m68k-all/exec/copymem.c index f698fecc90..161db97478 100644 --- a/arch/m68k-all/exec/copymem.c +++ b/arch/m68k-all/exec/copymem.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2012, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: CopyMem() @@ -14,44 +14,13 @@ extern void AROS_SLIB_ENTRY(CopyMem_000,Exec,104)(void); extern void AROS_SLIB_ENTRY(CopyMem_020,Exec,104)(void); -/***************************************************************************** +/* See rom/kernel/copymem.c for documentation */ - NAME */ - - AROS_LH3I(void, CopyMem, - -/* SYNOPSIS */ - AROS_LHA(CONST_APTR, source, A0), - AROS_LHA(APTR, dest, A1), - AROS_LHA(IPTR, size, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 104, Exec) - -/* FUNCTION - Copy some memory from one destination in memory to another using - a fast copying method. - - INPUTS - source - Pointer to source area - dest - Pointer to destination - size - number of bytes to copy (may be zero) - - RESULT - - NOTES - The source and destination area are not allowed to overlap. - - EXAMPLE - - BUGS - - SEE ALSO - CopyMemQuick() - - INTERNALS - -******************************************************************************/ +AROS_LH3I(void, CopyMem, + AROS_LHA(CONST_APTR, source, A0), + AROS_LHA(APTR, dest, A1), + AROS_LHA(IPTR, size, D0), + struct ExecBase *, SysBase, 104, Exec) { AROS_LIBFUNC_INIT void (*func)(void); diff --git a/arch/m68k-all/exec/getcc.c b/arch/m68k-all/exec/getcc.c dissimilarity index 69% index 15e9917ca1..704f945b24 100644 --- a/arch/m68k-all/exec/getcc.c +++ b/arch/m68k-all/exec/getcc.c @@ -1,55 +1,25 @@ -/* - Copyright © 1995-2001, The AROS Development Team. All rights reserved. - $Id$ - - Desc: GetCC() - Read the CPU condition codes in an easy way. - Lang: english -*/ - -#include - -/***************************************************************************** - - NAME */ -#include - - AROS_LH0(UWORD, GetCC, - -/* LOCATION */ - struct ExecBase *, SysBase, 88, Exec) - -/* FUNCTION - Read the contents of the CPU condition code register in a system - independant way. The flags return will be in the same format as - the Motorola MC680x0 family of microprocessors. - - INPUTS - None. - - RESULT - The CPU condition codes or ~0ul if this function has not been - implemented. - - NOTES - - EXAMPLE - - BUGS - This function may not be implemented on platforms other than - Motorola mc680x0 processors. - - SEE ALSO - SetSR() - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - /* Overridden on the RegCall ABI's startup routine */ - aros_print_not_implemented("GetCC"); - return ~0; - - AROS_LIBFUNC_EXIT -} /* GetCC() */ +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: GetCC() - Read the CPU condition codes in an easy way. + Lang: english +*/ + +#include + +#include + +/* See rom/exec/getcc.c for documentation */ + +AROS_LH0(UWORD, GetCC, + struct ExecBase *, SysBase, 88, Exec) +{ + AROS_LIBFUNC_INIT + + /* Overridden on the RegCall ABI's startup routine */ + aros_print_not_implemented("GetCC"); + return ~0; + + AROS_LIBFUNC_EXIT +} /* GetCC() */ diff --git a/arch/m68k-all/exec/setfunction.c b/arch/m68k-all/exec/setfunction.c index 1c5403488c..3a9f5d8a97 100644 --- a/arch/m68k-all/exec/setfunction.c +++ b/arch/m68k-all/exec/setfunction.c @@ -25,6 +25,8 @@ #include #undef kprintf +/* See rom/kernel/setfunction.c for documentation */ + /* moveb %d0, %a3@+ * rts */ @@ -70,66 +72,11 @@ static AROS_UFH5(APTR, myRawDoFmt, AROS_USERFUNC_EXIT } -/***************************************************************************** - - NAME */ - - AROS_LH3(APTR, SetFunction, - -/* SYNOPSIS */ - AROS_LHA(struct Library *, library, A1), - AROS_LHA(LONG, funcOffset, A0), - AROS_LHA(APTR, newFunction, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 70, Exec) - -/* FUNCTION - Replaces a certain jumptable entry with another one. This function only - Forbid()s taskswitching but doesn't Disable() interrupts. You have - to do your own arbitration for functions which are callable from - interrupts. - - INPUTS - library - Pointer to library structure. - funcOffset - Offset of the jumpvector from the library base address in - bytes. It's the negative LVO (library vector offset) - multiplied with LIB_VECTSIZE. - newFunction - New jumptable entry (pointer to the new function). - - RESULT - Old jumptable entry (pointer to the old function). - - NOTES - While it's more or less safe to patch a library vector with - SetFunction() it's not possible to safely remove the patch later. - So don't use this function if it can be avoided. - - EXAMPLE - Patch of the function Open() from dos.library: - You can find the LVO of 5 in clib/dos_protos.h. - SetFunction(DOSBase, -5 * LIB_VECTSIZE, NewOpen); - NewOpen must be prepared with AROS_UFH macros. - - BUGS - This contains a hack to fix dos.library/ramlib attempts to - setfunction exec functions. Because of this, a funcOffset - of more than 32 kB be truncated. This hack will also fix - other programs only using the lower 16 bits of funcOffset - and leaving garbage in the upper 16 bits. - - These programs should be fixed. - - Also, this includes a hack to fix attempt to SetFunction the - Exec/RawDoFmt() routine, which adds a wrapper to translate - 'magic' AROS PutChFunc vectors to real functions. - - SEE ALSO - MakeLibrary(), MakeFunctions(), SumLibrary() - - INTERNALS - -******************************************************************************/ +AROS_LH3(APTR, SetFunction, + AROS_LHA(struct Library *, library, A1), + AROS_LHA(LONG, funcOffset, A0), + AROS_LHA(APTR, newFunction, D0), + struct ExecBase *, SysBase, 70, Exec) { AROS_LIBFUNC_INIT APTR ret; diff --git a/arch/m68k-all/kernel/dispatch.c b/arch/m68k-all/kernel/dispatch.c dissimilarity index 75% index 5cb1841438..30c11768a6 100644 --- a/arch/m68k-all/kernel/dispatch.c +++ b/arch/m68k-all/kernel/dispatch.c @@ -1,53 +1,19 @@ -#include - -#include -#include - -/***************************************************************************** - - NAME */ -#include - -AROS_LH0(void, KrnDispatch, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 4, Kernel) - -/* FUNCTION - Run the next available task - - INPUTS - None - - RESULT - None - - NOTES - This entry point directly calls task dispatch routine in supervisor mode. - It neither performs any checks of caller status nor obeys interrupt enable - state. After calling this function, caller's task will be replaced by - another one, and caller's state will be lost. - - This function is safe to call only from within user mode. - This function is considered internal, and not meant to be called - by user's software. - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - /* The real implementation is in Exec/Dispatch */ - Supervisor(__AROS_GETVECADDR(SysBase,10)); - - AROS_LIBFUNC_EXIT -} +#include + +#include +#include + +#include + +/* See rom/kernel/dispatch.c for documentation */ + +AROS_LH0(void, KrnDispatch, + struct KernelBase *, KernelBase, 4, Kernel) +{ + AROS_LIBFUNC_INIT + + /* The real implementation is in Exec/Dispatch */ + Supervisor(__AROS_GETVECADDR(SysBase,10)); + + AROS_LIBFUNC_EXIT +} diff --git a/arch/m68k-all/kernel/mapglobal.c b/arch/m68k-all/kernel/mapglobal.c index 078df49912..b33e978791 100644 --- a/arch/m68k-all/kernel/mapglobal.c +++ b/arch/m68k-all/kernel/mapglobal.c @@ -4,39 +4,16 @@ #include #include -/***************************************************************************** - - NAME */ #include -AROS_LH4(int, KrnMapGlobal, - -/* SYNOPSIS */ - AROS_LHA(void *, virtual, A0), - AROS_LHA(void *, physical, A1), - AROS_LHA(uint32_t, length, D0), - AROS_LHA(KRN_MapAttr, flags, D1), - -/* LOCATION */ - struct KernelBase *, KernelBase, 16, Kernel) - -/* FUNCTION - - INPUTS - - RESULT +/* See rom/kernel/mapglobal.c for documentation */ - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ +AROS_LH4(int, KrnMapGlobal, + AROS_LHA(void *, virtual, A0), + AROS_LHA(void *, physical, A1), + AROS_LHA(uint32_t, length, D0), + AROS_LHA(KRN_MapAttr, flags, D1), + struct KernelBase *, KernelBase, 16, Kernel) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-all/kernel/schedule.c b/arch/m68k-all/kernel/schedule.c dissimilarity index 72% index 18e2577344..ab18427325 100644 --- a/arch/m68k-all/kernel/schedule.c +++ b/arch/m68k-all/kernel/schedule.c @@ -1,52 +1,19 @@ -#include - -#include -#include - -/***************************************************************************** - - NAME */ -#include - -AROS_LH0(void, KrnSchedule, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 6, Kernel) - -/* FUNCTION - Run task scheduling sequence - - INPUTS - None - - RESULT - None - - NOTES - This entry point directly calls task scheduling routine - in supervisor mode. It neither performs any checks of caller status - nor obeys interrupt enable state. - - This function is safe to call only from within user mode. - This function is considered internal, and not meant to be called - by user's software. - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - /* The real implementation is in Exec/Schedule */ - Supervisor(__AROS_GETVECADDR(SysBase,7)); - - AROS_LIBFUNC_EXIT -} +#include + +#include +#include + +#include + +/* See rom/kernel/schedule.c for documentation */ + +AROS_LH0(void, KrnSchedule, + struct KernelBase *, KernelBase, 6, Kernel) +{ + AROS_LIBFUNC_INIT + + /* The real implementation is in Exec/Schedule */ + Supervisor(__AROS_GETVECADDR(SysBase,7)); + + AROS_LIBFUNC_EXIT +} diff --git a/arch/m68k-all/kernel/setprotection.c b/arch/m68k-all/kernel/setprotection.c index fb4af6f134..30c3f0c7b5 100644 --- a/arch/m68k-all/kernel/setprotection.c +++ b/arch/m68k-all/kernel/setprotection.c @@ -4,38 +4,15 @@ #include #include -/***************************************************************************** - - NAME */ #include -AROS_LH3(void, KrnSetProtection, - -/* SYNOPSIS */ - AROS_LHA(void *, address, A0), - AROS_LHA(uint32_t, length, D0), - AROS_LHA(KRN_MapAttr, flags, D1), - -/* LOCATION */ - struct KernelBase *, KernelBase, 21, Kernel) - -/* FUNCTION - - INPUTS - - RESULT +/* See rom/kernel/setprotection.c for documentation */ - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ +AROS_LH3(void, KrnSetProtection, + AROS_LHA(void *, address, A0), + AROS_LHA(uint32_t, length, D0), + AROS_LHA(KRN_MapAttr, flags, D1), + struct KernelBase *, KernelBase, 21, Kernel) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-all/kernel/switch.c b/arch/m68k-all/kernel/switch.c dissimilarity index 77% index e21e86600f..1c4d8b6695 100644 --- a/arch/m68k-all/kernel/switch.c +++ b/arch/m68k-all/kernel/switch.c @@ -1,54 +1,19 @@ -#include - -#include -#include - -/***************************************************************************** - - NAME */ -#include - -AROS_LH0(void, KrnSwitch, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 5, Kernel) - -/* FUNCTION - Save context of caller's task and dispatch the next available task - - INPUTS - None - - RESULT - None - - NOTES - This entry point directly calls task switch routine - in supervisor mode. It neither performs any checks of caller status - nor obeys interrupt enable state. After calling this function, caller's - task will be replaced by another one, and it's caller's responsibility - to do anything to prevent task loss. - - This function is safe to call only from within user mode. - This function is considered internal, and not meant to be called - by user's software. - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - /* The real implementation is in Exec/Switch */ - Supervisor(__AROS_GETVECADDR(SysBase,9)); - - AROS_LIBFUNC_EXIT -} +#include + +#include +#include + +#include + +/* See rom/kernel/switch.c for documentation */ + +AROS_LH0(void, KrnSwitch, + struct KernelBase *, KernelBase, 5, Kernel) +{ + AROS_LIBFUNC_INIT + + /* The real implementation is in Exec/Switch */ + Supervisor(__AROS_GETVECADDR(SysBase,9)); + + AROS_LIBFUNC_EXIT +} diff --git a/arch/m68k-all/processor/getcpuinfo.c b/arch/m68k-all/processor/getcpuinfo.c index 4605f8546e..d7490ae437 100644 --- a/arch/m68k-all/processor/getcpuinfo.c +++ b/arch/m68k-all/processor/getcpuinfo.c @@ -1,5 +1,5 @@ /* - Copyright © 2011, The AROS Development Team. All rights reserved. + Copyright © 2011-2013, The AROS Development Team. All rights reserved. $Id$ Desc: GetCPUInfo() - Provides information about installed CPUs @@ -16,38 +16,13 @@ #include "processor_intern.h" #include "processor_arch_intern.h" -/***************************************************************************** - - NAME */ #include - AROS_LH1(void, GetCPUInfo, - -/* SYNOPSIS */ - AROS_LHA(struct TagItem *, tagList, A0), - -/* LOCATION */ - struct ProcessorBase *, ProcessorBase, 1, Processor) - -/* FUNCTION - - INPUTS - - TAGS - - RESULT - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS +/* See rom/processor/getcpuinfo.c for documentation */ -******************************************************************************/ +AROS_LH1(void, GetCPUInfo, + AROS_LHA(struct TagItem *, tagList, A0), + struct ProcessorBase *, ProcessorBase, 1, Processor) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-amiga/battclock/readbattclock.c b/arch/m68k-amiga/battclock/readbattclock.c index 437420d750..caadbf2811 100644 --- a/arch/m68k-amiga/battclock/readbattclock.c +++ b/arch/m68k-amiga/battclock/readbattclock.c @@ -15,46 +15,12 @@ #include "battclock_intern.h" -/***************************************************************************** - - NAME */ #include - AROS_LH0(ULONG, ReadBattClock, - -/* SYNOPSIS */ - /* void */ - -/* LOCATION */ - struct BattClockBase*, BattClockBase, 2, Battclock) - -/* FUNCTION - Return the value stored in the battery back up clock. This value - is the number of seconds that have elapsed since midnight on the - 1st of January 1978 (00:00:00 1.1.1978). - - If the value of the battery clock is invalid, then the clock will - be reset. - - INPUTS - - RESULT - The number of seconds since 1.1.1978 00:00:00 - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - WriteBattClock(), ResetBattClock() - - INTERNALS - - HISTORY +/* See rom/battclock/readbattclock.c for documentation */ -*****************************************************************************/ +AROS_LH0(ULONG, ReadBattClock, + struct BattClockBase*, BattClockBase, 2, Battclock) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-amiga/battclock/resetbattclock.c b/arch/m68k-amiga/battclock/resetbattclock.c dissimilarity index 75% index b5fd3969bd..14fce11c44 100644 --- a/arch/m68k-amiga/battclock/resetbattclock.c +++ b/arch/m68k-amiga/battclock/resetbattclock.c @@ -1,53 +1,22 @@ -/* - Copyright © 1995-2010, The AROS Development Team. All rights reserved. - - Desc: ResetBattClock() - Lang: english -*/ -#include "battclock_intern.h" - -/***************************************************************************** - - NAME */ -#include - - AROS_LH0(void, ResetBattClock, - -/* SYNOPSIS */ - /* void */ - -/* LOCATION */ - struct BattClockBase*, BattClockBase, 1, Battclock) - -/* FUNCTION - Reset the system battery-backed-up clock. This will reset the clock - back to 0 seconds (or midnight, 1st Jan 1978). - - INPUTS - None. - - RESULT - The clock will be reset. - - NOTES - This function may do nothing when the battery backed up clock either - doesn't exist, or may not be writable by the operating system. - - EXAMPLE - - BUGS - - SEE ALSO - ReadBattClock(), WriteBattClock() - - INTERNALS - -*****************************************************************************/ -{ - AROS_LIBFUNC_INIT - - resetbattclock(BattClockBase); - WriteBattClock(0); - - AROS_LIBFUNC_EXIT -} /* ResetBattClock */ +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + + Desc: ResetBattClock() + Lang: english +*/ +#include "battclock_intern.h" + +#include + +/* See rom/battclock/resetbattclock.c for documentation */ + +AROS_LH0(void, ResetBattClock, + struct BattClockBase*, BattClockBase, 1, Battclock) +{ + AROS_LIBFUNC_INIT + + resetbattclock(BattClockBase); + WriteBattClock(0); + + AROS_LIBFUNC_EXIT +} /* ResetBattClock */ diff --git a/arch/m68k-amiga/battclock/writebattclock.c b/arch/m68k-amiga/battclock/writebattclock.c index ee919dbf36..b3a519f37f 100644 --- a/arch/m68k-amiga/battclock/writebattclock.c +++ b/arch/m68k-amiga/battclock/writebattclock.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2010, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. Desc: WriteBattClock() Lang: english @@ -9,43 +9,13 @@ #include #include -/***************************************************************************** - - NAME */ #include - AROS_LH1(void, WriteBattClock, - -/* SYNOPSIS */ - AROS_LHA(ULONG, time, D0), - -/* LOCATION */ - struct BattClockBase*, BattClockBase, 3, Battclock) - -/* FUNCTION - Set the system's battery backed up clock to the time specified. The - value should be the number of seconds since 00:00:00 on 1.1.1978. - - INPUTS - time - The number of seconds elapsed since 00:00:00 1.1.1978 - - RESULT - The clock will be set. - - NOTES - This may not do anything on some systems where the battery backed - up clock either doesn't exist, or may not be writable. - - EXAMPLE - - BUGS - - SEE ALSO - ReadBattClock(), ResetBattClock() - - INTERNALS +/* See rom/battclock/writebattclock.c for documentation */ -*****************************************************************************/ +AROS_LH1(void, WriteBattClock, + AROS_LHA(ULONG, time, D0), + struct BattClockBase*, BattClockBase, 3, Battclock) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-amiga/exec/coldreboot.c b/arch/m68k-amiga/exec/coldreboot.c index 1c0fcfb293..4145471141 100644 --- a/arch/m68k-amiga/exec/coldreboot.c +++ b/arch/m68k-amiga/exec/coldreboot.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2012, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: ColdReboot() - Reboot the computer. @@ -27,37 +27,12 @@ asm ( ); -/***************************************************************************** - - NAME */ #include - AROS_LH0(void, ColdReboot, - -/* LOCATION */ - struct ExecBase *, SysBase, 121, Exec) - -/* FUNCTION - This function will reboot the computer. - - INPUTS - None. - - RESULT - This function does not return. - - NOTES - It can be quite harmful to call this function. It may be possible that - you will lose data from other tasks not having saved, or disk buffers - not being flushed. Plus you could annoy the (other) users. - - EXAMPLE - - BUGS - - SEE ALSO +/* See rom/exec/coldreboot.c for documentation */ -******************************************************************************/ +AROS_LH0(void, ColdReboot, + struct ExecBase *, SysBase, 121, Exec) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-amiga/exec/shutdowna.c b/arch/m68k-amiga/exec/shutdowna.c index 2df01bc69c..ec08a772e8 100644 --- a/arch/m68k-amiga/exec/shutdowna.c +++ b/arch/m68k-amiga/exec/shutdowna.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2009, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: ShutdownA() - Shut down the operating system. @@ -11,43 +11,11 @@ #include "exec_util.h" -/***************************************************************************** +/* See rom/exec/shutdowna.c for documentation */ - NAME */ - - AROS_LH1(ULONG, ShutdownA, - -/* SYNOPSIS */ - AROS_LHA(ULONG, action, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 173, Exec) - -/* FUNCTION - This function will shut down the operating system. - - INPUTS - action - what to do: - * SD_ACTION_POWEROFF - power off the machine. - * SD_ACTION_COLDREBOOT - cold reboot the machine (not only AROS). - - RESULT - This function does not return in case of success. Otherwise is returns - zero. - - NOTES - It can be quite harmful to call this function. It may be possible that - you will lose data from other tasks not having saved, or disk buffers - not being flushed. Plus you could annoy the (other) users. - - EXAMPLE - - BUGS - - SEE ALSO - ColdReboot() - -******************************************************************************/ +AROS_LH1(ULONG, ShutdownA, + AROS_LHA(ULONG, action, D0), + struct ExecBase *, SysBase, 173, Exec) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-amiga/expansion/configboard.c b/arch/m68k-amiga/expansion/configboard.c index 7525e2c997..4fb95c1291 100644 --- a/arch/m68k-amiga/expansion/configboard.c +++ b/arch/m68k-amiga/expansion/configboard.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2007, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: @@ -12,6 +12,8 @@ #include #include +/* See rom/expansion/configboard.c for documentation */ + #define Z3SLOT 0x01000000 /* do not touch. Ugly hack. UAE direct JIT versions need this */ @@ -34,41 +36,13 @@ AROS_UFH5(void, writeexpansion, AROS_USERFUNC_EXIT } -/***************************************************************************** - NAME */ #include - AROS_LH2(BOOL, ConfigBoard, - -/* SYNOPSIS */ - AROS_LHA(APTR , board, A0), - AROS_LHA(struct ConfigDev *, configDev, A1), - -/* LOCATION */ - struct ExpansionBase *, ExpansionBase, 10, Expansion) - -/* FUNCTION - - INPUTS - - RESULT - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - - HISTORY - 27-11-96 digulla automatically created from - expansion_lib.fd and clib/expansion_protos.h - -*****************************************************************************/ +AROS_LH2(BOOL, ConfigBoard, + AROS_LHA(APTR , board, A0), + AROS_LHA(struct ConfigDev *, configDev, A1), + struct ExpansionBase *, ExpansionBase, 10, Expansion) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-amiga/expansion/readexpansionbyte.c b/arch/m68k-amiga/expansion/readexpansionbyte.c index 927ac62cef..14cbc2cec4 100644 --- a/arch/m68k-amiga/expansion/readexpansionbyte.c +++ b/arch/m68k-amiga/expansion/readexpansionbyte.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2007, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: @@ -7,41 +7,14 @@ */ #include "expansion_intern.h" -/***************************************************************************** - - NAME */ #include - AROS_LH2(UBYTE, ReadExpansionByte, - -/* SYNOPSIS */ - AROS_LHA(APTR , board, A0), - AROS_LHA(ULONG, offset, D0), - -/* LOCATION */ - struct ExpansionBase *, ExpansionBase, 16, Expansion) - -/* FUNCTION - - INPUTS - - RESULT - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - - HISTORY - 27-11-96 digulla automatically created from - expansion_lib.fd and clib/expansion_protos.h +/* See rom/expansion/readexpansionbyte.c for documentation */ -*****************************************************************************/ +AROS_LH2(UBYTE, ReadExpansionByte, + AROS_LHA(APTR , board, A0), + AROS_LHA(ULONG, offset, D0), + struct ExpansionBase *, ExpansionBase, 16, Expansion) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-amiga/expansion/readexpansionrom.c b/arch/m68k-amiga/expansion/readexpansionrom.c index 0f29dd6a4f..fc7252ff77 100644 --- a/arch/m68k-amiga/expansion/readexpansionrom.c +++ b/arch/m68k-amiga/expansion/readexpansionrom.c @@ -14,6 +14,8 @@ #include +/* See rom/expansion/readexpansionrom.c for documentation */ + static void readexprom(APTR board, struct ExpansionRom *rom, struct ExpansionBase *ExpansionBase) { WORD cnt; @@ -25,41 +27,12 @@ static void readexprom(APTR board, struct ExpansionRom *rom, struct ExpansionBas rom->er_Type = ~rom->er_Type; } -/***************************************************************************** - - NAME */ #include - AROS_LH2(BOOL, ReadExpansionRom, - -/* SYNOPSIS */ - AROS_LHA(APTR , board, A0), - AROS_LHA(struct ConfigDev *, configDev, A1), - -/* LOCATION */ - struct ExpansionBase *, ExpansionBase, 17, Expansion) - -/* FUNCTION - - INPUTS - - RESULT - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - - HISTORY - 27-11-96 digulla automatically created from - expansion_lib.fd and clib/expansion_protos.h - -*****************************************************************************/ +AROS_LH2(BOOL, ReadExpansionRom, + AROS_LHA(APTR , board, A0), + AROS_LHA(struct ConfigDev *, configDev, A1), + struct ExpansionBase *, ExpansionBase, 17, Expansion) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-amiga/expansion/writeexpansionbyte.c b/arch/m68k-amiga/expansion/writeexpansionbyte.c dissimilarity index 62% index 9a1180443c..d0e4225402 100644 --- a/arch/m68k-amiga/expansion/writeexpansionbyte.c +++ b/arch/m68k-amiga/expansion/writeexpansionbyte.c @@ -1,61 +1,34 @@ -/* - Copyright © 1995-2007, The AROS Development Team. All rights reserved. - $Id$ - - Desc: - Lang: english -*/ -#include "expansion_intern.h" - -/***************************************************************************** - - NAME */ -#include - - AROS_LH3(void, WriteExpansionByte, - -/* SYNOPSIS */ - AROS_LHA(APTR , board, A0), - AROS_LHA(ULONG, offset, D0), - AROS_LHA(ULONG, byte, D1), - -/* LOCATION */ - struct ExpansionBase *, ExpansionBase, 19, Expansion) - -/* FUNCTION - - INPUTS - - RESULT - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - - HISTORY - 27-11-96 digulla automatically created from - expansion_lib.fd and clib/expansion_protos.h - -*****************************************************************************/ -{ - AROS_LIBFUNC_INIT - - UWORD loffset; - volatile UBYTE *p = (UBYTE*)board; - - offset *= 4; - if (((ULONG)board) & 0xff000000) - loffset = 0x100; - else - loffset = 0x002; - p[offset + loffset] = byte << 4; - p[offset] = byte; - - AROS_LIBFUNC_EXIT -} /* WriteExpansionByte */ +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: + Lang: english +*/ +#include "expansion_intern.h" + +#include + +/* See rom/expansion/writeexpansionbyte.c for documentation */ + +AROS_LH3(void, WriteExpansionByte, + AROS_LHA(APTR , board, A0), + AROS_LHA(ULONG, offset, D0), + AROS_LHA(ULONG, byte, D1), + struct ExpansionBase *, ExpansionBase, 19, Expansion) +{ + AROS_LIBFUNC_INIT + + UWORD loffset; + volatile UBYTE *p = (UBYTE*)board; + + offset *= 4; + if (((ULONG)board) & 0xff000000) + loffset = 0x100; + else + loffset = 0x002; + p[offset + loffset] = byte << 4; + p[offset] = byte; + + AROS_LIBFUNC_EXIT +} /* WriteExpansionByte */ diff --git a/arch/m68k-amiga/graphics/setchiprev.c b/arch/m68k-amiga/graphics/setchiprev.c index e54c753e3e..c8e1110437 100644 --- a/arch/m68k-amiga/graphics/setchiprev.c +++ b/arch/m68k-amiga/graphics/setchiprev.c @@ -9,41 +9,13 @@ #include #include -/***************************************************************************** - - NAME */ #include - AROS_LH1(ULONG, SetChipRev, - -/* SYNOPSIS */ - AROS_LHA(ULONG, ChipRev, D0), - -/* LOCATION */ - struct GfxBase *, GfxBase, 148, Graphics) - -/* FUNCTION - - INPUTS - ChipRev - Chip Rev that you would like to be enabled - - RESULT - chiprevbits - Actual bits set in GfxBase->ChipRevBits0 - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - - HISTORY - +/* See rom/graphics/setchiprev.c for documentation */ -******************************************************************************/ +AROS_LH1(ULONG, SetChipRev, + AROS_LHA(ULONG, ChipRev, D0), + struct GfxBase *, GfxBase, 148, Graphics) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-amiga/graphics/vbeampos.c b/arch/m68k-amiga/graphics/vbeampos.c index 6ffc881223..29cc3b185c 100644 --- a/arch/m68k-amiga/graphics/vbeampos.c +++ b/arch/m68k-amiga/graphics/vbeampos.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2007, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: Read the current vertical position of the beam @@ -8,40 +8,12 @@ #include #include "graphics_intern.h" -/***************************************************************************** +#include - NAME */ - #include +/* See rom/graphics/vbeampos.c for documentation */ - AROS_LH0(LONG, VBeamPos, - -/* SYNOPSIS */ - /* void */ - -/* LOCATION */ - struct GfxBase *, GfxBase, 64, Graphics) - -/* FUNCTION - - INPUTS - none - - RESULT - None. - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - - HISTORY - -*****************************************************************************/ +AROS_LH0(LONG, VBeamPos, + struct GfxBase *, GfxBase, 64, Graphics) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-amiga/kernel/cause.c b/arch/m68k-amiga/kernel/cause.c dissimilarity index 70% index 188095ea78..c57130e714 100644 --- a/arch/m68k-amiga/kernel/cause.c +++ b/arch/m68k-amiga/kernel/cause.c @@ -1,54 +1,21 @@ -#include - -#include -#include - -/***************************************************************************** - - NAME */ -#include - -AROS_LH0I(void, KrnCause, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 3, Kernel) - -/* FUNCTION - Run software interrupt processing sequence - - INPUTS - None - - RESULT - None - - NOTES - This entry point directly calls interrupt processing routine - in supervisor mode. It neither performs any checks of caller status - nor obeys interrupt enable state. - - This function is safe to call only from within user mode. - This function is considered internal, and not meant to be called - by user's software. - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - /* Stub function - this is not needed, since the caller - * (exec/Cause) does not call KrnCause() on the amiga-m68k - * platform - */ - - AROS_LIBFUNC_EXIT -} +#include + +#include +#include + +#include + +/* See rom/kernel/cause.c for documentation */ + +AROS_LH0I(void, KrnCause, + struct KernelBase *, KernelBase, 3, Kernel) +{ + AROS_LIBFUNC_INIT + + /* Stub function - this is not needed, since the caller + * (exec/Cause) does not call KrnCause() on the amiga-m68k + * platform + */ + + AROS_LIBFUNC_EXIT +} diff --git a/arch/m68k-amiga/kernel/cli.c b/arch/m68k-amiga/kernel/cli.c dissimilarity index 72% index 3a897f4b49..e5b3562a7d 100644 --- a/arch/m68k-amiga/kernel/cli.c +++ b/arch/m68k-amiga/kernel/cli.c @@ -1,48 +1,18 @@ -#include -#include - -#include - -/***************************************************************************** - - NAME */ -#include - -AROS_LH0I(void, KrnCli, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 9, Kernel) - -/* FUNCTION - Instantly disable interrupts. - - INPUTS - None - - RESULT - None - - NOTES - This is low level function, it does not have nesting count - and state tracking mechanism. It operates directly on the CPU. - Normal applications should consider using exec.library/Disable(). - - EXAMPLE - - BUGS - - SEE ALSO - KrnSti() - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - asm volatile ("move.w #0x4000,0xdff09a\n"); - - AROS_LIBFUNC_EXIT -} +#include +#include + +#include + +#include + +/* See rom/kernel/cli.c for documentation */ + +AROS_LH0I(void, KrnCli, + struct KernelBase *, KernelBase, 9, Kernel) +{ + AROS_LIBFUNC_INIT + + asm volatile ("move.w #0x4000,0xdff09a\n"); + + AROS_LIBFUNC_EXIT +} diff --git a/arch/m68k-amiga/kernel/dispatch.c b/arch/m68k-amiga/kernel/dispatch.c dissimilarity index 80% index 188a2dbf97..79d4d94c09 100644 --- a/arch/m68k-amiga/kernel/dispatch.c +++ b/arch/m68k-amiga/kernel/dispatch.c @@ -1,52 +1,18 @@ -#include - -#include -#include - -/***************************************************************************** - - NAME */ -#include - -AROS_LH0(void, KrnDispatch, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 4, Kernel) - -/* FUNCTION - Run the next available task - - INPUTS - None - - RESULT - None - - NOTES - This entry point directly calls task dispatch routine in supervisor mode. - It neither performs any checks of caller status nor obeys interrupt enable - state. After calling this function, caller's task will be replaced by - another one, and caller's state will be lost. - - This function is safe to call only from within user mode. - This function is considered internal, and not meant to be called - by user's software. - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - Supervisor(Dispatch_wapper); - - AROS_LIBFUNC_EXIT -} +#include + +#include +#include + +#include + +/* See rom/kernel/dispatch.c for documentation */ + +AROS_LH0(void, KrnDispatch, + struct KernelBase *, KernelBase, 4, Kernel) +{ + AROS_LIBFUNC_INIT + + Supervisor(Dispatch_wapper); + + AROS_LIBFUNC_EXIT +} diff --git a/arch/m68k-amiga/kernel/getbootinfo.c b/arch/m68k-amiga/kernel/getbootinfo.c index 82d8441a32..c7d793eb22 100644 --- a/arch/m68k-amiga/kernel/getbootinfo.c +++ b/arch/m68k-amiga/kernel/getbootinfo.c @@ -9,35 +9,12 @@ #include "exec_intern.h" #undef KernelBase -/***************************************************************************** - - NAME */ #include -AROS_LH0I(struct TagItem *, KrnGetBootInfo, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 11, Kernel) - -/* FUNCTION - - INPUTS - - RESULT +/* See rom/kernel/getbootinfo.c for documentation */ - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ +AROS_LH0I(struct TagItem *, KrnGetBootInfo, + struct KernelBase *, KernelBase, 11, Kernel) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-amiga/kernel/maygetchar.c b/arch/m68k-amiga/kernel/maygetchar.c dissimilarity index 65% index e25d443ed0..31e097d853 100644 --- a/arch/m68k-amiga/kernel/maygetchar.c +++ b/arch/m68k-amiga/kernel/maygetchar.c @@ -1,50 +1,21 @@ -#include - -#include -#include - -/***************************************************************************** - - NAME */ -#include - -AROS_LH0(int, KrnMayGetChar, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 26, Kernel) - -/* FUNCTION - Read a single character from low-level debug input stream - - INPUTS - None - - RESULT - An ASCII code of the character or -1 if there's no character - available - - NOTES - This function never waits. If there is no character available on - the stream it just returns with -1 - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - extern int DebugMayGetChar(void); - - /* The implementation is entirely architecture-specific */ - return DebugMayGetChar(); - - AROS_LIBFUNC_EXIT -} +#include + +#include +#include + +#include + +/* See rom/kernel/maygetchar.c for documentation */ + +AROS_LH0(int, KrnMayGetChar, + struct KernelBase *, KernelBase, 26, Kernel) +{ + AROS_LIBFUNC_INIT + + extern int DebugMayGetChar(void); + + /* The implementation is entirely architecture-specific */ + return DebugMayGetChar(); + + AROS_LIBFUNC_EXIT +} diff --git a/arch/m68k-amiga/kernel/obtaininput.c b/arch/m68k-amiga/kernel/obtaininput.c dissimilarity index 64% index 91c81204ef..da47fd8a8a 100644 --- a/arch/m68k-amiga/kernel/obtaininput.c +++ b/arch/m68k-amiga/kernel/obtaininput.c @@ -1,44 +1,18 @@ -#include -#include - -#include - -/***************************************************************************** - - NAME */ -#include - -AROS_LH0I(int, KrnObtainInput, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 33, Kernel) - -/* FUNCTION - Take over low-level debug input hardware and initialize the input - - INPUTS - None - - RESULT - Nonzero for success, zero for failure (for example there's no input channel) - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - return TRUE; - - AROS_LIBFUNC_EXIT -} +#include +#include + +#include + +#include + +/* See rom/kernel/obtaininput.c for documentation */ + +AROS_LH0I(int, KrnObtainInput, + struct KernelBase *, KernelBase, 33, Kernel) +{ + AROS_LIBFUNC_INIT + + return TRUE; + + AROS_LIBFUNC_EXIT +} diff --git a/arch/m68k-amiga/kernel/releaseinput.c b/arch/m68k-amiga/kernel/releaseinput.c dissimilarity index 67% index 2f3a815d40..75ebe33ec8 100644 --- a/arch/m68k-amiga/kernel/releaseinput.c +++ b/arch/m68k-amiga/kernel/releaseinput.c @@ -1,44 +1,18 @@ -#include -#include - -#include - -/***************************************************************************** - - NAME */ -#include - -AROS_LH0I(void, KrnReleaseInput, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 34, Kernel) - -/* FUNCTION - Release low-level debug input hardware and hand it back to the operating system - - INPUTS - None - - RESULT - None - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - /* Nothing to do */ - - AROS_LIBFUNC_EXIT -} +#include +#include + +#include + +#include + +/* See rom/kernel/releaseinput.c for documentation */ + +AROS_LH0I(void, KrnReleaseInput, + struct KernelBase *, KernelBase, 34, Kernel) +{ + AROS_LIBFUNC_INIT + + /* Nothing to do */ + + AROS_LIBFUNC_EXIT +} diff --git a/arch/m68k-amiga/kernel/sti.c b/arch/m68k-amiga/kernel/sti.c dissimilarity index 72% index 0b8128dd0c..fd8ce20ba2 100644 --- a/arch/m68k-amiga/kernel/sti.c +++ b/arch/m68k-amiga/kernel/sti.c @@ -1,48 +1,18 @@ -#include -#include - -#include - -/***************************************************************************** - - NAME */ -#include - -AROS_LH0I(void, KrnSti, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 10, Kernel) - -/* FUNCTION - Instantly enable interrupts. - - INPUTS - None - - RESULT - None - - NOTES - This is low level function, it does not have nesting count - and state tracking mechanism. It operates directly on the CPU. - Normal applications should consider using exec.library/Enable(). - - EXAMPLE - - BUGS - - SEE ALSO - KrnCli() - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - asm volatile ("move.w #0xc000,0xdff09a\n"); - - AROS_LIBFUNC_EXIT -} +#include +#include + +#include + +#include + +/* See rom/kernel/sti.c for documentation */ + +AROS_LH0I(void, KrnSti, + struct KernelBase *, KernelBase, 10, Kernel) +{ + AROS_LIBFUNC_INIT + + asm volatile ("move.w #0xc000,0xdff09a\n"); + + AROS_LIBFUNC_EXIT +} diff --git a/arch/m68k-amiga/lowlevel/readjoyport.c b/arch/m68k-amiga/lowlevel/readjoyport.c index 3a34bb7465..e6606390d4 100644 --- a/arch/m68k-amiga/lowlevel/readjoyport.c +++ b/arch/m68k-amiga/lowlevel/readjoyport.c @@ -21,6 +21,8 @@ #include "lowlevel_intern.h" +/* See rom/lowlevel/readjoyport.c for documentation */ + #define POTGO_GAMEPAD_PORT0 \ (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) #define POTGO_GAMEPAD_PORT1 \ @@ -198,29 +200,10 @@ static VOID llPortClose(struct LowLevelBase *LowLevelBase, int port, UWORD potbi } } -/***************************************************************************** - - NAME */ - - AROS_LH1(ULONG, ReadJoyPort, - -/* SYNOPSIS */ - AROS_LHA(ULONG, port, D0), - -/* LOCATION */ - struct LowLevelBase *, LowLevelBase, 5, LowLevel) - -/* FUNCTION - - INPUTS - - RESULT - - BUGS - - INTERNALS -*****************************************************************************/ +AROS_LH1(ULONG, ReadJoyPort, + AROS_LHA(ULONG, port, D0), + struct LowLevelBase *, LowLevelBase, 5, LowLevel) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-amiga/lowlevel/setjoyportattrsa.c b/arch/m68k-amiga/lowlevel/setjoyportattrsa.c index 502b8e1deb..8e2216b817 100644 --- a/arch/m68k-amiga/lowlevel/setjoyportattrsa.c +++ b/arch/m68k-amiga/lowlevel/setjoyportattrsa.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2007, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: @@ -10,32 +10,12 @@ #include -/***************************************************************************** +/* See rom/lowlevel/setjoyportattrsa.c for documentation */ - NAME */ - - AROS_LH2(BOOL, SetJoyPortAttrsA, - -/* SYNOPSIS */ - AROS_LHA(ULONG, portNumber, D0), - AROS_LHA(struct TagItem *, tagList, A1), - -/* LOCATION */ - struct LowLevelBase *, LowLevelBase, 22, LowLevel) - -/* FUNCTION - - INPUTS - - RESULT - - BUGS - - SEE ALSO - - INTERNALS - -*****************************************************************************/ +AROS_LH2(BOOL, SetJoyPortAttrsA, + AROS_LHA(ULONG, portNumber, D0), + AROS_LHA(struct TagItem *, tagList, A1), + struct LowLevelBase *, LowLevelBase, 22, LowLevel) { AROS_LIBFUNC_INIT struct TagItem *ti; diff --git a/arch/m68k-amiga/timer/abortio.c b/arch/m68k-amiga/timer/abortio.c index 39df262a57..05a0abf241 100644 --- a/arch/m68k-amiga/timer/abortio.c +++ b/arch/m68k-amiga/timer/abortio.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2007, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: AbortIO() - abort a running timer request. @@ -9,52 +9,15 @@ #include #include -/*****i*********************************************************************** - - NAME */ #include #include #include - AROS_LH1(LONG, AbortIO, - -/* SYNOPSIS */ - AROS_LHA(struct timerequest *, timereq, A1), - -/* LOCATION */ - struct TimerBase *, TimerBase, 6,Timer) - -/* FUNCTION - Abort a running timer.device request. - - INPUTS - timereq - The request you wish to abort. - - RESULT - 0 if the request was aborted, io_Error will also be set - to the value IOERR_ABORTED. - - -1 otherwise (most likely that the request isn't working). - - If the request is successfully aborted, you should WaitIO() on - the message before you try and reuse it. - - NOTES - This function may be called from interrupts. - - EXAMPLE - - BUGS - - SEE ALSO - exec/AbortIO(), exec/WaitIO() - - INTERNALS - - HISTORY - 18-02-1997 iaint Implemented. +/* See rom/timer/abortio.c for documentation */ -******************************************************************************/ +AROS_LH1(LONG, AbortIO, + AROS_LHA(struct timerequest *, timereq, A1), + struct TimerBase *, TimerBase, 6,Timer) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-amiga/timer/getsystime.c b/arch/m68k-amiga/timer/getsystime.c index a11245590d..f14227b406 100644 --- a/arch/m68k-amiga/timer/getsystime.c +++ b/arch/m68k-amiga/timer/getsystime.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2007, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: GetSysTime() - Find out what time it is. @@ -12,46 +12,14 @@ #include -/***************************************************************************** - - NAME */ #include #include - AROS_LH1(void, GetSysTime, - -/* SYNOPSIS */ - AROS_LHA(struct timeval *, dest, A0), - -/* LOCATION */ - struct Device *, TimerBase, 11, Timer) - -/* FUNCTION - GetSysTime() will fill in the supplied timeval with the current - system time. - - INPUTS - dest - A pointer to the timeval you want the time stored in. - - RESULT - The timeval "dest" will be filled with the current system time. - - NOTES - This function is safe to call from interrupts. - - EXAMPLE - - BUGS - - SEE ALSO - TR_GETSYSTIME, TR_SETSYSTIME - - INTERNALS - - HISTORY - 18-02-1997 iaint Implemented. +/* See rom/timer/getsystime.c for documentation */ -*****************************************************************************/ +AROS_LH1(void, GetSysTime, + AROS_LHA(struct timeval *, dest, A0), + struct Device *, TimerBase, 11, Timer) { AROS_LIBFUNC_INIT diff --git a/arch/m68k-amiga/timer/readeclock.c b/arch/m68k-amiga/timer/readeclock.c dissimilarity index 60% index 2c23a4c323..94c26bb443 100644 --- a/arch/m68k-amiga/timer/readeclock.c +++ b/arch/m68k-amiga/timer/readeclock.c @@ -1,71 +1,37 @@ -/* - Copyright © 1995-2007, The AROS Development Team. All rights reserved. - $Id$ - - Desc: ReadEClock() - read the base frequency of timers. - Lang: english -*/ - -/***************************************************************************** - - NAME */ -#include -#include -#include - -#include - - AROS_LH1(ULONG, ReadEClock, - -/* SYNOPSIS */ - AROS_LHA(struct EClockVal *, dest, A0), - -/* LOCATION */ - struct TimerBase *, TimerBase, 10, Timer) - -/* FUNCTION - ReadEClock() reads current value of E-Clock and stores - it in the destination EClockVal structure passed as - argument. It also returns the frequency of EClock of the - system. - - This call is supposed to be very fast. - INPUTS - dest - Destination EClockVal - - RESULT - The EClock frequency (tics/s) - - NOTES - This function is safe to call from interrupts. - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - - HISTORY - 19-08-2005 schulz Implemented. - -*****************************************************************************/ -{ - AROS_LIBFUNC_INIT - - ULONG eclock, old; - - Disable(); - old = dest->ev_lo = TimerBase->tb_eclock.ev_lo; - dest->ev_hi = TimerBase->tb_eclock.ev_hi; - eclock = GetEClock(TimerBase); - Enable(); - dest->ev_lo += eclock; - if (old > dest->ev_lo) - dest->ev_hi++; - return TimerBase->tb_eclock_rate; - - AROS_LIBFUNC_EXIT -} /* CmpTime */ - +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: ReadEClock() - read the base frequency of timers. + Lang: english +*/ + +#include +#include +#include + +#include + +/* See rom/timer/readeclock.c for documentation */ + +AROS_LH1(ULONG, ReadEClock, + AROS_LHA(struct EClockVal *, dest, A0), + struct TimerBase *, TimerBase, 10, Timer) +{ + AROS_LIBFUNC_INIT + + ULONG eclock, old; + + Disable(); + old = dest->ev_lo = TimerBase->tb_eclock.ev_lo; + dest->ev_hi = TimerBase->tb_eclock.ev_hi; + eclock = GetEClock(TimerBase); + Enable(); + dest->ev_lo += eclock; + if (old > dest->ev_lo) + dest->ev_hi++; + return TimerBase->tb_eclock_rate; + + AROS_LIBFUNC_EXIT +} /* CmpTime */ + diff --git a/arch/m68k-mac/exec/cache.c b/arch/m68k-mac/exec/cache.c index 1358a89723..483f318f73 100644 --- a/arch/m68k-mac/exec/cache.c +++ b/arch/m68k-mac/exec/cache.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2001, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: Flush Caches @@ -14,43 +14,18 @@ static inline _syscall4(int,cacheflush,unsigned long,addr,int,scope,int,cache,unsigned long,len) #endif -/****************************************************************************** - - NAME */ #include #include - AROS_LH3(void, CacheClearE, - -/* SYNOPSIS */ - AROS_LHA(APTR, address, A0), - AROS_LHA(ULONG, length, D0), - AROS_LHA(ULONG, caches, D1), - -/* LOCATION */ - struct ExecBase *, SysBase, 107, Exec) - -/* FUNCTION - - INPUTS - - RESULT - - NOTES +/* See rom/exec/cacheclear*.c for documentation */ - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - - HISTORY - -******************************************************************************/ +AROS_LH3(void, CacheClearE, + AROS_LHA(APTR, address, A0), + AROS_LHA(ULONG, length, D0), + AROS_LHA(ULONG, caches, D1), + struct ExecBase *, SysBase, 107, Exec) { - AROS_LIBFUNC_INIT + AROS_LIBFUNC_INIT #if 0 ULONG scope, cpucache = 0; @@ -70,35 +45,9 @@ AROS_LIBFUNC_EXIT } /* CacheClearE */ -/****************************************************************************** - - NAME */ -#include - - AROS_LH0(void, CacheClearU, - -/* LOCATION */ - struct ExecBase *, SysBase, 106, Exec) - -/* FUNCTION - - INPUTS - - RESULT - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - - HISTORY -******************************************************************************/ +AROS_LH0(void, CacheClearU, + struct ExecBase *, SysBase, 106, Exec) { AROS_LIBFUNC_INIT #if 0 diff --git a/arch/m68k-mac/exec/disable.c b/arch/m68k-mac/exec/disable.c dissimilarity index 76% index ac87bb7f41..b67fa213e6 100644 --- a/arch/m68k-mac/exec/disable.c +++ b/arch/m68k-mac/exec/disable.c @@ -1,88 +1,38 @@ -/* - Copyright © 1995-2001, The AROS Development Team. All rights reserved. - $Id$ - - Desc: Disable() - Stop interrupts from occurring. - Lang: english -*/ - -#include -#include -#include -#include - -/*****************************************************************************/ -#undef Exec -#ifdef UseExecstubs -# define Exec _Exec -#endif - -/* NAME */ -#include - - AROS_LH0(void, Disable, - -/* LOCATION */ - struct ExecBase *, SysBase, 20, Exec) - -/* FUNCTION - This function will prevent interrupts from occuring. You can - start the interrupts again with a call to Enable(). - - Note that calls to Disable() nest, and for every call to - Disable() you need a matching call to Enable(). - - ***** WARNING ***** - - Using this function is considered very harmful, and it is - not recommended to use this function for ** ANY ** reason. - - It is quite possible to either crash the system, or to prevent - normal activities (disk/port i/o) from occuring. - - Note: As taskswitching is driven by the interrupts subsystem, - this function has the side effect of disabling - multitasking. - - INPUTS - - RESULT - Interrupts will be disabled AFTER this call returns. - - NOTES - This function preserves all registers. - - To prevent deadlocks calling Wait() in disabled state breaks - the disable - thus interrupts may happen again. - - EXAMPLE - No you DEFINITATELY don't want to use this function. - - BUGS - The only architecture that you can rely on the registers being - saved is on the Motorola mc68000 family. - - SEE ALSO - Forbid(), Permit(), Enable(), Wait() - - INTERNALS - This function must be replaced in the $(KERNEL) or $(ARCH) - directories in order to do some work. - - HISTORY - -******************************************************************************/ -{ -#undef Exec - - AROS_LIBFUNC_INIT - - /* - * Disable interrupts by masking all interrupts. - */ - SetSR(0x700,0x700); - - SysBase->IDNestCnt++; - - AROS_LIBFUNC_EXIT -} /* Disable() */ +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: Disable() - Stop interrupts from occurring. + Lang: english +*/ + +#include +#include +#include +#include + +#undef Exec +#ifdef UseExecstubs +# define Exec _Exec +#endif + +#include + +/* See rom/exec/disable.c for documentation */ + +AROS_LH0(void, Disable, + struct ExecBase *, SysBase, 20, Exec) +{ +#undef Exec + + AROS_LIBFUNC_INIT + + /* + * Disable interrupts by masking all interrupts. + */ + SetSR(0x700,0x700); + + SysBase->IDNestCnt++; + + AROS_LIBFUNC_EXIT +} /* Disable() */ diff --git a/arch/m68k-mac/exec/enable.c b/arch/m68k-mac/exec/enable.c dissimilarity index 74% index eaf7971cca..23ce071156 100644 --- a/arch/m68k-mac/exec/enable.c +++ b/arch/m68k-mac/exec/enable.c @@ -1,92 +1,41 @@ -/* - Copyright © 1995-2001, The AROS Development Team. All rights reserved. - $Id$ - - Desc: Enable() - Allow interrupts to occur after Disable(). - Lang: english -*/ - -#include -#include -#include -#include - -#define DEBUG 1 -#include - -/*****************************************************************************/ -#undef Exec -#ifdef UseExecstubs -# define Exec _Exec -#endif - -/* NAME */ -#include - - AROS_LH0(void, Enable, - -/* LOCATION */ - struct ExecBase *, SysBase, 21, Exec) - -/* FUNCTION - This function will allow interrupts to occur after they have - been disabled by Disable(). - - Note that calls to Disable() nest, and for every call to - Disable() you need a matching call to Enable(). - - ***** WARNING ***** - - Using this function is considered very harmful, and it is - not recommended to use this function for ** ANY ** reason. - - It is quite possible to either crash the system, or to prevent - normal activities (disk/port i/o) from occuring. - - Note: As taskswitching is driven by the interrupts subsystem, - this function has the side effect of disabling - multitasking. - - INPUTS - None. - - RESULT - Interrupts will be enabled again when this call returns. - - NOTES - This function preserves all registers. - - To prevent deadlocks calling Wait() in disabled state breaks - the disable - thus interrupts may happen again. - - EXAMPLE - No you DEFINITATELY don't want to use this function. - - BUGS - The only architecture that you can rely on the registers being - saved is on the Motorola mc68000 family. - - SEE ALSO - Forbid(), Permit(), Disable(), Wait() - - INTERNALS - This function must be replaced in the $(KERNEL) or $(ARCH) - directories in order to do some work. - - HISTORY - -******************************************************************************/ -{ -#undef Exec - - AROS_LIBFUNC_INIT - - if( --SysBase->IDNestCnt < 0) { - /* - * Enable interrupt by allowing all of them. - */ - SetSR(0,0x700); - } - - AROS_LIBFUNC_EXIT -} /* Enable() */ +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: Enable() - Allow interrupts to occur after Disable(). + Lang: english +*/ + +#include +#include +#include +#include + +#define DEBUG 1 +#include + +#undef Exec +#ifdef UseExecstubs +# define Exec _Exec +#endif + +#include + +/* See rom/exec/enable.c for documentation */ + +AROS_LH0(void, Enable, + struct ExecBase *, SysBase, 21, Exec) +{ +#undef Exec + + AROS_LIBFUNC_INIT + + if( --SysBase->IDNestCnt < 0) { + /* + * Enable interrupt by allowing all of them. + */ + SetSR(0,0x700); + } + + AROS_LIBFUNC_EXIT +} /* Enable() */ diff --git a/arch/m68k-mac/exec/rawputchar.c b/arch/m68k-mac/exec/rawputchar.c index eb2905bbb2..f3ebae6cc4 100644 --- a/arch/m68k-mac/exec/rawputchar.c +++ b/arch/m68k-mac/exec/rawputchar.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2007, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: Emit one character via raw IO @@ -14,43 +14,13 @@ void vputc(unsigned char chr); -/**************************************************************************** - - NAME */ #include - AROS_LH1(void, RawPutChar, - -/* SYNOPSIS */ - AROS_LHA(UBYTE, chr, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 86, Exec) - -/* FUNCTION - Emits a single character. - - INPUTS - chr - The character to emit - - RESULT - None. - - NOTES - This function is for very low level debugging only. - - EXAMPLE - - BUGS - - SEE ALSO - RawIOInit(), RawPutChar(), RawMayGetChar() - - INTERNALS - - HISTORY +/* See rom/exec/rawputchar.c for documentation */ -*****************************************************************************/ +AROS_LH1(void, RawPutChar, + AROS_LHA(UBYTE, chr, D0), + struct ExecBase *, SysBase, 86, Exec) { AROS_LIBFUNC_INIT #if 0 diff --git a/arch/ppc-all/exec/cachecleare.c b/arch/ppc-all/exec/cachecleare.c index 8f05d29abd..c126ceb576 100644 --- a/arch/ppc-all/exec/cachecleare.c +++ b/arch/ppc-all/exec/cachecleare.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2010, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: CacheClearE() - Clear the caches with extended control. @@ -13,66 +13,15 @@ #include "kernel_syscall.h" -/***************************************************************************** - - NAME */ #include - AROS_LH3(void, CacheClearE, - -/* SYNOPSIS */ - AROS_LHA(APTR, address, A0), - AROS_LHA(ULONG, length, D0), - AROS_LHA(ULONG, caches, D1), - -/* LOCATION */ - struct ExecBase *, SysBase, 107, Exec) - -/* FUNCTION - Flush the contents of the CPU instruction or data caches. If some - of the cache contains dirty data, push it to memory first. - - For most systems DMA will not effect processor caches. If *any* - external (non-processor) event changes system memory, you MUST - clear the cache. For example: - - DMA - Code relocation to run at a different address - Building jump tables - Loading code from disk - - INPUTS - address - Address to start the operation. This address may be - rounded DOWN due to hardware granularity. - length - Length of the memory to flush. This will be rounded - up, of $FFFFFFFF to indicate that all addresses - should be cleared. - caches - Bit flags to indicate which caches should be cleared - - CACRF_ClearI - Clear the instruction cache - CACRF_ClearD - Clear the data cache - - All other bits are reserved. - - RESULT - The caches will be flushed. - - NOTES - It is possible that on some systems the entire cache will be - even if this was not the specific request. - - EXAMPLE - - BUGS - - SEE ALSO - CacheClearU(), CacheControl() - - INTERNALS - This is a rather CPU dependant function. You should replace it - in your $(KERNEL). +/* See rom/exec/cachecleare.c for documentation */ -******************************************************************************/ +AROS_LH3(void, CacheClearE, + AROS_LHA(APTR, address, A0), + AROS_LHA(ULONG, length, D0), + AROS_LHA(ULONG, caches, D1), + struct ExecBase *, SysBase, 107, Exec) { AROS_LIBFUNC_INIT diff --git a/arch/ppc-all/exec/newstackswap.c b/arch/ppc-all/exec/newstackswap.c index d2b1106fe2..2fd698cdd2 100644 --- a/arch/ppc-all/exec/newstackswap.c +++ b/arch/ppc-all/exec/newstackswap.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2009, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: NewStackSwap() - Call a function with swapped stack. @@ -8,52 +8,17 @@ #define __AROS_GIMME_DEPRECATED_STACKSWAP__ -/***************************************************************************** - - NAME */ #include #include #include - AROS_LH3(IPTR, NewStackSwap, - -/* SYNOPSIS */ - AROS_LHA(struct StackSwapStruct *, sss, A0), - AROS_LHA(LONG_FUNC, entry, A1), - AROS_LHA(struct StackSwapArgs *, args, A2), - -/* LOCATION */ - struct ExecBase *, SysBase, 134, Exec) - -/* FUNCTION - Calls a function with a new stack. - - INPUTS - sss - A structure containing the values for the upper, lower - and current bounds of the stack you wish to use. - entry - Address of the function to call. - args - A structure (actually an array) containing up to 8 - function arguments. The function is called using C calling - convention (no AROS_UHFx macro needed). - - RESULT - A value actually returned by your function. The function will be - running on a new stack. - - NOTES - - EXAMPLE - - BUGS - Do not attempt to pass in a prebuilt stack - it will be erased. - - SEE ALSO - StackSwap() - - INTERNALS - This function MUST be replaced in $(KERNEL) or $(ARCH). +/* See rom/exec/newstackswap.c for documentation */ -******************************************************************************/ +AROS_LH3(IPTR, NewStackSwap, + AROS_LHA(struct StackSwapStruct *, sss, A0), + AROS_LHA(LONG_FUNC, entry, A1), + AROS_LHA(struct StackSwapArgs *, args, A2), + struct ExecBase *, SysBase, 134, Exec) { AROS_LIBFUNC_INIT diff --git a/arch/ppc-chrp/battclock/readbattclock.c b/arch/ppc-chrp/battclock/readbattclock.c index 673e410ce9..4fe64980fa 100644 --- a/arch/ppc-chrp/battclock/readbattclock.c +++ b/arch/ppc-chrp/battclock/readbattclock.c @@ -1,5 +1,5 @@ /* - Copyright � 1995-2001, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: ReadBattClock() function. @@ -7,52 +7,16 @@ */ #include "battclock_intern.h" -/***************************************************************************** - - NAME */ #include #include #include #include #include - AROS_LH0(ULONG, ReadBattClock, - -/* SYNOPSIS */ - /* void */ - -/* LOCATION */ - struct BattClockBase *, BattClockBase, 2, Battclock) - -/* FUNCTION - Return the value stored in the battery back up clock. This value - is the number of seconds that have elapsed since midnight on the - 1st of January 1978 (00:00:00 1.1.1978). - - If the value of the battery clock is invalid, then the clock will - be reset. - - INPUTS - - RESULT - The number of seconds since 1.1.1978 00:00:00 - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - WriteBattClock, ResetBattClock - - INTERNALS - - HISTORY - 27-11-96 digulla automatically created from - battclock_lib.fd and clib/battclock_protos.h +/* See rom/battclock/readbattclock.c for documentation */ -*****************************************************************************/ +AROS_LH0(ULONG, ReadBattClock, + struct BattClockBase *, BattClockBase, 2, Battclock) { AROS_LIBFUNC_INIT diff --git a/arch/ppc-chrp/battclock/writebattclock.c b/arch/ppc-chrp/battclock/writebattclock.c index 273e66d42c..8e6024ff01 100644 --- a/arch/ppc-chrp/battclock/writebattclock.c +++ b/arch/ppc-chrp/battclock/writebattclock.c @@ -1,5 +1,5 @@ /* - Copyright � 1995-2007, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: WriteBattClock() @@ -9,9 +9,6 @@ static int rtas_call(const char *method, int nargs, int nret, void *output, ...); -/***************************************************************************** - - NAME */ #include #include #include @@ -19,42 +16,11 @@ static int rtas_call(const char *method, int nargs, int nret, void *output, ...) #include #include - AROS_LH1(void, WriteBattClock, - -/* SYNOPSIS */ - AROS_LHA(ULONG, time, D0), - -/* LOCATION */ - APTR *, BattClockBase, 3, Battclock) - -/* FUNCTION - Set the systems battery backed up clock to the time specified. The - value should be the number of seconds since 00:00:00 on 1.1.1978. - - INPUTS - time - The number of seconds elapsed since 00:00:00 1.1.1978 - - RESULT - The clock will be set. - - NOTES - This may not do anything on some systems where the battery backed - up clock either doesn't exist, or may not be writable. - - EXAMPLE - - BUGS - - SEE ALSO - ReadBattClock, ResetBattClock - - INTERNALS - - HISTORY - 27-11-96 digulla automatically created from - battclock_lib.fd and clib/battclock_protos.h +/* See rom/battclock/writebattclock.c for documentation */ -*****************************************************************************/ +AROS_LH1(void, WriteBattClock, + AROS_LHA(ULONG, time, D0), + APTR *, BattClockBase, 3, Battclock) { AROS_LIBFUNC_INIT diff --git a/arch/ppc-chrp/dos/internalunloadseg.c b/arch/ppc-chrp/dos/internalunloadseg.c index 79c1f384db..6c654c37c9 100644 --- a/arch/ppc-chrp/dos/internalunloadseg.c +++ b/arch/ppc-chrp/dos/internalunloadseg.c @@ -1,5 +1,5 @@ /* - Copyright � 1995-2007, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: @@ -12,41 +12,14 @@ #include #include -/***************************************************************************** - - NAME */ #include - AROS_LH2(BOOL, InternalUnLoadSeg, - -/* SYNOPSIS */ - AROS_LHA(BPTR , seglist , D1), - AROS_LHA(VOID_FUNC, freefunc, A1), - -/* LOCATION */ - struct DosLibrary *, DOSBase, 127, Dos) - -/* FUNCTION - Unloads a seglist loaded with InternalLoadSeg(). - - INPUTS - seglist - Seglist - freefunc - Function to be called to free memory - - RESULT - DOSTRUE if everything wents O.K. - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS +/* See rom/dos/internalunloadseg.c for documentation */ -*****************************************************************************/ +AROS_LH2(BOOL, InternalUnLoadSeg, + AROS_LHA(BPTR , seglist , D1), + AROS_LHA(VOID_FUNC, freefunc, A1), + struct DosLibrary *, DOSBase, 127, Dos) { AROS_LIBFUNC_INIT diff --git a/arch/ppc-chrp/efika/timer/beginio.c b/arch/ppc-chrp/efika/timer/beginio.c index 43f4c68c3e..d2bcadf81a 100644 --- a/arch/ppc-chrp/efika/timer/beginio.c +++ b/arch/ppc-chrp/efika/timer/beginio.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2007, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: BeginIO - Start up a timer.device request. @@ -14,6 +14,8 @@ #include #include +/* See rom/timer/beginio.c for documentation */ + /****************************************************************************************/ #define NEWSTYLE_DEVICE 1 @@ -39,45 +41,12 @@ static const UWORD SupportedCommands[] = BOOL timer_addToWaitList(struct TimerBase *, struct MinList *, struct timerequest *); -/*****i*********************************************************************** - - NAME */ #include #include - AROS_LH1(void, BeginIO, -/* SYNOPSIS */ +AROS_LH1(void, BeginIO, AROS_LHA(struct timerequest *, timereq, A1), - -/* LOCATION */ struct TimerBase *, TimerBase, 5, Timer) - -/* FUNCTION - BeginIO() will perform a timer.device command. It is normally - called from within DoIO() and SendIO(). - - INPUT - timereq - The request to process. - - RESULT - The requested message will be processed. - - NOTES - This function is safe to call from interrupts. - - EXAMPLE - - BUGS - - SEE ALSO - exec/Abort(), exec/SendIO(), exec/DoIO() - - INTERNALS - - HISTORY - 23-01-1998 iaint Implemented again. - -******************************************************************************/ { AROS_LIBFUNC_INIT diff --git a/arch/ppc-chrp/efika/timer/getsystime.c b/arch/ppc-chrp/efika/timer/getsystime.c dissimilarity index 63% index 521d7f5669..97257dac0e 100644 --- a/arch/ppc-chrp/efika/timer/getsystime.c +++ b/arch/ppc-chrp/efika/timer/getsystime.c @@ -1,63 +1,31 @@ -/* - Copyright © 1995-2007, The AROS Development Team. All rights reserved. - $Id$ - - Desc: GetSysTime() - Find out what time it is. - Lang: english -*/ -#include "lowlevel.h" -#include - -/***************************************************************************** - - NAME */ -#include -#include - - AROS_LH1(void, GetSysTime, - -/* SYNOPSIS */ - AROS_LHA(struct timeval *, dest, A0), - -/* LOCATION */ - struct Device *, TimerBase, 11, Timer) - -/* FUNCTION - GetSysTime() will fill in the supplied timeval with the current - system time. - - INPUTS - dest - A pointer to the timeval you want the time stored in. - - RESULT - The timeval "dest" will be filled with the current system time. - - NOTES - This function is safe to call from interrupts. - - EXAMPLE - - BUGS - - SEE ALSO - TR_GETSYSTIME, TR_SETSYSTIME - - INTERNALS - - HISTORY - 18-02-1997 iaint Implemented. - -*****************************************************************************/ -{ - AROS_LIBFUNC_INIT - - struct TimerBase *timerBase = (struct TimerBase *)TimerBase; - - Disable(); - EClockUpdate(TimerBase); - dest->tv_secs = timerBase->tb_CurrentTime.tv_secs; - dest->tv_micro = timerBase->tb_CurrentTime.tv_micro; - Enable(); - - AROS_LIBFUNC_EXIT -} /* GetSysTime */ +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: GetSysTime() - Find out what time it is. + Lang: english +*/ +#include "lowlevel.h" +#include + +#include +#include + +/* See rom/timer/getsystime.c for documentation */ + +AROS_LH1(void, GetSysTime, + AROS_LHA(struct timeval *, dest, A0), + struct Device *, TimerBase, 11, Timer) +{ + AROS_LIBFUNC_INIT + + struct TimerBase *timerBase = (struct TimerBase *)TimerBase; + + Disable(); + EClockUpdate(TimerBase); + dest->tv_secs = timerBase->tb_CurrentTime.tv_secs; + dest->tv_micro = timerBase->tb_CurrentTime.tv_micro; + Enable(); + + AROS_LIBFUNC_EXIT +} /* GetSysTime */ diff --git a/arch/ppc-chrp/efika/timer/readeclock.c b/arch/ppc-chrp/efika/timer/readeclock.c dissimilarity index 65% index e2c997ae84..1b951716e2 100644 --- a/arch/ppc-chrp/efika/timer/readeclock.c +++ b/arch/ppc-chrp/efika/timer/readeclock.c @@ -1,71 +1,37 @@ -/* - Copyright © 1995-2007, The AROS Development Team. All rights reserved. - $Id$ - - Desc: ReadEClock() - read the base frequency of timers. - Lang: english -*/ - -/***************************************************************************** - - NAME */ -#include -#include -#include - -#include - -#include "lowlevel.h" - - AROS_LH1(ULONG, ReadEClock, - -/* SYNOPSIS */ - AROS_LHA(struct EClockVal *, dest, A0), - -/* LOCATION */ - struct TimerBase *, TimerBase, 10, Timer) - -/* FUNCTION - ReadEClock() reads current value of E-Clock and stores - it in the destination EClockVal structure passed as - argument. It also returns the frequency of EClock of the - system. - - This call is supposed to be very fast. - INPUTS - dest - Destination EClockVal - - RESULT - The EClock frequency (tics/s) - - NOTES - This function is safe to call from interrupts. - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - - HISTORY - 19-08-2005 schulz Implemented. - -*****************************************************************************/ -{ - AROS_LIBFUNC_INIT - - Disable(); - - EClockUpdate(TimerBase); - - dest->ev_hi = TimerBase->tb_ticks_total >> 32; - dest->ev_lo = TimerBase->tb_ticks_total & 0xffffffff; - - Enable(); - return 33000000; - - AROS_LIBFUNC_EXIT -} /* CmpTime */ - +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: ReadEClock() - read the base frequency of timers. + Lang: english +*/ + +#include +#include +#include + +#include + +#include "lowlevel.h" + +/* See rom/timer/readeclock.c for documentation */ + +AROS_LH1(ULONG, ReadEClock, + AROS_LHA(struct EClockVal *, dest, A0), + struct TimerBase *, TimerBase, 10, Timer) +{ + AROS_LIBFUNC_INIT + + Disable(); + + EClockUpdate(TimerBase); + + dest->ev_hi = TimerBase->tb_ticks_total >> 32; + dest->ev_lo = TimerBase->tb_ticks_total & 0xffffffff; + + Enable(); + return 33000000; + + AROS_LIBFUNC_EXIT +} /* CmpTime */ + diff --git a/arch/ppc-chrp/exec/cachepostdma.c b/arch/ppc-chrp/exec/cachepostdma.c dissimilarity index 71% index 8969bdda35..738e78f001 100644 --- a/arch/ppc-chrp/exec/cachepostdma.c +++ b/arch/ppc-chrp/exec/cachepostdma.c @@ -1,69 +1,33 @@ -/* - Copyright © 1995-2001, The AROS Development Team. All rights reserved. - $Id$ - - Desc: CachePostDMA() - Do what is necessary for DMA. - Lang: english -*/ - -#define DEBUG 0 - -#include -#include -#include -#include - -/***************************************************************************** - - NAME */ -#include - - AROS_LH3(void, CachePostDMA, - -/* SYNOPSIS */ - AROS_LHA(APTR, address, A0), - AROS_LHA(ULONG *, length, A1), - AROS_LHA(ULONG, flags, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 128, Exec) - -/* FUNCTION - Do everything necessary to make CPU caches aware that a DMA has - happened. - - INPUTS - address - Virtual address of memory affected by the DMA - *length - Number of bytes affected - flags - DMA_NoModify - Indicate that the memory did not change. - DMA_ReadFromRAM - Indicate that the DMA goes from RAM - to the device. Set this bit in - both calls. - - RESULT - - NOTES - DMA must follow a call to CachePreDMA() and must be followed - by a call to CachePostDMA(). - - EXAMPLE - - BUGS - - SEE ALSO - CachePreDMA() - - INTERNALS - This function should be replaced by a function in the $(KERNEL) - directory. - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - if (!(flags & DMA_ReadFromRAM)) - CacheClearE(address, *length, CACRF_InvalidateD | CACRF_ClearI); - - AROS_LIBFUNC_EXIT -} /* CachePostDMA */ - +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: CachePostDMA() - Do what is necessary for DMA. + Lang: english +*/ + +#define DEBUG 0 + +#include +#include +#include +#include + +#include + +/* See rom/exec/cachepostdma.c for documentation */ + +AROS_LH3(void, CachePostDMA, + AROS_LHA(APTR, address, A0), + AROS_LHA(ULONG *, length, A1), + AROS_LHA(ULONG, flags, D0), + struct ExecBase *, SysBase, 128, Exec) +{ + AROS_LIBFUNC_INIT + + if (!(flags & DMA_ReadFromRAM)) + CacheClearE(address, *length, CACRF_InvalidateD | CACRF_ClearI); + + AROS_LIBFUNC_EXIT +} /* CachePostDMA */ + diff --git a/arch/ppc-chrp/exec/cachepredma.c b/arch/ppc-chrp/exec/cachepredma.c dissimilarity index 71% index b17e33ae2d..c21dbc26e1 100644 --- a/arch/ppc-chrp/exec/cachepredma.c +++ b/arch/ppc-chrp/exec/cachepredma.c @@ -1,83 +1,41 @@ -/* - Copyright © 1995-2010, The AROS Development Team. All rights reserved. - $Id$ - - Desc: CachePreDMA() - Do what is necessary for DMA. - Lang: english -*/ - -#define DEBUG 0 - -#include -#include -#include - -#include "exec_intern.h" - -/***************************************************************************** - - NAME */ -#include -#include - - AROS_LH3(APTR, CachePreDMA, - -/* SYNOPSIS */ - AROS_LHA(APTR, address, A0), - AROS_LHA(ULONG *, length, A1), - AROS_LHA(ULONG, flags, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 127, Exec) - -/* FUNCTION - Do everything necessary to make CPU caches aware that a DMA - will happen. Virtual memory systems will make it possible - that your memory is not at one block and not at the address - you thought. This function gives you all the information - you need to split the DMA request up and to convert virtual - to physical addresses. - - INPUTS - address - Virtual address of memory affected by the DMA - *length - Number of bytes affected - flags - DMA_Continue - This is a call to continue a - request that was broken up. - DMA_ReadFromRAM - Indicate that the DMA goes from - RAM to the device. Set this bit - in both calls. - - RESULT - The physical address in memory. - *length contains the number of contiguous bytes in physical - memory. - - NOTES - DMA must follow a call to CachePreDMA() and must be followed - by a call to CachePostDMA(). - - EXAMPLE - - BUGS - - SEE ALSO - CachePostDMA() - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - void *addr = KrnVirtualToPhysical(address); - - /* At PreDMA stage only data caches need to be flushed */ - //if (flags & DMA_ReadFromRAM) - - CacheClearE(address, *length, CACRF_ClearD); - - return addr; - - AROS_LIBFUNC_EXIT -} /* CachePreDMA() */ - +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: CachePreDMA() - Do what is necessary for DMA. + Lang: english +*/ + +#define DEBUG 0 + +#include +#include +#include + +#include "exec_intern.h" + +#include +#include + +/* See rom/exec/cachepredma.c for documentation */ + +AROS_LH3(APTR, CachePreDMA, + AROS_LHA(APTR, address, A0), + AROS_LHA(ULONG *, length, A1), + AROS_LHA(ULONG, flags, D0), + struct ExecBase *, SysBase, 127, Exec) +{ + AROS_LIBFUNC_INIT + + void *addr = KrnVirtualToPhysical(address); + + /* At PreDMA stage only data caches need to be flushed */ + //if (flags & DMA_ReadFromRAM) + + CacheClearE(address, *length, CACRF_ClearD); + + return addr; + + AROS_LIBFUNC_EXIT +} /* CachePreDMA() */ + diff --git a/arch/ppc-chrp/exec/coldreboot.c b/arch/ppc-chrp/exec/coldreboot.c dissimilarity index 61% index df121fde05..9ed26037d8 100644 --- a/arch/ppc-chrp/exec/coldreboot.c +++ b/arch/ppc-chrp/exec/coldreboot.c @@ -1,58 +1,30 @@ -/* - Copyright © 1995-2012, The AROS Development Team. All rights reserved. - $Id$ - - Desc: ColdReboot() - Reboot the computer. - Lang: english -*/ - -#include -#include -#include -#include - -#include - -#include "exec_util.h" - -/***************************************************************************** - - NAME */ - - AROS_LH0(void, ColdReboot, - -/* LOCATION */ - struct ExecBase *, SysBase, 121, Exec) - -/* FUNCTION - This function will reboot the computer. - - INPUTS - None. - - RESULT - This function does not return. - - NOTES - It can be quite harmful to call this function. It may be possible that - you will lose data from other tasks not having saved, or disk buffers - not being flushed. Plus you could annoy the (other) users. - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - Exec_DoResetCallbacks((struct IntExecBase *)SysBase, SD_ACTION_WARMREBOOT); - - asm volatile("li %%r3,%0; sc"::"i"(0x100 /*SC_REBOOT*/):"memory","r3"); - - AROS_LIBFUNC_EXIT -} +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: ColdReboot() - Reboot the computer. + Lang: english +*/ + +#include +#include +#include +#include + +#include + +#include "exec_util.h" + +/* See rom/exec/coldreboot.c for documentation */ + +AROS_LH0(void, ColdReboot, + struct ExecBase *, SysBase, 121, Exec) +{ + AROS_LIBFUNC_INIT + + Exec_DoResetCallbacks((struct IntExecBase *)SysBase, SD_ACTION_WARMREBOOT); + + asm volatile("li %%r3,%0; sc"::"i"(0x100 /*SC_REBOOT*/):"memory","r3"); + + AROS_LIBFUNC_EXIT +} diff --git a/arch/ppc-chrp/exec/rawputchar.c b/arch/ppc-chrp/exec/rawputchar.c index 18a7aeb796..b85472fe3f 100644 --- a/arch/ppc-chrp/exec/rawputchar.c +++ b/arch/ppc-chrp/exec/rawputchar.c @@ -1,14 +1,11 @@ /* - Copyright © 1995-2010, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: Emit one character via raw IO Lang: english */ -/*****i*********************************************************************** - - NAME */ #include #include #include @@ -19,6 +16,8 @@ #undef bug +/* See rom/exec/rawputchar.c for documentation */ + static inline void bug(const char *format, ...) { va_list args; @@ -28,38 +27,10 @@ static inline void bug(const char *format, ...) va_end(args); } - AROS_LH1(void, RawPutChar, - -/* SYNOPSIS */ - AROS_LHA(UBYTE, chr, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 86, Exec) - -/* FUNCTION - Emits a single character. - - INPUTS - chr - The character to emit - - RESULT - None. - - NOTES - This function is for very low level debugging only. - - EXAMPLE - - BUGS - - SEE ALSO - RawIOInit(), RawPutChar(), RawMayGetChar() - - INTERNALS - - HISTORY -*****************************************************************************/ +AROS_LH1(void, RawPutChar, + AROS_LHA(UBYTE, chr, D0), + struct ExecBase *, SysBase, 86, Exec) { AROS_LIBFUNC_INIT diff --git a/arch/ppc-chrp/exec/shutdowna.c b/arch/ppc-chrp/exec/shutdowna.c index 1a0fb1c0fe..43523b0c73 100644 --- a/arch/ppc-chrp/exec/shutdowna.c +++ b/arch/ppc-chrp/exec/shutdowna.c @@ -1,5 +1,5 @@ /* - Copyright � 1995-2001, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: ShutdownA() - Shut down the operating system. @@ -10,6 +10,8 @@ #include #include +/* See rom/kernel/issuper.c for documentation */ + static int rtas_call(struct ExecBase *SysBase, const char *method, int nargs, int nret, void *output, ...) { va_list args; @@ -23,43 +25,10 @@ static int rtas_call(struct ExecBase *SysBase, const char *method, int nargs, in return retval; } -/***************************************************************************** - - NAME */ - - AROS_LH1(ULONG, ShutdownA, - -/* SYNOPSIS */ - AROS_LHA(ULONG, action, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 173, Exec) - -/* FUNCTION - This function will shut down the operating system. - - INPUTS - action - what to do: - * SD_ACTION_POWEROFF - power off the machine. - * SD_ACTION_COLDREBOOT - cold reboot the machine (not only AROS). - - RESULT - This function does not return in case of success. Otherwise is returns - zero. - - NOTES - It can be quite harmful to call this function. It may be possible that - you will lose data from other tasks not having saved, or disk buffers - not being flushed. Plus you could annoy the (other) users. - - EXAMPLE - - BUGS - - SEE ALSO - ColdReboot() -******************************************************************************/ +AROS_LH1(ULONG, ShutdownA, + AROS_LHA(ULONG, action, D0), + struct ExecBase *, SysBase, 173, Exec) { AROS_LIBFUNC_INIT diff --git a/arch/ppc-chrp/exec/superstate.c b/arch/ppc-chrp/exec/superstate.c dissimilarity index 69% index 7184bfd652..928694fd85 100644 --- a/arch/ppc-chrp/exec/superstate.c +++ b/arch/ppc-chrp/exec/superstate.c @@ -1,60 +1,27 @@ -/* - Copyright © 1995-2001, The AROS Development Team. All rights reserved. - $Id$ - - Desc: SuperState() - Switch the processor into a higher plane. - Lang: english -*/ - -/***************************************************************************** - - NAME */ -#include - - AROS_LH0(APTR, SuperState, - -/* LOCATION */ - struct ExecBase *, SysBase, 25, Exec) - -/* FUNCTION - Enter supervisor mode (like Supervisor()), but return on the user - stack. This will mean that the user stack variables are still there. - A call to UserState() will end this mode. - - INPUTS - None. - - RESULT - The old supervisor stack. This must be passed to UserState(). If the - processor was already in supervisor mode, then this function will - return NULL. In that case do NOT call UserState(). - - NOTES - This is not a good function to use, it has limited scope, and will - probably be even less useful in the future. - - EXAMPLE - - BUGS - You can easily cause your system to cease operating normally. - - SEE ALSO - Supervisor(), UserState() - - INTERNALS - For extra details see Supervisor(). - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - asm volatile("li %%r3,%0; sc"::"i"(6 /*SC_SUPERSTATE*/):"memory","r3"); - - /* We have to return something. NULL is an invalid address for a - stack, so it could be used to say that this function does - nothing. - */ - return NULL; - - AROS_LIBFUNC_EXIT -} /* SuperState() */ +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: SuperState() - Switch the processor into a higher plane. + Lang: english +*/ + +#include + +/* See rom/exec/superstate.c for documentation */ + +AROS_LH0(APTR, SuperState, + struct ExecBase *, SysBase, 25, Exec) +{ + AROS_LIBFUNC_INIT + + asm volatile("li %%r3,%0; sc"::"i"(6 /*SC_SUPERSTATE*/):"memory","r3"); + + /* We have to return something. NULL is an invalid address for a + stack, so it could be used to say that this function does + nothing. + */ + return NULL; + + AROS_LIBFUNC_EXIT +} /* SuperState() */ diff --git a/arch/ppc-chrp/exec/supervisor.c b/arch/ppc-chrp/exec/supervisor.c dissimilarity index 84% index 3e285bb113..f02cac14b0 100644 --- a/arch/ppc-chrp/exec/supervisor.c +++ b/arch/ppc-chrp/exec/supervisor.c @@ -1,88 +1,31 @@ -/* - Copyright © 1995-2012, The AROS Development Team. All rights reserved. - $Id$ - - Desc: Supervisor() - Execute some code in a privileged environment. - Lang: english -*/ - -/***************************************************************************** - - NAME */ -#include - - AROS_LH1(ULONG, Supervisor, - -/* SYNOPSIS */ - AROS_LHA(ULONG_FUNC, userFunction, A5), - -/* LOCATION */ - struct ExecBase *, SysBase, 5, Exec) - -/* FUNCTION - Supervisor will allow a short privileged instruction sequence to - be called from user mode. This has very few uses, and it is probably - better to use any system supplied method to do anything. - - The function supplied will be called as if it was a system interrupt, - notably this means that you must *NOT* make any system calls or - use any system data structures, and on certain systems you must - use special methods to leave the code. - - The code will not be passed any parameters. - - INPUTS - userFunc - The address of the code you want called in supervisor - mode. - - RESULT - The code will be called. - - NOTES - This function has completely different effects on different - processors and architectures. - - Currently defined effects are: - - Kernel Effect - ------------------------------------------------------------------- - i386 (under emulation) None - m68k (native) Runs the process in supervisor mode. - The process must end with an RTE - instruction. It should save any - registers which is uses. - m68k (under emulation) - - EXAMPLE - - BUGS - You can very easily make the system unusable with this function. - In fact it is recommended that you do not use it at all. - - SEE ALSO - SuperState(), UserState() - - INTERNALS - You can do what you want with this function, even ignoring it if - you don't think it makes any sense. But it could be quite useful - to make it run something under different protection levels. - - You should trust that the programmer know what they are doing :-) - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - register ULONG retval; - register APTR stack; - - stack = SuperState(); - - retval = (*userFunction)(); - - UserState(stack); - - return retval; - - AROS_LIBFUNC_EXIT -} /* Supervisor() */ +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: Supervisor() - Execute some code in a privileged environment. + Lang: english +*/ + +#include + +/* See rom/exec/supervisor.c for documentation */ + +AROS_LH1(ULONG, Supervisor, + AROS_LHA(ULONG_FUNC, userFunction, A5), + struct ExecBase *, SysBase, 5, Exec) +{ + AROS_LIBFUNC_INIT + + register ULONG retval; + register APTR stack; + + stack = SuperState(); + + retval = (*userFunction)(); + + UserState(stack); + + return retval; + + AROS_LIBFUNC_EXIT +} /* Supervisor() */ diff --git a/arch/ppc-chrp/exec/userstate.c b/arch/ppc-chrp/exec/userstate.c dissimilarity index 66% index 870f97624c..1b30ac720c 100644 --- a/arch/ppc-chrp/exec/userstate.c +++ b/arch/ppc-chrp/exec/userstate.c @@ -1,53 +1,25 @@ -/* - Copyright © 1995-2001, The AROS Development Team. All rights reserved. - $Id$ - - Desc: UserState() - Return to normal mode after changing things. - Lang: english -*/ - -/***************************************************************************** - - NAME */ -#include -#include - - AROS_LH1(void, UserState, - -/* SYNOPSIS */ - AROS_LHA(APTR, sysStack, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 26, Exec) - -/* FUNCTION - Return to user mode after a call to SuperState(). - - INPUTS - sysStack - The return value from SuperState() - - RESULT - The system will be back to normal. - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - SuperState(), Supervisor() - - INTERNALS - Undo SuperState() - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - wrmsr(rdmsr() | (MSR_PR)); - - sysStack = 0; /* Get rid of the compiler warning */ - - AROS_LIBFUNC_EXIT -} /* UserState() */ +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: UserState() - Return to normal mode after changing things. + Lang: english +*/ + +#include +#include + +/* See rom/exec/userstate.c for documentation */ + +AROS_LH1(void, UserState, + AROS_LHA(APTR, sysStack, D0), + struct ExecBase *, SysBase, 26, Exec) +{ + AROS_LIBFUNC_INIT + + wrmsr(rdmsr() | (MSR_PR)); + + sysStack = 0; /* Get rid of the compiler warning */ + + AROS_LIBFUNC_EXIT +} /* UserState() */ diff --git a/arch/ppc-native/processor/getcpuinfo.c b/arch/ppc-native/processor/getcpuinfo.c dissimilarity index 61% index 625daa063c..aa96f3f0f5 100644 --- a/arch/ppc-native/processor/getcpuinfo.c +++ b/arch/ppc-native/processor/getcpuinfo.c @@ -1,210 +1,99 @@ -/* - Copyright © 2010-2011, The AROS Development Team. All rights reserved. - $Id$ - - Desc: GetCPUInfo() - Provides information about installed CPUs - Lang: english -*/ - -#define DEBUG 0 - -#include -#include -#include -#include -#include - -#include "defaults.h" -#include "processor_intern_arch.h" - -/***************************************************************************** - - NAME */ -#include - - AROS_LH1(void, GetCPUInfo, - -/* SYNOPSIS */ - AROS_LHA(struct TagItem *, tagList, A0), - -/* LOCATION */ - struct ProcessorBase *, ProcessorBase, 1, Processor) - -/* FUNCTION - - Provides information about selected processor in the system - - INPUTS - - Function takes an array of tags. Data is returned for each tag. See - specific tag description. There is a control tag CGIT_SelecetProcessor. - - TAGS - - GCIT_SelectedProcessor - (ULONG) When this tag is set correctly, information - about choosen processor is provided. If this - tag is missing or this tag has invalid value, - information about first processor is returned. - - GCIT_NumberOfProcessors - (ULONG *) Provides the number of processors - present in the system. - - GCIT_ModelString - (CONST_STRPTR *) Provides the name of the model of the - processor. The string is considered read-only. - - GCIT_Family - (ULONG *) Provides designation of processor family using - one of the CPUFAMILY_XXX values. - - GCIT_VectorUnit - (ULONG *) Provides designation of available vectory - unit using one of the VECTORTYPE_XXX values. - - GCIT_Architecture - (ULONG *) Provides designation of processor - architecture using one of the PROCESSORARCH_XXX - values. - - GCIT_Endianness - (ULONG *) Provides designation of current processor - endianness using one of the ENDIANNESS_XXX values. - - GCIT_ProcessorSpeed - (UQUAD *) Provides the current CPU speed in Hz - - GCIT_FrontsideSpeed - (UQUAD *) Provides the current FSB speed in Hz - - GCIT_ProcessorLoad - (UBYTE *) Provides the current CPU load in % (0-100) - - Cache sizes - (ULONG *) Following tags are used to retrieve size of - specified caches. - - GCIT_L1CacheSize - GCIT_L1DataCacheSize - GCIT_L1InstructionCacheSize - GCIT_L2CacheSize - GCIT_L3CacheSize - - Size is returned in kB. - - GCIT_CacheLineSize - (ULONG *) Provides the size of cache line in bytes. - In case these sizes differ per cache level, the - smallest size if provided. - - Features - (BOOL *) Following tags are used to check availability of - certain features. The result is always a boolean. - - GCIT_SupportsFPU - GCIT_SupportsAltiVec - GCIT_SupportsVMX - GCIT_SupportsMMX - GCIT_SupportsMMXEXT - GCIT_Supports3DNOW - GCIT_Supports3DNOWEXT - GCIT_SupportsSSE - GCIT_SupportsSSE2 - GCIT_SupportsSSE3 - GCIT_SupportsSSSE3 - GCIT_SupportsSSE41 - GCIT_SupportsSSE42 - GCIT_SupportsSSE4A - GCIT_SupportsVME - GCIT_SupportsPSE - GCIT_SupportsPAE - GCIT_SupportsCX8 - GCIT_SupportsAPIC - GCIT_SupportsCMOV - GCIT_SupportsPSE36 - GCIT_SupportsCLFSH - GCIT_SupportsACPI - GCIT_SupportsFXSR - GCIT_SupportsHTT - GCIT_SupportsCX16 - GCIT_SupportsVirtualization - GCIT_SupportsNoExecutionBit - GCIT_Supports64BitMode - GCIT_SupportsMSR - - RESULT - - None - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - struct TagItem * passedTag = NULL; - struct SystemProcessors *sp = ProcessorBase->Private1; - - while ((passedTag = LibNextTagItem(&tagList)) != NULL) - { - if ((passedTag->ti_Tag > GCIT_FeaturesBase) && - (passedTag->ti_Tag <= GCIT_FeaturesLast)) - { - *((BOOL *)passedTag->ti_Data) = FALSE; - continue; - } - else - { - switch(passedTag->ti_Tag) - { - case(GCIT_NumberOfProcessors): - *((ULONG *)passedTag->ti_Data) = ProcessorBase->cpucount; - break; - case(GCIT_Model): - *((ULONG *)passedTag->ti_Data) = sp->sp_PVR; - break; - case(GCIT_ModelString): - *((CONST_STRPTR *)passedTag->ti_Data) = "PowerPC"; - break; - case(GCIT_Family): - *((ULONG *)passedTag->ti_Data) = CPUFAMILY_UNKNOWN; - break; - case(GCIT_VectorUnit): - *((ULONG *)passedTag->ti_Data) = VECTORTYPE_NONE; - break; - case(GCIT_L1CacheSize): - *((ULONG *)passedTag->ti_Data) = 0; - break; - case(GCIT_L1DataCacheSize): - *((ULONG *)passedTag->ti_Data) = 0; - break; - case(GCIT_L1InstructionCacheSize): - *((ULONG *)passedTag->ti_Data) = 0; - break; - case(GCIT_L2CacheSize): - *((ULONG *)passedTag->ti_Data) = 0; - break; - case(GCIT_L3CacheSize): - *((ULONG *)passedTag->ti_Data) = 0; - break; - case(GCIT_CacheLineSize): - *((ULONG *)passedTag->ti_Data) = 0; - break; - case(GCIT_Architecture): - *((ULONG *)passedTag->ti_Data) = PROCESSORARCH_DEF; - break; - case(GCIT_Endianness): - *((ULONG *)passedTag->ti_Data) = ENDIANNESS_DEF; - break; - case(GCIT_ProcessorSpeed): - *((UQUAD *)passedTag->ti_Data) = 0; - break; - case(GCIT_ProcessorLoad): - *((UBYTE *)passedTag->ti_Data) = 0; - break; - case(GCIT_FrontsideSpeed): - *((UQUAD *)passedTag->ti_Data) = 0; - break; - } - } - } - - AROS_LIBFUNC_EXIT -} /* GetCPUInfo() */ - +/* + Copyright © 2010-2031, The AROS Development Team. All rights reserved. + $Id$ + + Desc: GetCPUInfo() - Provides information about installed CPUs + Lang: english +*/ + +#define DEBUG 0 + +#include +#include +#include +#include +#include + +#include "defaults.h" +#include "processor_intern_arch.h" + +#include + +/* See rom/processor/getcpuinfo.c for documentation */ + +AROS_LH1(void, GetCPUInfo, + AROS_LHA(struct TagItem *, tagList, A0), + struct ProcessorBase *, ProcessorBase, 1, Processor) +{ + AROS_LIBFUNC_INIT + + struct TagItem * passedTag = NULL; + struct SystemProcessors *sp = ProcessorBase->Private1; + + while ((passedTag = LibNextTagItem(&tagList)) != NULL) + { + if ((passedTag->ti_Tag > GCIT_FeaturesBase) && + (passedTag->ti_Tag <= GCIT_FeaturesLast)) + { + *((BOOL *)passedTag->ti_Data) = FALSE; + continue; + } + else + { + switch(passedTag->ti_Tag) + { + case(GCIT_NumberOfProcessors): + *((ULONG *)passedTag->ti_Data) = ProcessorBase->cpucount; + break; + case(GCIT_Model): + *((ULONG *)passedTag->ti_Data) = sp->sp_PVR; + break; + case(GCIT_ModelString): + *((CONST_STRPTR *)passedTag->ti_Data) = "PowerPC"; + break; + case(GCIT_Family): + *((ULONG *)passedTag->ti_Data) = CPUFAMILY_UNKNOWN; + break; + case(GCIT_VectorUnit): + *((ULONG *)passedTag->ti_Data) = VECTORTYPE_NONE; + break; + case(GCIT_L1CacheSize): + *((ULONG *)passedTag->ti_Data) = 0; + break; + case(GCIT_L1DataCacheSize): + *((ULONG *)passedTag->ti_Data) = 0; + break; + case(GCIT_L1InstructionCacheSize): + *((ULONG *)passedTag->ti_Data) = 0; + break; + case(GCIT_L2CacheSize): + *((ULONG *)passedTag->ti_Data) = 0; + break; + case(GCIT_L3CacheSize): + *((ULONG *)passedTag->ti_Data) = 0; + break; + case(GCIT_CacheLineSize): + *((ULONG *)passedTag->ti_Data) = 0; + break; + case(GCIT_Architecture): + *((ULONG *)passedTag->ti_Data) = PROCESSORARCH_DEF; + break; + case(GCIT_Endianness): + *((ULONG *)passedTag->ti_Data) = ENDIANNESS_DEF; + break; + case(GCIT_ProcessorSpeed): + *((UQUAD *)passedTag->ti_Data) = 0; + break; + case(GCIT_ProcessorLoad): + *((UBYTE *)passedTag->ti_Data) = 0; + break; + case(GCIT_FrontsideSpeed): + *((UQUAD *)passedTag->ti_Data) = 0; + break; + } + } + } + + AROS_LIBFUNC_EXIT +} /* GetCPUInfo() */ + diff --git a/arch/ppc-sam440/battclock/readbattclock.c b/arch/ppc-sam440/battclock/readbattclock.c index 472fca12b2..758d97e01f 100644 --- a/arch/ppc-sam440/battclock/readbattclock.c +++ b/arch/ppc-sam440/battclock/readbattclock.c @@ -10,9 +10,6 @@ #define DEBUG 1 #include -/***************************************************************************** - - NAME */ #include #include #include @@ -21,43 +18,10 @@ #include #include - AROS_LH0(ULONG, ReadBattClock, - -/* SYNOPSIS */ - /* void */ - -/* LOCATION */ - struct BattClockBase *, BattClockBase, 2, Battclock) - -/* FUNCTION - Return the value stored in the battery back up clock. This value - is the number of seconds that have elapsed since midnight on the - 1st of January 1978 (00:00:00 1.1.1978). - - If the value of the battery clock is invalid, then the clock will - be reset. - - INPUTS - - RESULT - The number of seconds since 1.1.1978 00:00:00 - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - WriteBattClock, ResetBattClock - - INTERNALS - - HISTORY - 27-11-96 digulla automatically created from - battclock_lib.fd and clib/battclock_protos.h +/* See rom/battclock/readbattclock.c for documentation */ -*****************************************************************************/ +AROS_LH0(ULONG, ReadBattClock, + struct BattClockBase *, BattClockBase, 2, Battclock) { AROS_LIBFUNC_INIT diff --git a/arch/ppc-sam440/battclock/writebattclock.c b/arch/ppc-sam440/battclock/writebattclock.c index 32fab7547e..8e385b9600 100644 --- a/arch/ppc-sam440/battclock/writebattclock.c +++ b/arch/ppc-sam440/battclock/writebattclock.c @@ -9,9 +9,7 @@ #define DEBUG 1 #include -/***************************************************************************** - NAME */ #include #include #include @@ -21,42 +19,11 @@ #include #include - AROS_LH1(void, WriteBattClock, +/* See rom/battclock/writebattclock.c for documentation */ -/* SYNOPSIS */ - AROS_LHA(ULONG, time, D0), - -/* LOCATION */ - APTR *, BattClockBase, 3, Battclock) - -/* FUNCTION - Set the systems battery backed up clock to the time specified. The - value should be the number of seconds since 00:00:00 on 1.1.1978. - - INPUTS - time - The number of seconds elapsed since 00:00:00 1.1.1978 - - RESULT - The clock will be set. - - NOTES - This may not do anything on some systems where the battery backed - up clock either doesn't exist, or may not be writable. - - EXAMPLE - - BUGS - - SEE ALSO - ReadBattClock, ResetBattClock - - INTERNALS - - HISTORY - 27-11-96 digulla automatically created from - battclock_lib.fd and clib/battclock_protos.h - -*****************************************************************************/ +AROS_LH1(void, WriteBattClock, + AROS_LHA(ULONG, time, D0), + APTR *, BattClockBase, 3, Battclock) { AROS_LIBFUNC_INIT diff --git a/arch/ppc-sam440/exec/cachepostdma.c b/arch/ppc-sam440/exec/cachepostdma.c dissimilarity index 66% index 3a09d00272..72cc1045fb 100644 --- a/arch/ppc-sam440/exec/cachepostdma.c +++ b/arch/ppc-sam440/exec/cachepostdma.c @@ -1,71 +1,35 @@ -/* - Copyright � 1995-2001, The AROS Development Team. All rights reserved. - $Id$ - - Desc: CachePostDMA() - Do what is necessary for DMA. - Lang: english -*/ - -#define DEBUG 0 - -#include -#include -#include -#include - -/***************************************************************************** - - NAME */ -#include - - AROS_LH3(void, CachePostDMA, - -/* SYNOPSIS */ - AROS_LHA(APTR, address, A0), - AROS_LHA(ULONG *, length, A1), - AROS_LHA(ULONG, flags, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 128, Exec) - -/* FUNCTION - Do everything necessary to make CPU caches aware that a DMA has - happened. - - INPUTS - address - Virtual address of memory affected by the DMA - *length - Number of bytes affected - flags - DMA_NoModify - Indicate that the memory did not change. - DMA_ReadFromRAM - Indicate that the DMA goes from RAM - to the device. Set this bit in - both calls. - - RESULT - - NOTES - DMA must follow a call to CachePreDMA() and must be followed - by a call to CachePostDMA(). - - EXAMPLE - - BUGS - - SEE ALSO - CachePreDMA() - - INTERNALS - This function should be replaced by a function in the $(KERNEL) - directory. - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - D(bug("[exec] CachePostDMA(%08x, %d, %c)\n", address, *length, flags & DMA_ReadFromRAM ? 'R':'W')); - - if (!(flags & DMA_ReadFromRAM)) - CacheClearE(address, *length, CACRF_InvalidateD | CACRF_ClearI); - - AROS_LIBFUNC_EXIT -} /* CachePostDMA */ - +/* + Copyright � 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: CachePostDMA() - Do what is necessary for DMA. + Lang: english +*/ + +#define DEBUG 0 + +#include +#include +#include +#include + +#include + +/* See rom/exec/cachepostdma.c for documentation */ + +AROS_LH3(void, CachePostDMA, + AROS_LHA(APTR, address, A0), + AROS_LHA(ULONG *, length, A1), + AROS_LHA(ULONG, flags, D0), + struct ExecBase *, SysBase, 128, Exec) +{ + AROS_LIBFUNC_INIT + + D(bug("[exec] CachePostDMA(%08x, %d, %c)\n", address, *length, flags & DMA_ReadFromRAM ? 'R':'W')); + + if (!(flags & DMA_ReadFromRAM)) + CacheClearE(address, *length, CACRF_InvalidateD | CACRF_ClearI); + + AROS_LIBFUNC_EXIT +} /* CachePostDMA */ + diff --git a/arch/ppc-sam440/exec/cachepredma.c b/arch/ppc-sam440/exec/cachepredma.c dissimilarity index 68% index 85d0377747..a42202f8aa 100644 --- a/arch/ppc-sam440/exec/cachepredma.c +++ b/arch/ppc-sam440/exec/cachepredma.c @@ -1,83 +1,41 @@ -/* - Copyright � 1995-2010, The AROS Development Team. All rights reserved. - $Id$ - - Desc: CachePreDMA() - Do what is necessary for DMA. - Lang: english -*/ - -#define DEBUG 0 - -#include -#include -#include -#include - -#include "exec_intern.h" - -/***************************************************************************** - - NAME */ -#include - - AROS_LH3(APTR, CachePreDMA, - -/* SYNOPSIS */ - AROS_LHA(APTR, address, A0), - AROS_LHA(ULONG *, length, A1), - AROS_LHA(ULONG, flags, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 127, Exec) - -/* FUNCTION - Do everything necessary to make CPU caches aware that a DMA - will happen. Virtual memory systems will make it possible - that your memory is not at one block and not at the address - you thought. This function gives you all the information - you need to split the DMA request up and to convert virtual - to physical addresses. - - INPUTS - address - Virtual address of memory affected by the DMA - *length - Number of bytes affected - flags - DMA_Continue - This is a call to continue a - request that was broken up. - DMA_ReadFromRAM - Indicate that the DMA goes from - RAM to the device. Set this bit - in both calls. - - RESULT - The physical address in memory. - *length contains the number of contiguous bytes in physical - memory. - - NOTES - DMA must follow a call to CachePreDMA() and must be followed - by a call to CachePostDMA(). - - EXAMPLE - - BUGS - - SEE ALSO - CachePostDMA() - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - void *addr = KrnVirtualToPhysical(address); - - D(bug("[exec] CachePreDMA(%08x, %d, %c) = %08x\n", address, *length, flags & DMA_ReadFromRAM ? 'R':'W', addr)); - - /* At PreDMA stage only data caches need to be flushed */ - CacheClearE(address, *length, CACRF_ClearD); - - return addr; - - AROS_LIBFUNC_EXIT -} /* CachePreDMA() */ - +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: CachePreDMA() - Do what is necessary for DMA. + Lang: english +*/ + +#define DEBUG 0 + +#include +#include +#include +#include + +#include "exec_intern.h" + +/* See rom/exec/cachepredma.c for documentation */ + +#include + +AROS_LH3(APTR, CachePreDMA, + AROS_LHA(APTR, address, A0), + AROS_LHA(ULONG *, length, A1), + AROS_LHA(ULONG, flags, D0), + struct ExecBase *, SysBase, 127, Exec) +{ + AROS_LIBFUNC_INIT + + void *addr = KrnVirtualToPhysical(address); + + D(bug("[exec] CachePreDMA(%08x, %d, %c) = %08x\n", address, *length, flags & DMA_ReadFromRAM ? 'R':'W', addr)); + + /* At PreDMA stage only data caches need to be flushed */ + CacheClearE(address, *length, CACRF_ClearD); + + return addr; + + AROS_LIBFUNC_EXIT +} /* CachePreDMA() */ + diff --git a/arch/ppc-sam440/exec/coldreboot.c b/arch/ppc-sam440/exec/coldreboot.c index 28a7727063..ff1ca5e669 100644 --- a/arch/ppc-sam440/exec/coldreboot.c +++ b/arch/ppc-sam440/exec/coldreboot.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2012, The AROS Development Team. All rights reserved. + Copyright © 1995-2013, The AROS Development Team. All rights reserved. $Id$ Desc: ColdReboot() - Reboot the computer. @@ -16,36 +16,10 @@ #include "exec_intern.h" #include "exec_util.h" -/***************************************************************************** +/* See rom/exec/coldreboot.c for documentation */ - NAME */ - - AROS_LH0(void, ColdReboot, - -/* LOCATION */ - struct ExecBase *, SysBase, 121, Exec) - -/* FUNCTION - This function will reboot the computer. - - INPUTS - None. - - RESULT - This function does not return. - - NOTES - It can be quite harmful to call this function. It may be possible that - you will lose data from other tasks not having saved, or disk buffers - not being flushed. Plus you could annoy the (other) users. - - EXAMPLE - - BUGS - - SEE ALSO - -******************************************************************************/ +AROS_LH0(void, ColdReboot, + struct ExecBase *, SysBase, 121, Exec) { AROS_LIBFUNC_INIT diff --git a/arch/ppc-sam440/exec/superstate.c b/arch/ppc-sam440/exec/superstate.c dissimilarity index 63% index b800d47934..14912eb5d9 100644 --- a/arch/ppc-sam440/exec/superstate.c +++ b/arch/ppc-sam440/exec/superstate.c @@ -1,61 +1,28 @@ -/* - Copyright © 1995-2001, The AROS Development Team. All rights reserved. - $Id$ - - Desc: SuperState() - Switch the processor into a higher plane. - Lang: english -*/ - -/***************************************************************************** - - NAME */ -#include -#include - - AROS_LH0(APTR, SuperState, - -/* LOCATION */ - struct ExecBase *, SysBase, 25, Exec) - -/* FUNCTION - Enter supervisor mode (like Supervisor()), but return on the user - stack. This will mean that the user stack variables are still there. - A call to UserState() will end this mode. - - INPUTS - None. - - RESULT - The old supervisor stack. This must be passed to UserState(). If the - processor was already in supervisor mode, then this function will - return NULL. In that case do NOT call UserState(). - - NOTES - This is not a good function to use, it has limited scope, and will - probably be even less useful in the future. - - EXAMPLE - - BUGS - You can easily cause your system to cease operating normally. - - SEE ALSO - Supervisor(), UserState() - - INTERNALS - For extra details see Supervisor(). - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - asm volatile("li %%r3,%0; sc"::"i"(6 /*SC_SUPERSTATE*/):"memory","r3"); - - /* We have to return something. NULL is an invalid address for a - stack, so it could be used to say that this function does - nothing. - */ - return NULL; - - AROS_LIBFUNC_EXIT -} /* SuperState() */ +/* + Copyright © 1995-2001, The AROS Development Team. All rights reserved. + $Id$ + + Desc: SuperState() - Switch the processor into a higher plane. + Lang: english +*/ + +#include +#include + +/* See rom/exec/superstate.c for documentation */ + +AROS_LH0(APTR, SuperState, + struct ExecBase *, SysBase, 25, Exec) +{ + AROS_LIBFUNC_INIT + + asm volatile("li %%r3,%0; sc"::"i"(6 /*SC_SUPERSTATE*/):"memory","r3"); + + /* We have to return something. NULL is an invalid address for a + stack, so it could be used to say that this function does + nothing. + */ + return NULL; + + AROS_LIBFUNC_EXIT +} /* SuperState() */ diff --git a/arch/ppc-sam440/exec/supervisor.c b/arch/ppc-sam440/exec/supervisor.c dissimilarity index 83% index 976a366e52..db99c98a06 100644 --- a/arch/ppc-sam440/exec/supervisor.c +++ b/arch/ppc-sam440/exec/supervisor.c @@ -1,89 +1,32 @@ -/* - Copyright © 1995-2012, The AROS Development Team. All rights reserved. - $Id$ - - Desc: Supervisor() - Execute some code in a privileged environment. - Lang: english -*/ - -/***************************************************************************** - - NAME */ -#include -#include - - AROS_LH1(ULONG, Supervisor, - -/* SYNOPSIS */ - AROS_LHA(ULONG_FUNC, userFunction, A5), - -/* LOCATION */ - struct ExecBase *, SysBase, 5, Exec) - -/* FUNCTION - Supervisor will allow a short privileged instruction sequence to - be called from user mode. This has very few uses, and it is probably - better to use any system supplied method to do anything. - - The function supplied will be called as if it was a system interrupt, - notably this means that you must *NOT* make any system calls or - use any system data structures, and on certain systems you must - use special methods to leave the code. - - The code will not be passed any parameters. - - INPUTS - userFunc - The address of the code you want called in supervisor - mode. - - RESULT - The code will be called. - - NOTES - This function has completely different effects on different - processors and architectures. - - Currently defined effects are: - - Kernel Effect - ------------------------------------------------------------------- - i386 (under emulation) None - m68k (native) Runs the process in supervisor mode. - The process must end with an RTE - instruction. It should save any - registers which is uses. - m68k (under emulation) - - EXAMPLE - - BUGS - You can very easily make the system unusable with this function. - In fact it is recommended that you do not use it at all. - - SEE ALSO - SuperState(), UserState() - - INTERNALS - You can do what you want with this function, even ignoring it if - you don't think it makes any sense. But it could be quite useful - to make it run something under different protection levels. - - You should trust that the programmer know what they are doing :-) - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - register ULONG retval; - register APTR stack; - - stack = SuperState(); - - retval = (*userFunction)(); - - UserState(stack); - - return retval; - - AROS_LIBFUNC_EXIT -} /* Supervisor() */ +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: Supervisor() - Execute some code in a privileged environment. + Lang: english +*/ + +#include +#include + +/* See rom/exec/supervisor.c for documentation */ + +AROS_LH1(ULONG, Supervisor, + AROS_LHA(ULONG_FUNC, userFunction, A5), + struct ExecBase *, SysBase, 5, Exec) +{ + AROS_LIBFUNC_INIT + + register ULONG retval; + register APTR stack; + + stack = SuperState(); + + retval = (*userFunction)(); + + UserState(stack); + + return retval; + + AROS_LIBFUNC_EXIT +} /* Supervisor() */ diff --git a/arch/ppc-sam440/exec/userstate.c b/arch/ppc-sam440/exec/userstate.c dissimilarity index 66% index e3315ba29e..9f24b1e75c 100644 --- a/arch/ppc-sam440/exec/userstate.c +++ b/arch/ppc-sam440/exec/userstate.c @@ -1,53 +1,25 @@ -/* - Copyright © 1995-2001, The AROS Development Team. All rights reserved. - $Id$ - - Desc: UserState() - Return to normal mode after changing things. - Lang: english -*/ - -/***************************************************************************** - - NAME */ -#include -#include - - AROS_LH1(void, UserState, - -/* SYNOPSIS */ - AROS_LHA(APTR, sysStack, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 26, Exec) - -/* FUNCTION - Return to user mode after a call to SuperState(). - - INPUTS - sysStack - The return value from SuperState() - - RESULT - The system will be back to normal. - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - SuperState(), Supervisor() - - INTERNALS - Undo SuperState() - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - wrmsr(rdmsr() | (MSR_PR)); - - sysStack = 0; /* Get rid of the compiler warning */ - - AROS_LIBFUNC_EXIT -} /* UserState() */ +/* + Copyright © 1995-2013, The AROS Development Team. All rights reserved. + $Id$ + + Desc: UserState() - Return to normal mode after changing things. + Lang: english +*/ + +#include +#include + +/* See rom/exec/userstate.c for documentation */ + +AROS_LH1(void, UserState, + AROS_LHA(APTR, sysStack, D0), + struct ExecBase *, SysBase, 26, Exec) +{ + AROS_LIBFUNC_INIT + + wrmsr(rdmsr() | (MSR_PR)); + + sysStack = 0; /* Get rid of the compiler warning */ + + AROS_LIBFUNC_EXIT +} /* UserState() */ diff --git a/arch/ppc-sam440/kernel/maygetchar.c b/arch/ppc-sam440/kernel/maygetchar.c dissimilarity index 65% index 196b225fc4..629482aa7a 100644 --- a/arch/ppc-sam440/kernel/maygetchar.c +++ b/arch/ppc-sam440/kernel/maygetchar.c @@ -1,53 +1,24 @@ -#include - -#include -#include - -#include -#include - -/***************************************************************************** - - NAME */ -#include - -AROS_LH0(int, KrnMayGetChar, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 26, Kernel) - -/* FUNCTION - Read a single character from low-level debug input stream - - INPUTS - None - - RESULT - An ASCII code of the character or -1 if there's no character - available - - NOTES - This function never waits. If there is no character available on - the stream it just returns with -1 - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - if (inb(UART0_LSR) & UART_LSR_DR) - return inb(UART0_RBR); - - return -1; - - AROS_LIBFUNC_EXIT -} +#include + +#include +#include + +#include +#include + +#include + +/* See rom/kernel/maygetchar.c for documentation */ + +AROS_LH0(int, KrnMayGetChar, + struct KernelBase *, KernelBase, 26, Kernel) +{ + AROS_LIBFUNC_INIT + + if (inb(UART0_LSR) & UART_LSR_DR) + return inb(UART0_RBR); + + return -1; + + AROS_LIBFUNC_EXIT +} diff --git a/arch/ppc-sam440/kernel/obtaininput.c b/arch/ppc-sam440/kernel/obtaininput.c dissimilarity index 71% index 409fe6fe81..721b32ff9a 100644 --- a/arch/ppc-sam440/kernel/obtaininput.c +++ b/arch/ppc-sam440/kernel/obtaininput.c @@ -1,44 +1,18 @@ -#include -#include - -#include - -/***************************************************************************** - - NAME */ -#include - -AROS_LH0I(int, KrnObtainInput, - -/* SYNOPSIS */ - -/* LOCATION */ - struct KernelBase *, KernelBase, 33, Kernel) - -/* FUNCTION - Take over low-level debug input hardware and initialize the input - - INPUTS - None - - RESULT - Nonzero for success, zero for failure (for example there's no input channel) - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - return 1; - - AROS_LIBFUNC_EXIT -} +#include +#include + +#include + +#include + +/* See rom/kernel/obtaininput.c for documentation */ + +AROS_LH0I(int, KrnObtainInput, + struct KernelBase *, KernelBase, 33, Kernel) +{ + AROS_LIBFUNC_INIT + + return 1; + + AROS_LIBFUNC_EXIT +} diff --git a/arch/ppc-sam440/kernel/virtualtophysical.c b/arch/ppc-sam440/kernel/virtualtophysical.c index 96ac49d0d9..819a8683ee 100644 --- a/arch/ppc-sam440/kernel/virtualtophysical.c +++ b/arch/ppc-sam440/kernel/virtualtophysical.c @@ -3,36 +3,13 @@ #include -/***************************************************************************** - - NAME */ #include -AROS_LH1I(void *, KrnVirtualToPhysical, - -/* SYNOPSIS */ - AROS_LHA(void *, virtual, A0), - -/* LOCATION */ - struct KernelBase *, KernelBase, 20, Kernel) - -/* FUNCTION - - INPUTS - - RESULT +/* See rom/kernel/virtualtophysical.c for documentation */ - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ +AROS_LH1I(void *, KrnVirtualToPhysical, + AROS_LHA(void *, virtual, A0), + struct KernelBase *, KernelBase, 20, Kernel) { AROS_LIBFUNC_INIT diff --git a/arch/x86-all/processor/getcpuinfo.c b/arch/x86-all/processor/getcpuinfo.c index adae763fee..e761449c48 100644 --- a/arch/x86-all/processor/getcpuinfo.c +++ b/arch/x86-all/processor/getcpuinfo.c @@ -1,5 +1,5 @@ /* - Copyright © 2010-2011, The AROS Development Team. All rights reserved. + Copyright © 2010-2013, The AROS Development Team. All rights reserved. $Id$ Desc: GetCPUInfo() - Provides information about installed CPUs @@ -18,38 +18,13 @@ static void ProcessFeaturesTag(struct X86ProcessorInformation * info, struct TagItem * tag); -/***************************************************************************** - - NAME */ #include - AROS_LH1(void, GetCPUInfo, - -/* SYNOPSIS */ - AROS_LHA(struct TagItem *, tagList, A0), - -/* LOCATION */ - struct ProcessorBase *, ProcessorBase, 1, Processor) - -/* FUNCTION - - INPUTS - - TAGS - - RESULT - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS +/* See rom/processor/getcpuinfo.c for documentation */ -******************************************************************************/ +AROS_LH1(void, GetCPUInfo, + AROS_LHA(struct TagItem *, tagList, A0), + struct ProcessorBase *, ProcessorBase, 1, Processor) { AROS_LIBFUNC_INIT diff --git a/arch/x86_64-all/exec/copymem.c b/arch/x86_64-all/exec/copymem.c index 269cedb2bc..06a01c3b04 100644 --- a/arch/x86_64-all/exec/copymem.c +++ b/arch/x86_64-all/exec/copymem.c @@ -12,6 +12,8 @@ #include #include +/* See rom/exec/copymem.c for documentation */ + #define SSE_REG_SIZE 16 #define SSE_REG_MASK 0xF @@ -59,48 +61,12 @@ D(bug("[Exec] __long_memcpy(%p, %p, %ld)\n", src, dst, size)); } } -/***************************************************************************** - - NAME */ - - AROS_LH3I(void, CopyMem, - -/* SYNOPSIS */ - AROS_LHA(CONST_APTR, source, A0), - AROS_LHA(APTR, dest, A1), - AROS_LHA(IPTR, size, D0), - -/* LOCATION */ - struct ExecBase *, SysBase, 104, Exec) - -/* FUNCTION - Copy some data from one location to another in memory using - SSE optimised copying method if enough data. - - INPUTS - source - Pointer to source area - dest - Pointer to destination - size - number of bytes to copy - - RESULT - - NOTES - The source and destination area are not allowed to overlap. - If the src isn't on a 16-byte boundary, it is aligned - first (so long as there's enough data) - Copies using 4x16-byte registers = 64 bytes at a time. - - EXAMPLE - - BUGS - - SEE ALSO - CopyMemQuick() - - INTERNALS - 64-bit sizes are not handled yet. -******************************************************************************/ +AROS_LH3I(void, CopyMem, + AROS_LHA(CONST_APTR, source, A0), + AROS_LHA(APTR, dest, A1), + AROS_LHA(IPTR, size, D0), + struct ExecBase *, SysBase, 104, Exec) { AROS_LIBFUNC_INIT