delete unnecessary #include lines
This commit is contained in:
		
							parent
							
								
									99b11b6c64
								
							
						
					
					
						commit
						558ab49f13
					
				
					 27 changed files with 73 additions and 90 deletions
				
			
		| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "x86.h"
 | 
					 | 
				
			||||||
#include "defs.h"
 | 
					#include "defs.h"
 | 
				
			||||||
#include "traps.h"
 | 
					#include "traps.h"
 | 
				
			||||||
 | 
					#include "x86.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Register definitions for the Intel
 | 
					// Register definitions for the Intel
 | 
				
			||||||
// 8253/8254/82C54 Programmable Interval Timer (PIT).
 | 
					// 8253/8254/82C54 Programmable Interval Timer (PIT).
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										5
									
								
								bio.c
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								bio.c
									
										
									
									
									
								
							| 
						 | 
					@ -22,11 +22,8 @@
 | 
				
			||||||
//     and needs to be written to disk.
 | 
					//     and needs to be written to disk.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "param.h"
 | 
					 | 
				
			||||||
#include "x86.h"
 | 
					 | 
				
			||||||
#include "mmu.h"
 | 
					 | 
				
			||||||
#include "proc.h"
 | 
					 | 
				
			||||||
#include "defs.h"
 | 
					#include "defs.h"
 | 
				
			||||||
 | 
					#include "param.h"
 | 
				
			||||||
#include "spinlock.h"
 | 
					#include "spinlock.h"
 | 
				
			||||||
#include "buf.h"
 | 
					#include "buf.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,12 +1,12 @@
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "x86.h"
 | 
					 | 
				
			||||||
#include "traps.h"
 | 
					 | 
				
			||||||
#include "defs.h"
 | 
					#include "defs.h"
 | 
				
			||||||
 | 
					#include "param.h"
 | 
				
			||||||
 | 
					#include "traps.h"
 | 
				
			||||||
#include "spinlock.h"
 | 
					#include "spinlock.h"
 | 
				
			||||||
#include "dev.h"
 | 
					#include "dev.h"
 | 
				
			||||||
#include "param.h"
 | 
					 | 
				
			||||||
#include "mmu.h"
 | 
					#include "mmu.h"
 | 
				
			||||||
#include "proc.h"
 | 
					#include "proc.h"
 | 
				
			||||||
 | 
					#include "x86.h"
 | 
				
			||||||
#include "kbd.h"
 | 
					#include "kbd.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define CRTPORT 0x3d4
 | 
					#define CRTPORT 0x3d4
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										48
									
								
								cuth
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										48
									
								
								cuth
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -0,0 +1,48 @@
 | 
				
			||||||
 | 
					#!/usr/bin/perl
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$| = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub writefile($@){
 | 
				
			||||||
 | 
						my ($file, @lines) = @_;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						sleep(1);
 | 
				
			||||||
 | 
						open(F, ">$file") || die "open >$file: $!";
 | 
				
			||||||
 | 
						print F @lines;
 | 
				
			||||||
 | 
						close(F);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Cut out #include lines that don't contribute anything.
 | 
				
			||||||
 | 
					for($i=0; $i<@ARGV; $i++){
 | 
				
			||||||
 | 
						$file = $ARGV[$i];
 | 
				
			||||||
 | 
						if(!open(F, $file)){
 | 
				
			||||||
 | 
							print STDERR "open $file: $!\n";
 | 
				
			||||||
 | 
							next;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						@lines = <F>;
 | 
				
			||||||
 | 
						close(F);
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						$obj = "$file.o";
 | 
				
			||||||
 | 
						$obj =~ s/\.c\.o$/.o/;
 | 
				
			||||||
 | 
						system("touch $file");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if(system("make CC='gcc -Werror' $obj >/dev/null 2>\&1") != 0){
 | 
				
			||||||
 | 
							print STDERR "make $obj failed: $rv\n";
 | 
				
			||||||
 | 
							next;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						system("cp $file =$file");
 | 
				
			||||||
 | 
						for($j=@lines-1; $j>=0; $j--){
 | 
				
			||||||
 | 
							if($lines[$j] =~ /^#include/){
 | 
				
			||||||
 | 
								$old = $lines[$j];
 | 
				
			||||||
 | 
								$lines[$j] = "/* CUT-H */\n";
 | 
				
			||||||
 | 
								writefile($file, @lines);
 | 
				
			||||||
 | 
								if(system("make CC='gcc -Werror' $obj >/dev/null 2>\&1") != 0){
 | 
				
			||||||
 | 
									$lines[$j] = $old;
 | 
				
			||||||
 | 
								}else{
 | 
				
			||||||
 | 
									print STDERR "$file $old";
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						writefile($file, grep {!/CUT-H/} @lines);
 | 
				
			||||||
 | 
						system("rm =$file");
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										1
									
								
								exec.c
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								exec.c
									
										
									
									
									
								
							| 
						 | 
					@ -4,7 +4,6 @@
 | 
				
			||||||
#include "proc.h"
 | 
					#include "proc.h"
 | 
				
			||||||
#include "defs.h"
 | 
					#include "defs.h"
 | 
				
			||||||
#include "x86.h"
 | 
					#include "x86.h"
 | 
				
			||||||
#include "fs.h"
 | 
					 | 
				
			||||||
#include "elf.h"
 | 
					#include "elf.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										8
									
								
								file.c
									
										
									
									
									
								
							
							
						
						
									
										8
									
								
								file.c
									
										
									
									
									
								
							| 
						 | 
					@ -1,15 +1,9 @@
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "stat.h"
 | 
					 | 
				
			||||||
#include "param.h"
 | 
					 | 
				
			||||||
#include "x86.h"
 | 
					 | 
				
			||||||
#include "mmu.h"
 | 
					 | 
				
			||||||
#include "proc.h"
 | 
					 | 
				
			||||||
#include "defs.h"
 | 
					#include "defs.h"
 | 
				
			||||||
 | 
					#include "param.h"
 | 
				
			||||||
#include "file.h"
 | 
					#include "file.h"
 | 
				
			||||||
#include "spinlock.h"
 | 
					#include "spinlock.h"
 | 
				
			||||||
#include "dev.h"
 | 
					#include "dev.h"
 | 
				
			||||||
#include "fs.h"
 | 
					 | 
				
			||||||
#include "fsvar.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct devsw devsw[NDEV];
 | 
					struct devsw devsw[NDEV];
 | 
				
			||||||
struct spinlock file_table_lock;
 | 
					struct spinlock file_table_lock;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										5
									
								
								fs.c
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								fs.c
									
										
									
									
									
								
							| 
						 | 
					@ -11,12 +11,11 @@
 | 
				
			||||||
// are in sysfile.c.
 | 
					// are in sysfile.c.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "stat.h"
 | 
					#include "defs.h"
 | 
				
			||||||
#include "param.h"
 | 
					#include "param.h"
 | 
				
			||||||
#include "x86.h"
 | 
					#include "stat.h"
 | 
				
			||||||
#include "mmu.h"
 | 
					#include "mmu.h"
 | 
				
			||||||
#include "proc.h"
 | 
					#include "proc.h"
 | 
				
			||||||
#include "defs.h"
 | 
					 | 
				
			||||||
#include "spinlock.h"
 | 
					#include "spinlock.h"
 | 
				
			||||||
#include "buf.h"
 | 
					#include "buf.h"
 | 
				
			||||||
#include "fs.h"
 | 
					#include "fs.h"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								ide.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								ide.c
									
										
									
									
									
								
							| 
						 | 
					@ -1,10 +1,10 @@
 | 
				
			||||||
// Simple PIO-based (non-DMA) IDE driver code.
 | 
					// Simple PIO-based (non-DMA) IDE driver code.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
 | 
					#include "defs.h"
 | 
				
			||||||
#include "param.h"
 | 
					#include "param.h"
 | 
				
			||||||
#include "mmu.h"
 | 
					#include "mmu.h"
 | 
				
			||||||
#include "proc.h"
 | 
					#include "proc.h"
 | 
				
			||||||
#include "defs.h"
 | 
					 | 
				
			||||||
#include "x86.h"
 | 
					#include "x86.h"
 | 
				
			||||||
#include "traps.h"
 | 
					#include "traps.h"
 | 
				
			||||||
#include "spinlock.h"
 | 
					#include "spinlock.h"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										1
									
								
								init.c
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								init.c
									
										
									
									
									
								
							| 
						 | 
					@ -1,7 +1,6 @@
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "stat.h"
 | 
					#include "stat.h"
 | 
				
			||||||
#include "user.h"
 | 
					#include "user.h"
 | 
				
			||||||
#include "fs.h"
 | 
					 | 
				
			||||||
#include "fcntl.h"
 | 
					#include "fcntl.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// init: The initial user-level program
 | 
					// init: The initial user-level program
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								ioapic.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								ioapic.c
									
										
									
									
									
								
							| 
						 | 
					@ -2,9 +2,7 @@
 | 
				
			||||||
// http://www.intel.com/design/chipsets/datashts/29056601.pdf
 | 
					// http://www.intel.com/design/chipsets/datashts/29056601.pdf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "mp.h"
 | 
					 | 
				
			||||||
#include "defs.h"
 | 
					#include "defs.h"
 | 
				
			||||||
#include "x86.h"
 | 
					 | 
				
			||||||
#include "traps.h"
 | 
					#include "traps.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define IOAPIC  0xFEC00000   // Default physical address of IO APIC
 | 
					#define IOAPIC  0xFEC00000   // Default physical address of IO APIC
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										3
									
								
								kalloc.c
									
										
									
									
									
								
							
							
						
						
									
										3
									
								
								kalloc.c
									
										
									
									
									
								
							| 
						 | 
					@ -5,12 +5,9 @@
 | 
				
			||||||
// One reason the page size is 4k is that the x86 segment size
 | 
					// One reason the page size is 4k is that the x86 segment size
 | 
				
			||||||
// granularity is 4k.
 | 
					// granularity is 4k.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "param.h"
 | 
					 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "defs.h"
 | 
					#include "defs.h"
 | 
				
			||||||
#include "param.h"
 | 
					#include "param.h"
 | 
				
			||||||
#include "mmu.h"
 | 
					 | 
				
			||||||
#include "proc.h"
 | 
					 | 
				
			||||||
#include "spinlock.h"
 | 
					#include "spinlock.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct spinlock kalloc_lock;
 | 
					struct spinlock kalloc_lock;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										5
									
								
								lapic.c
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								lapic.c
									
										
									
									
									
								
							| 
						 | 
					@ -2,12 +2,7 @@
 | 
				
			||||||
// See Chapter 8 & Appendix C of Intel processor manual volume 3.
 | 
					// See Chapter 8 & Appendix C of Intel processor manual volume 3.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "defs.h"
 | 
					 | 
				
			||||||
#include "param.h"
 | 
					 | 
				
			||||||
#include "x86.h"
 | 
					 | 
				
			||||||
#include "traps.h"
 | 
					#include "traps.h"
 | 
				
			||||||
#include "mmu.h"
 | 
					 | 
				
			||||||
#include "proc.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Local APIC registers, divided by 4 for use as uint[] indices.
 | 
					// Local APIC registers, divided by 4 for use as uint[] indices.
 | 
				
			||||||
#define ID      (0x0020/4)   // ID
 | 
					#define ID      (0x0020/4)   // ID
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										14
									
								
								main.c
									
										
									
									
									
								
							
							
						
						
									
										14
									
								
								main.c
									
										
									
									
									
								
							| 
						 | 
					@ -1,23 +1,15 @@
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
 | 
					#include "defs.h"
 | 
				
			||||||
#include "param.h"
 | 
					#include "param.h"
 | 
				
			||||||
#include "mmu.h"
 | 
					#include "mmu.h"
 | 
				
			||||||
#include "proc.h"
 | 
					#include "proc.h"
 | 
				
			||||||
#include "defs.h"
 | 
					 | 
				
			||||||
#include "x86.h"
 | 
					#include "x86.h"
 | 
				
			||||||
#include "traps.h"
 | 
					 | 
				
			||||||
#include "syscall.h"
 | 
					 | 
				
			||||||
#include "elf.h"
 | 
					 | 
				
			||||||
#include "param.h"
 | 
					 | 
				
			||||||
#include "spinlock.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern char edata[], end[];
 | 
					extern char edata[], end[];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void bootothers(void);
 | 
					void bootothers(void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Bootstrap processor starts running C code here.
 | 
					// Bootstrap processor starts running C code here.
 | 
				
			||||||
// This is called main0 not main so that it can have
 | 
					 | 
				
			||||||
// a void return type.  Gcc can't handle functions named
 | 
					 | 
				
			||||||
// main that don't return int.  Really.
 | 
					 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
main0(void)
 | 
					main0(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -39,7 +31,7 @@ main0(void)
 | 
				
			||||||
  asm volatile("movl %0, %%ebp" : : "r" (cpus[bcpu].mpstack+MPSTACK));
 | 
					  asm volatile("movl %0, %%ebp" : : "r" (cpus[bcpu].mpstack+MPSTACK));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  lapic_init(bcpu);
 | 
					  lapic_init(bcpu);
 | 
				
			||||||
  cprintf("\\ncpu%d: starting xv6\\n\\n", cpu());
 | 
					  cprintf("\ncpu%d: starting xv6\n\n", cpu());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  pinit();         // process table
 | 
					  pinit();         // process table
 | 
				
			||||||
  binit();         // buffer cache
 | 
					  binit();         // buffer cache
 | 
				
			||||||
| 
						 | 
					@ -69,7 +61,7 @@ main0(void)
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
mpmain(void)
 | 
					mpmain(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  cprintf("cpu%d: starting\\n", cpu());
 | 
					  cprintf("cpu%d: starting\n", cpu());
 | 
				
			||||||
  idtinit();
 | 
					  idtinit();
 | 
				
			||||||
  lapic_init(cpu());
 | 
					  lapic_init(cpu());
 | 
				
			||||||
  setupsegs(0);
 | 
					  setupsegs(0);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										3
									
								
								mkfs.c
									
										
									
									
									
								
							
							
						
						
									
										3
									
								
								mkfs.c
									
										
									
									
									
								
							| 
						 | 
					@ -5,7 +5,6 @@
 | 
				
			||||||
#include <fcntl.h>
 | 
					#include <fcntl.h>
 | 
				
			||||||
#include <assert.h>
 | 
					#include <assert.h>
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "param.h"
 | 
					 | 
				
			||||||
#include "fs.h"
 | 
					#include "fs.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int nblocks = 995;
 | 
					int nblocks = 995;
 | 
				
			||||||
| 
						 | 
					@ -55,7 +54,7 @@ int
 | 
				
			||||||
main(int argc, char *argv[])
 | 
					main(int argc, char *argv[])
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  int i, cc, fd;
 | 
					  int i, cc, fd;
 | 
				
			||||||
  uint bn, rootino, inum, off;
 | 
					  uint rootino, inum, off;
 | 
				
			||||||
  struct dirent de;
 | 
					  struct dirent de;
 | 
				
			||||||
  char buf[512];
 | 
					  char buf[512];
 | 
				
			||||||
  struct dinode din;
 | 
					  struct dinode din;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										3
									
								
								mp.c
									
										
									
									
									
								
							
							
						
						
									
										3
									
								
								mp.c
									
										
									
									
									
								
							| 
						 | 
					@ -1,11 +1,10 @@
 | 
				
			||||||
// http://developer.intel.com/design/pentium/datashts/24201606.pdf
 | 
					// http://developer.intel.com/design/pentium/datashts/24201606.pdf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "mp.h"
 | 
					 | 
				
			||||||
#include "defs.h"
 | 
					#include "defs.h"
 | 
				
			||||||
#include "param.h"
 | 
					#include "param.h"
 | 
				
			||||||
 | 
					#include "mp.h"
 | 
				
			||||||
#include "x86.h"
 | 
					#include "x86.h"
 | 
				
			||||||
#include "traps.h"
 | 
					 | 
				
			||||||
#include "mmu.h"
 | 
					#include "mmu.h"
 | 
				
			||||||
#include "proc.h"
 | 
					#include "proc.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										1
									
								
								picirq.c
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								picirq.c
									
										
									
									
									
								
							| 
						 | 
					@ -1,7 +1,6 @@
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "x86.h"
 | 
					#include "x86.h"
 | 
				
			||||||
#include "traps.h"
 | 
					#include "traps.h"
 | 
				
			||||||
#include "defs.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// I/O Addresses of the two 8259A programmable interrupt controllers
 | 
					// I/O Addresses of the two 8259A programmable interrupt controllers
 | 
				
			||||||
#define IO_PIC1         0x20    // Master (IRQs 0-7)
 | 
					#define IO_PIC1         0x20    // Master (IRQs 0-7)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										3
									
								
								pipe.c
									
										
									
									
									
								
							
							
						
						
									
										3
									
								
								pipe.c
									
										
									
									
									
								
							| 
						 | 
					@ -1,9 +1,8 @@
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
 | 
					#include "defs.h"
 | 
				
			||||||
#include "param.h"
 | 
					#include "param.h"
 | 
				
			||||||
#include "x86.h"
 | 
					 | 
				
			||||||
#include "mmu.h"
 | 
					#include "mmu.h"
 | 
				
			||||||
#include "proc.h"
 | 
					#include "proc.h"
 | 
				
			||||||
#include "defs.h"
 | 
					 | 
				
			||||||
#include "file.h"
 | 
					#include "file.h"
 | 
				
			||||||
#include "spinlock.h"
 | 
					#include "spinlock.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										5
									
								
								proc.c
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								proc.c
									
										
									
									
									
								
							| 
						 | 
					@ -1,10 +1,9 @@
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
 | 
					#include "defs.h"
 | 
				
			||||||
 | 
					#include "param.h"
 | 
				
			||||||
#include "mmu.h"
 | 
					#include "mmu.h"
 | 
				
			||||||
#include "x86.h"
 | 
					#include "x86.h"
 | 
				
			||||||
#include "param.h"
 | 
					 | 
				
			||||||
#include "file.h"
 | 
					 | 
				
			||||||
#include "proc.h"
 | 
					#include "proc.h"
 | 
				
			||||||
#include "defs.h"
 | 
					 | 
				
			||||||
#include "spinlock.h"
 | 
					#include "spinlock.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct spinlock proc_table_lock;
 | 
					struct spinlock proc_table_lock;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										1
									
								
								sh.c
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								sh.c
									
										
									
									
									
								
							| 
						 | 
					@ -1,7 +1,6 @@
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "stat.h"
 | 
					#include "stat.h"
 | 
				
			||||||
#include "user.h"
 | 
					#include "user.h"
 | 
				
			||||||
#include "fs.h"
 | 
					 | 
				
			||||||
#include "fcntl.h"
 | 
					#include "fcntl.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define BUFSIZ  512
 | 
					#define BUFSIZ  512
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,9 +2,9 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "defs.h"
 | 
					#include "defs.h"
 | 
				
			||||||
 | 
					#include "param.h"
 | 
				
			||||||
#include "x86.h"
 | 
					#include "x86.h"
 | 
				
			||||||
#include "mmu.h"
 | 
					#include "mmu.h"
 | 
				
			||||||
#include "param.h"
 | 
					 | 
				
			||||||
#include "proc.h"
 | 
					#include "proc.h"
 | 
				
			||||||
#include "spinlock.h"
 | 
					#include "spinlock.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										1
									
								
								string.c
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								string.c
									
										
									
									
									
								
							| 
						 | 
					@ -1,5 +1,4 @@
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "defs.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
void*
 | 
					void*
 | 
				
			||||||
memset(void *dst, int c, uint n)
 | 
					memset(void *dst, int c, uint n)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										11
									
								
								syscall.c
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								syscall.c
									
										
									
									
									
								
							| 
						 | 
					@ -1,19 +1,10 @@
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "stat.h"
 | 
					#include "defs.h"
 | 
				
			||||||
#include "param.h"
 | 
					#include "param.h"
 | 
				
			||||||
#include "mmu.h"
 | 
					#include "mmu.h"
 | 
				
			||||||
#include "proc.h"
 | 
					#include "proc.h"
 | 
				
			||||||
#include "defs.h"
 | 
					 | 
				
			||||||
#include "x86.h"
 | 
					#include "x86.h"
 | 
				
			||||||
#include "traps.h"
 | 
					 | 
				
			||||||
#include "syscall.h"
 | 
					#include "syscall.h"
 | 
				
			||||||
#include "spinlock.h"
 | 
					 | 
				
			||||||
#include "buf.h"
 | 
					 | 
				
			||||||
#include "fs.h"
 | 
					 | 
				
			||||||
#include "fsvar.h"
 | 
					 | 
				
			||||||
#include "elf.h"
 | 
					 | 
				
			||||||
#include "file.h"
 | 
					 | 
				
			||||||
#include "fcntl.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// User code makes a system call with INT T_SYSCALL.
 | 
					// User code makes a system call with INT T_SYSCALL.
 | 
				
			||||||
// System call number in %eax.
 | 
					// System call number in %eax.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,14 +1,9 @@
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "stat.h"
 | 
					#include "defs.h"
 | 
				
			||||||
#include "param.h"
 | 
					#include "param.h"
 | 
				
			||||||
 | 
					#include "stat.h"
 | 
				
			||||||
#include "mmu.h"
 | 
					#include "mmu.h"
 | 
				
			||||||
#include "proc.h"
 | 
					#include "proc.h"
 | 
				
			||||||
#include "defs.h"
 | 
					 | 
				
			||||||
#include "x86.h"
 | 
					 | 
				
			||||||
#include "traps.h"
 | 
					 | 
				
			||||||
#include "syscall.h"
 | 
					 | 
				
			||||||
#include "spinlock.h"
 | 
					 | 
				
			||||||
#include "buf.h"
 | 
					 | 
				
			||||||
#include "fs.h"
 | 
					#include "fs.h"
 | 
				
			||||||
#include "fsvar.h"
 | 
					#include "fsvar.h"
 | 
				
			||||||
#include "file.h"
 | 
					#include "file.h"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										13
									
								
								sysproc.c
									
										
									
									
									
								
							
							
						
						
									
										13
									
								
								sysproc.c
									
										
									
									
									
								
							| 
						 | 
					@ -1,19 +1,8 @@
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
#include "stat.h"
 | 
					#include "defs.h"
 | 
				
			||||||
#include "param.h"
 | 
					#include "param.h"
 | 
				
			||||||
#include "mmu.h"
 | 
					#include "mmu.h"
 | 
				
			||||||
#include "proc.h"
 | 
					#include "proc.h"
 | 
				
			||||||
#include "defs.h"
 | 
					 | 
				
			||||||
#include "x86.h"
 | 
					 | 
				
			||||||
#include "traps.h"
 | 
					 | 
				
			||||||
#include "syscall.h"
 | 
					 | 
				
			||||||
#include "spinlock.h"
 | 
					 | 
				
			||||||
#include "buf.h"
 | 
					 | 
				
			||||||
#include "fs.h"
 | 
					 | 
				
			||||||
#include "fsvar.h"
 | 
					 | 
				
			||||||
#include "elf.h"
 | 
					 | 
				
			||||||
#include "file.h"
 | 
					 | 
				
			||||||
#include "fcntl.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
sys_fork(void)
 | 
					sys_fork(void)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										3
									
								
								trap.c
									
										
									
									
									
								
							
							
						
						
									
										3
									
								
								trap.c
									
										
									
									
									
								
							| 
						 | 
					@ -1,11 +1,10 @@
 | 
				
			||||||
#include "types.h"
 | 
					#include "types.h"
 | 
				
			||||||
 | 
					#include "defs.h"
 | 
				
			||||||
#include "param.h"
 | 
					#include "param.h"
 | 
				
			||||||
#include "mmu.h"
 | 
					#include "mmu.h"
 | 
				
			||||||
#include "proc.h"
 | 
					#include "proc.h"
 | 
				
			||||||
#include "defs.h"
 | 
					 | 
				
			||||||
#include "x86.h"
 | 
					#include "x86.h"
 | 
				
			||||||
#include "traps.h"
 | 
					#include "traps.h"
 | 
				
			||||||
#include "syscall.h"
 | 
					 | 
				
			||||||
#include "spinlock.h"
 | 
					#include "spinlock.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Interrupt descriptor table (shared by all CPUs).
 | 
					// Interrupt descriptor table (shared by all CPUs).
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,8 +3,8 @@
 | 
				
			||||||
#include "user.h"
 | 
					#include "user.h"
 | 
				
			||||||
#include "param.h"
 | 
					#include "param.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Memory allocator by Kernighan and Ritchie, The C programming Language,
 | 
					// Memory allocator by Kernighan and Ritchie,
 | 
				
			||||||
// 2nd ed.  Section 8.7.
 | 
					// The C programming Language, 2nd ed.  Section 8.7.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef long Align;
 | 
					typedef long Align;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								zombie.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								zombie.c
									
										
									
									
									
								
							| 
						 | 
					@ -8,8 +8,6 @@
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
main(void)
 | 
					main(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  int i;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  if(fork() > 0)
 | 
					  if(fork() > 0)
 | 
				
			||||||
    sleep(5);  // Let child exit before parent.
 | 
					    sleep(5);  // Let child exit before parent.
 | 
				
			||||||
  exit();
 | 
					  exit();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue