Changeset 4f5dc18 in mainline for kernel/generic


Ignore:
Timestamp:
2009-11-03T21:36:54Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1647323
Parents:
bbddafb (diff), b1c21c2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge with mainline.

Location:
kernel/generic
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/context.h

    rbbddafb r4f5dc18  
    5151/** Save register context.
    5252 *
    53  * Save current register context (including stack pointers)
    54  * to context structure.
    55  *
    56  * Note that call to context_restore() will return at the same
     53 * Save the current register context (including stack pointer) to a context
     54 * structure. A subsequent call to context_restore() will return to the same
    5755 * address as the corresponding call to context_save().
    5856 *
    59  * This MUST be a macro, gcc -O0 does not inline functions even
    60  * if they are marked inline and context_save_arch must be called
    61  * from level <= that when context_restore is called.
     57 * Note that context_save_arch() must reuse the stack frame of the function
     58 * which called context_save(). We guarantee this by:
    6259 *
    63  * @param c Context structure.
     60 *   a) implementing context_save_arch() in assembly so that it does not create
     61 *      its own stack frame, and by
     62 *   b) defining context_save() as a macro because the inline keyword is just a
     63 *      hint for the compiler, not a real constraint; the application of a macro
     64 *      will definitely not create a stack frame either.
    6465 *
    65  * @return context_save() returns 1, context_restore() returns 0.
     66 * To imagine what could happen if there were some extra stack frames created
     67 * either by context_save() or context_save_arch(), we need to realize that the
     68 * sp saved in the contex_t structure points to the current stack frame as it
     69 * existed when context_save_arch() was executing. After the return from
     70 * context_save_arch() and context_save(), any extra stack frames created by
     71 * these functions will be destroyed and their contents sooner or later
     72 * overwritten by functions called next. Any attempt to restore to a context
     73 * saved like that would therefore lead to a disaster.
     74 *
     75 * @param c             Context structure.
     76 *
     77 * @return              context_save() returns 1, context_restore() returns 0.
    6678 */
    6779#define context_save(c)   context_save_arch(c)
     
    6981/** Restore register context.
    7082 *
    71  * Restore previously saved register context (including stack pointers)
    72  * from context structure.
     83 * Restore a previously saved register context (including stack pointer) from
     84 * a context structure.
    7385 *
    74  * Note that this function does not normally return.
    75  * Instead, it returns at the same address as the
    76  * corresponding call to context_save(), the only
    77  * difference being return value.
     86 * Note that this function does not normally return.  Instead, it returns to the
     87 * same address as the corresponding call to context_save(), the only difference
     88 * being return value.
    7889 *
    79  * @param c Context structure.
     90 * @param c             Context structure.
    8091 */
    8192static inline void context_restore(context_t *c)
  • kernel/generic/include/print.h

    rbbddafb r4f5dc18  
    3737
    3838#include <arch/types.h>
    39 #include <arch/arg.h>
     39#include <stdarg.h>
    4040
    4141#define EOF (-1)
  • kernel/generic/include/printf/printf_core.h

    rbbddafb r4f5dc18  
    3737
    3838#include <typedefs.h>
    39 #include <arch/arg.h>
     39#include <stdarg.h>
    4040
    4141/** Structure for specifying output methods for different printf clones. */
  • kernel/generic/include/stdarg.h

    rbbddafb r4f5dc18  
    2727 */
    2828
    29 /** @addtogroup generic 
     29/** @addtogroup generic
    3030 * @{
    3131 */
     
    3737 * for all architectures with compiler support for __builtin_va_*.
    3838 */
    39  
     39
    4040#ifndef KERN_STDARG_H_
    4141#define KERN_STDARG_H_
     
    4343typedef __builtin_va_list va_list;
    4444
    45 #define va_start(ap, last)              __builtin_va_start(ap, last)
    46 #define va_arg(ap, type)                __builtin_va_arg(ap, type)
    47 #define va_end(ap)                      __builtin_va_end(ap)
    48 #define va_copy(dst, src)               __builtin_va_copy(dst, src)
     45#define va_start(ap, last)  __builtin_va_start(ap, last)
     46#define va_arg(ap, type)    __builtin_va_arg(ap, type)
     47#define va_end(ap)          __builtin_va_end(ap)
     48#define va_copy(dst, src)   __builtin_va_copy(dst, src)
    4949
    5050#endif
  • kernel/generic/src/console/cmd.c

    rbbddafb r4f5dc18  
    409409};
    410410
     411/* Data and methods for 'kill' command */
     412static int cmd_kill(cmd_arg_t *argv);
     413static cmd_arg_t kill_argv = {
     414        .type = ARG_TYPE_INT,
     415};
     416static cmd_info_t kill_info = {
     417        .name = "kill",
     418        .description = "kill <taskid> Kill a task.",
     419        .func = cmd_kill,
     420        .argc = 1,
     421        .argv = &kill_argv
     422};
     423
    411424/* Data and methods for 'zone' command */
    412425static int cmd_zone(cmd_arg_t *argv);
     
    459472        &help_info,
    460473        &ipc_info,
     474        &kill_info,
    461475        &set4_info,
    462476        &slabs_info,
     
    848862 * @return Always 1
    849863 */
    850 int cmd_slabs(cmd_arg_t * argv) {
     864int cmd_slabs(cmd_arg_t * argv)
     865{
    851866        slab_print_list();
    852867        return 1;
     
    860875 * @return Always 1
    861876 */
    862 int cmd_threads(cmd_arg_t * argv) {
     877int cmd_threads(cmd_arg_t * argv)
     878{
    863879        thread_print_list();
    864880        return 1;
     
    871887 * @return Always 1
    872888 */
    873 int cmd_tasks(cmd_arg_t * argv) {
     889int cmd_tasks(cmd_arg_t * argv)
     890{
    874891        task_print_list();
    875892        return 1;
     
    882899 * @return Always 1
    883900 */
    884 int cmd_sched(cmd_arg_t * argv) {
     901int cmd_sched(cmd_arg_t * argv)
     902{
    885903        sched_print_list();
    886904        return 1;
     
    893911 * return Always 1
    894912 */
    895 int cmd_zones(cmd_arg_t * argv) {
     913int cmd_zones(cmd_arg_t * argv)
     914{
    896915        zone_print_list();
    897916        return 1;
     
    904923 * return Always 1
    905924 */
    906 int cmd_zone(cmd_arg_t * argv) {
     925int cmd_zone(cmd_arg_t * argv)
     926{
    907927        zone_print_one(argv[0].intval);
    908928        return 1;
     
    915935 * return Always 1
    916936 */
    917 int cmd_ipc(cmd_arg_t * argv) {
     937int cmd_ipc(cmd_arg_t * argv)
     938{
    918939        ipc_print_task(argv[0].intval);
    919940        return 1;
    920941}
    921942
     943/** Command for killing a task
     944 *
     945 * @param argv Integer argument from cmdline expected
     946 *
     947 * return 0 on failure, 1 on success.
     948 */
     949int cmd_kill(cmd_arg_t * argv)
     950{
     951        if (task_kill(argv[0].intval) != EOK)
     952                return 0;
     953
     954        return 1;
     955}
    922956
    923957/** Command for listing processors.
  • kernel/generic/src/ipc/kbox.c

    rbbddafb r4f5dc18  
    137137                /* Only detach kbox thread unless already terminating. */
    138138                mutex_lock(&TASK->kb.cleanup_lock);
    139                 if (&TASK->kb.finished == false) {
     139                if (TASK->kb.finished == false) {
    140140                        /* Detach kbox thread so it gets freed from memory. */
    141141                        thread_detach(TASK->kb.thread);
  • kernel/generic/src/printf/printf_core.c

    rbbddafb r4f5dc18  
    3939#include <printf/printf_core.h>
    4040#include <print.h>
    41 #include <arch/arg.h>
     41#include <stdarg.h>
    4242#include <macros.h>
    4343#include <string.h>
Note: See TracChangeset for help on using the changeset viewer.