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. hard_reset_now
  4. show_regs
  5. start_thread
  6. exit_thread
  7. flush_thread
  8. copy_thread
  9. dump_thread
  10. sys_fork
  11. 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         if (current->pid != 0)
  34                 return -EPERM;
  35 
  36         /* Map out the low memory: it's no longer needed */
  37         /* Sparc version RSN */
  38 
  39         /* endless idle loop with no priority at all */
  40         current->counter = -100;
  41         for (;;) {
  42                 schedule();
  43         }
  44 }
  45 
  46 void hard_reset_now(void)
     /* [previous][next][first][last][top][bottom][index][help] */
  47 {
  48         halt();
  49 }
  50 
  51 void show_regs(struct pt_regs * regs)
     /* [previous][next][first][last][top][bottom][index][help] */
  52 {
  53         printk("\nSP: %08lx PC: %08lx NPC: %08lx\n", regs->sp, regs->pc,
  54                regs->npc);
  55 }
  56 
  57 /*
  58  * Do necessary setup to start up a newly executed thread.
  59  */
  60 void start_thread(struct pt_regs * regs, unsigned long sp, unsigned long fp)
     /* [previous][next][first][last][top][bottom][index][help] */
  61 {
  62         regs->sp = sp;
  63         regs->fp = fp;
  64 }
  65 
  66 /*
  67  * Free current thread data structures etc..
  68  */
  69 void exit_thread(void)
     /* [previous][next][first][last][top][bottom][index][help] */
  70 {
  71   halt();
  72 }
  73 
  74 void flush_thread(void)
     /* [previous][next][first][last][top][bottom][index][help] */
  75 {
  76   halt();
  77 }
  78 
  79 void copy_thread(int nr, unsigned long clone_flags, unsigned long sp, struct task_struct * p, struct pt_regs * regs)
     /* [previous][next][first][last][top][bottom][index][help] */
  80 {
  81         struct pt_regs * childregs;
  82 
  83         childregs = ((struct pt_regs *) (p->kernel_stack_page + PAGE_SIZE)) - 1;
  84         p->tss.usp = (unsigned long) childregs;
  85         *childregs = *regs;
  86         childregs->sp = sp;
  87         p->tss.psr = regs->psr; /* for condition codes */
  88         return;
  89 }
  90 
  91 /*
  92  * fill in the user structure for a core dump..
  93  */
  94 void dump_thread(struct pt_regs * regs, struct user * dump)
     /* [previous][next][first][last][top][bottom][index][help] */
  95 {
  96   return; /* solaris does this enough */
  97 }
  98 
  99 asmlinkage int sys_fork(struct pt_regs regs)
     /* [previous][next][first][last][top][bottom][index][help] */
 100 {
 101         return do_fork(COPYVM | SIGCHLD, regs.sp, &regs);
 102 }
 103 
 104 /*
 105  * sys_execve() executes a new program.
 106  */
 107 asmlinkage int sys_execve(struct pt_regs regs)
     /* [previous][next][first][last][top][bottom][index][help] */
 108 {
 109   halt();
 110   return 0;
 111 }
 112 

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