root/arch/sparc/kernel/process.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. ret_from_sys_call
  2. sys_idle
  3. start_thread
  4. exit_thread
  5. flush_thread
  6. copy_thread
  7. dump_thread
  8. sys_execve

   1 /*
   2  *  linux/arch/i386/kernel/process.c
   3  *
   4  *  Copyright (C) 1995  Linus Torvalds
   5  */
   6 
   7 /*
   8  * This file handles the architecture-dependent parts of process handling..
   9  */
  10 
  11 #include <linux/errno.h>
  12 #include <linux/sched.h>
  13 #include <linux/kernel.h>
  14 #include <linux/mm.h>
  15 #include <linux/stddef.h>
  16 #include <linux/unistd.h>
  17 #include <linux/ptrace.h>
  18 #include <linux/malloc.h>
  19 #include <linux/ldt.h>
  20 #include <linux/user.h>
  21 #include <linux/a.out.h>
  22 
  23 #include <asm/segment.h>
  24 #include <asm/system.h>
  25 
  26 void ret_from_sys_call(void) { __asm__("nop"); }
     /* [previous][next][first][last][top][bottom][index][help] */
  27 
  28 /*
  29  * The idle loop on a i386..
  30  */
  31 asmlinkage int sys_idle(void)
     /* [previous][next][first][last][top][bottom][index][help] */
  32 {
  33         int i;
  34 
  35         if (current->pid != 0)
  36                 return -EPERM;
  37 
  38         /* Map out the low memory: it's no longer needed */
  39         /* Sparc version RSN */
  40 
  41         /* endless idle loop with no priority at all */
  42         current->counter = -100;
  43         for (;;) {
  44                 if (!need_resched)
  45                         __asm__("nop");
  46                 schedule();
  47         }
  48 }
  49 
  50 /*
  51  * Do necessary setup to start up a newly executed thread.
  52  */
  53 void start_thread(struct pt_regs * regs, unsigned long sp, unsigned long fp)
     /* [previous][next][first][last][top][bottom][index][help] */
  54 {
  55         regs->sp = sp;
  56         regs->fp = fp;
  57         regs->psr = psr;
  58 }
  59 
  60 /*
  61  * Free current thread data structures etc..
  62  */
  63 void exit_thread(void)
     /* [previous][next][first][last][top][bottom][index][help] */
  64 {
  65   return; /* i'm getting to it */
  66 }
  67 
  68 void flush_thread(void)
     /* [previous][next][first][last][top][bottom][index][help] */
  69 {
  70   return;
  71 }
  72 
  73 unsigned long copy_thread(int nr, unsigned long clone_flags, struct task_struct * p, struct pt_regs * regs)
     /* [previous][next][first][last][top][bottom][index][help] */
  74 {
  75         struct pt_regs * childregs;
  76 
  77         childregs = ((struct pt_regs *) (p->kernel_stack_page + PAGE_SIZE)) - 1;
  78         p->tss.sp = (unsigned long) childregs;
  79         *childregs = *regs;
  80         p->tss.back_link = 0;
  81         p->tss.psr = regs->psr; /* for condition codes */
  82         return clone_flags;
  83 }
  84 
  85 /*
  86  * fill in the user structure for a core dump..
  87  */
  88 void dump_thread(struct pt_regs * regs, struct user * dump)
     /* [previous][next][first][last][top][bottom][index][help] */
  89 {
  90   return; /* solaris does this enough */
  91 }
  92 
  93 /*
  94  * sys_execve() executes a new program.
  95  */
  96 asmlinkage int sys_execve(struct pt_regs regs)
     /* [previous][next][first][last][top][bottom][index][help] */
  97 {
  98         int error;
  99         char * filename;
 100 
 101         error = do_execve(filename, (char **) regs.reg_window[0], 
 102                           (char **) regs.reg_window[1], &regs);
 103         putname(filename);
 104         return error;
 105 }

/* [previous][next][first][last][top][bottom][index][help] */