This source file includes following definitions.
- bios32_init
 
- sparc_console_print
 
- prom_sync_me
 
- boot_flags_init
 
- setup_arch
 
- sys_ioperm
 
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   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 #include <linux/tty.h>
  23 
  24 #include <asm/segment.h>
  25 #include <asm/system.h>
  26 #include <asm/io.h>
  27 #include <asm/processor.h>
  28 #include <asm/oplib.h>    
  29 #include <asm/page.h>
  30 #include <asm/pgtable.h>
  31 #include <asm/traps.h>
  32 #include <asm/vaddrs.h>
  33 #include <asm/kdebug.h>
  34 
  35 extern unsigned long probe_devices(unsigned long);
  36 
  37 
  38 
  39 
  40 struct screen_info screen_info = {
  41         0, 0,                   
  42         { 0, 0, },              
  43         0,                      
  44         0,                      
  45         80,                     
  46         0,0,0,                  
  47         25                      
  48 };
  49 
  50 char wp_works_ok = 0;
  51 
  52 unsigned long bios32_init(unsigned long memory_start, unsigned long memory_end)
     
  53 {
  54         return memory_start;
  55 }
  56 
  57 
  58 
  59 
  60 
  61 
  62 void sparc_console_print(const char * p)
     
  63 {
  64   unsigned char c;
  65 
  66         while ((c = *(p++)) != 0)
  67           {
  68             if (c == '\n')
  69               prom_putchar('\r');
  70             prom_putchar(c);
  71           }
  72 
  73   return;
  74 
  75 }
  76 
  77 
  78 
  79 
  80 
  81 
  82 void prom_sync_me(void)
     
  83 {
  84         printk("PROM SYNC COMMAND...\n");
  85         show_free_areas();
  86         printk("Returning to prom\n");
  87         return;
  88 }
  89 
  90 unsigned int boot_flags;
  91 #define BOOTME_DEBUG  0x1
  92 #define BOOTME_SINGLE 0x2
  93 #define BOOTME_KGDB   0x3
  94 
  95 
  96 
  97 
  98 
  99 void
 100 boot_flags_init(char *commands)
     
 101 {
 102         int i;
 103         for(i=0; i<strlen(commands); i++)
 104                 if(commands[i]=='-')
 105                         switch(commands[i+1]) {
 106                         case 'd':
 107                                 boot_flags |= BOOTME_DEBUG;
 108                                 break;
 109                         case 's':
 110                                 boot_flags |= BOOTME_SINGLE;
 111                                 break;
 112                         case 'h':
 113                                 printk("boot_flags_init: Found halt flag, doing so now...\n");
 114                                 halt();
 115                                 break;
 116                         case 'k':
 117                                 printk("Found KGDB boot flag...\n");
 118                                 boot_flags |= BOOTME_KGDB;
 119                                 break;
 120                         default:
 121                                 printk("boot_flags_init: Unknown boot arg (-%c)\n",
 122                                        commands[i+1]);
 123                                 break;
 124                         };
 125 
 126         return;
 127 }
 128 
 129 
 130 
 131 
 132 
 133 
 134 
 135 extern void register_console(void (*proc)(const char *));
 136 extern void load_mmu(void);
 137 extern int prom_probe_memory(void);
 138 extern void probe_mmu(int node);
 139 extern void get_idprom(void);
 140 extern void srmmu_patch_fhandlers(void);
 141 extern unsigned int prom_iface_vers, end_of_phys_memory, phys_bytes_of_ram;
 142 extern char cputypval;
 143 extern unsigned long start;
 144 char sparc_command_line[256];  
 145 enum sparc_cpu sparc_cpu_model;
 146 
 147 struct tt_entry *sparc_ttable;
 148 
 149 
 150 
 151 void setup_arch(char **cmdline_p,
     
 152         unsigned long * memory_start_p, unsigned long * memory_end_p)
 153 {
 154         int counter, total, i, node;
 155         char devtype[64];
 156 
 157         sparc_ttable = (struct tt_entry *) &start;
 158 
 159         register_console(sparc_console_print);
 160 
 161         
 162         *cmdline_p = prom_getbootargs();
 163         boot_flags_init(*cmdline_p);
 164 
 165         
 166 
 167 
 168         if((boot_flags&BOOTME_DEBUG) && (linux_dbvec!=0) && 
 169            ((*(short *)linux_dbvec) != -1)) {
 170                 printk("Booted under debugger. Syncing up trap table.\n");
 171                 
 172                 (*(linux_dbvec->teach_debugger))();
 173 
 174                 SP_ENTER_DEBUGGER;
 175         }
 176 
 177         
 178         sparc_cpu_model = sun_unknown;
 179         if(!strcmp(&cputypval,"sun4c")) { sparc_cpu_model=sun4c; }
 180         if(!strcmp(&cputypval,"sun4m")) { sparc_cpu_model=sun4m; }
 181         if(!strcmp(&cputypval,"sun4d")) { sparc_cpu_model=sun4d; }
 182         if(!strcmp(&cputypval,"sun4e")) { sparc_cpu_model=sun4e; }
 183         if(!strcmp(&cputypval,"sun4u")) { sparc_cpu_model=sun4u; }
 184         printk("ARCH: ");
 185         switch(sparc_cpu_model)
 186           {
 187           case sun4c:
 188                   memset(phys_seg_map, 0x0, sizeof(phys_seg_map[PSEG_ENTRIES]));
 189                   put_segmap(IOBASE_VADDR, IOBASE_SUN4C_SEGMAP);
 190                   phys_seg_map[IOBASE_SUN4C_SEGMAP] = PSEG_RSV;
 191                   node = prom_root_node;
 192 
 193                   printk("SUN4C\n");
 194                   break;
 195           case sun4m:
 196                   node = prom_getchild(prom_root_node);
 197                   prom_getproperty(node, "device_type", devtype, sizeof(devtype));
 198                   while(strcmp(devtype, "cpu") != 0) {
 199                           node = prom_getsibling(node);
 200                           prom_getproperty(node, "device_type", devtype,
 201                                            sizeof(devtype));
 202                   }
 203                   
 204                   srmmu_patch_fhandlers();
 205                   printk("SUN4M\n");
 206                   break;
 207           case sun4d:
 208                   printk("SUN4D\n");
 209                   break;
 210           case sun4e:
 211                   printk("SUN4E\n");
 212                   break;
 213           case sun4u:
 214                   printk("SUN4U\n");
 215                   break;
 216           default:
 217                   printk("UNKNOWN!\n");
 218                   break;
 219           };
 220 
 221         
 222         get_idprom();
 223 
 224         
 225         probe_mmu(node);
 226 
 227         
 228         load_mmu();
 229 
 230         
 231         total = prom_probe_memory();
 232         *memory_start_p = (((unsigned long) &end));
 233 
 234         printk("Physical Memory: %d bytes (in hex %08lx)\n", (int) total,
 235                (unsigned long) total);
 236 
 237         for(i=0; sp_banks[i].num_bytes != 0; i++) {
 238 #if 0
 239                 printk("Bank %d:  base 0x%x  bytes %d\n", i,
 240                        (unsigned int) sp_banks[i].base_addr, 
 241                        (int) sp_banks[i].num_bytes);
 242 #endif
 243                 end_of_phys_memory = sp_banks[i].base_addr + sp_banks[i].num_bytes;
 244         }
 245 
 246         
 247         prom_setsync(prom_sync_me);
 248 
 249         init_task.mm->start_code = PAGE_OFFSET;
 250         init_task.mm->end_code = PAGE_OFFSET + (unsigned long) &etext;
 251         init_task.mm->end_data = PAGE_OFFSET + (unsigned long) &edata;
 252         init_task.mm->brk = PAGE_OFFSET + (unsigned long) &end;
 253         init_task.mm->mmap->vm_page_prot = PAGE_SHARED;
 254 
 255         
 256         for(counter=1; counter<NR_TASKS; counter++) {
 257                 task[counter] = NULL;
 258         }
 259 
 260         *memory_end_p = (((unsigned long) (total) + PAGE_OFFSET));
 261 
 262         return;
 263 }
 264 
 265 asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
     
 266 {
 267         return -EIO;
 268 }