board_bwct.c revision 159814
1155324Simp/*- 2155324Simp * Copyright (c) 1994-1998 Mark Brinicombe. 3155324Simp * Copyright (c) 1994 Brini. 4155324Simp * All rights reserved. 5155324Simp * 6155324Simp * This code is derived from software written for Brini by Mark Brinicombe 7155324Simp * 8155324Simp * Redistribution and use in source and binary forms, with or without 9155324Simp * modification, are permitted provided that the following conditions 10155324Simp * are met: 11155324Simp * 1. Redistributions of source code must retain the above copyright 12155324Simp * notice, this list of conditions and the following disclaimer. 13155324Simp * 2. Redistributions in binary form must reproduce the above copyright 14155324Simp * notice, this list of conditions and the following disclaimer in the 15155324Simp * documentation and/or other materials provided with the distribution. 16155324Simp * 3. All advertising materials mentioning features or use of this software 17155324Simp * must display the following acknowledgement: 18155324Simp * This product includes software developed by Brini. 19155324Simp * 4. The name of the company nor the name of the author may be used to 20155324Simp * endorse or promote products derived from this software without specific 21155324Simp * prior written permission. 22155324Simp * 23155324Simp * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED 24155324Simp * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 25155324Simp * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 26155324Simp * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 27155324Simp * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28155324Simp * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 29155324Simp * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30155324Simp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31155324Simp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32155324Simp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33155324Simp * SUCH DAMAGE. 34155324Simp * 35155324Simp * RiscBSD kernel project 36155324Simp * 37155324Simp * machdep.c 38155324Simp * 39155324Simp * Machine dependant functions for kernel setup 40155324Simp * 41155324Simp * This file needs a lot of work. 42155324Simp * 43155324Simp * Created : 17/09/94 44155324Simp */ 45155324Simp 46155324Simp#include "opt_msgbuf.h" 47155324Simp#include "opt_ddb.h" 48155324Simp 49155324Simp#include <sys/cdefs.h> 50155324Simp__FBSDID("$FreeBSD: head/sys/arm/at91/kb920x_machdep.c 159814 2006-06-20 23:40:04Z imp $"); 51155324Simp 52155324Simp#define _ARM32_BUS_DMA_PRIVATE 53155324Simp#include <sys/param.h> 54155324Simp#include <sys/systm.h> 55155324Simp#include <sys/sysproto.h> 56155324Simp#include <sys/signalvar.h> 57155324Simp#include <sys/imgact.h> 58155324Simp#include <sys/kernel.h> 59155324Simp#include <sys/ktr.h> 60155324Simp#include <sys/linker.h> 61155324Simp#include <sys/lock.h> 62155324Simp#include <sys/malloc.h> 63155324Simp#include <sys/mutex.h> 64155324Simp#include <sys/pcpu.h> 65155324Simp#include <sys/proc.h> 66155324Simp#include <sys/ptrace.h> 67155324Simp#include <sys/cons.h> 68155324Simp#include <sys/bio.h> 69155324Simp#include <sys/bus.h> 70155324Simp#include <sys/buf.h> 71155324Simp#include <sys/exec.h> 72155324Simp#include <sys/kdb.h> 73155324Simp#include <sys/msgbuf.h> 74155324Simp#include <machine/reg.h> 75155324Simp#include <machine/cpu.h> 76155324Simp 77155324Simp#include <vm/vm.h> 78155324Simp#include <vm/pmap.h> 79155324Simp#include <vm/vm.h> 80155324Simp#include <vm/vm_object.h> 81155324Simp#include <vm/vm_page.h> 82155324Simp#include <vm/vm_pager.h> 83155324Simp#include <vm/vm_map.h> 84155324Simp#include <vm/vnode_pager.h> 85155324Simp#include <machine/pmap.h> 86155324Simp#include <machine/vmparam.h> 87155324Simp#include <machine/pcb.h> 88155324Simp#include <machine/undefined.h> 89155324Simp#include <machine/machdep.h> 90155324Simp#include <machine/metadata.h> 91155324Simp#include <machine/armreg.h> 92155324Simp#include <machine/bus.h> 93155324Simp#include <sys/reboot.h> 94155324Simp 95155324Simp#include <arm/at91/at91rm92reg.h> 96155324Simp 97155324Simp#define KERNEL_PT_SYS 0 /* Page table for mapping proc0 zero page */ 98155324Simp#define KERNEL_PT_KERN 1 99159556Scognet#define KERNEL_PT_KERN_NUM 22 100155324Simp#define KERNEL_PT_AFKERNEL KERNEL_PT_KERN + KERNEL_PT_KERN_NUM /* L2 table for mapping after kernel */ 101155324Simp#define KERNEL_PT_AFKERNEL_NUM 5 102155324Simp 103155324Simp/* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ 104155324Simp#define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) 105155324Simp 106155324Simp/* Define various stack sizes in pages */ 107155324Simp#define IRQ_STACK_SIZE 1 108155324Simp#define ABT_STACK_SIZE 1 109155324Simp#define UND_STACK_SIZE 1 110155324Simp 111155324Simpextern u_int data_abort_handler_address; 112155324Simpextern u_int prefetch_abort_handler_address; 113155324Simpextern u_int undefined_handler_address; 114155324Simp 115155324Simpstruct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; 116155324Simp 117155324Simpextern void *_end; 118155324Simp 119155324Simpextern int *end; 120155324Simp 121155324Simpstruct pcpu __pcpu; 122155324Simpstruct pcpu *pcpup = &__pcpu; 123155324Simp 124155324Simp/* Physical and virtual addresses for some global pages */ 125155324Simp 126155324Simpvm_paddr_t phys_avail[10]; 127155324Simpvm_paddr_t dump_avail[4]; 128155324Simpvm_offset_t physical_pages; 129155324Simpvm_offset_t clean_sva, clean_eva; 130155324Simp 131155324Simpstruct pv_addr systempage; 132155324Simpstruct pv_addr msgbufpv; 133155324Simpstruct pv_addr irqstack; 134155324Simpstruct pv_addr undstack; 135155324Simpstruct pv_addr abtstack; 136155324Simpstruct pv_addr kernelstack; 137155324Simpstruct pv_addr minidataclean; 138155324Simp 139155324Simpstatic struct trapframe proc0_tf; 140155324Simp 141155324Simp/* Static device mappings. */ 142155324Simpstatic const struct pmap_devmap kb920x_devmap[] = { 143155324Simp /* 144155324Simp * Map the on-board devices VA == PA so that we can access them 145155324Simp * with the MMU on or off. 146155324Simp */ 147156832Simp { 148156832Simp /* 149156832Simp * This at least maps the interrupt controller, the UART 150156832Simp * and the timer. Other devices should use newbus to 151156832Simp * map their memory anyway. 152156832Simp */ 153156832Simp 0xfff00000, 154156832Simp 0xfff00000, 155156832Simp 0x100000, 156156832Simp VM_PROT_READ|VM_PROT_WRITE, 157156832Simp PTE_NOCACHE, 158156832Simp }, 159156832Simp { 160156832Simp /* 161156832Simp * Add the ohci controller, and anything else that might be 162156832Simp * on this chip select for a VA/PA mapping. 163156832Simp */ 164156832Simp AT91RM92_OHCI_BASE, 165156832Simp AT91RM92_OHCI_BASE, 166156832Simp AT91RM92_OHCI_SIZE, 167156832Simp VM_PROT_READ|VM_PROT_WRITE, 168156832Simp PTE_NOCACHE, 169156832Simp }, 170156832Simp { 171156832Simp 0, 172156832Simp 0, 173156832Simp 0, 174156832Simp 0, 175156832Simp 0, 176156832Simp } 177155324Simp}; 178155324Simp 179155324Simp#define SDRAM_START 0xa0000000 180155324Simp 181155324Simp#ifdef DDB 182155324Simpextern vm_offset_t ksym_start, ksym_end; 183155324Simp#endif 184155324Simp 185159814Simpstatic long 186159795Simpboard_init(void) 187159795Simp{ 188159795Simp uint32_t *SDRAMC = (uint32_t *)(AT91RM92_BASE + AT91RM92_SDRAMC_BASE); 189159795Simp uint32_t cr, mr; 190159795Simp int banks, rows, cols, bw; /* log2 size */ 191159795Simp 192159795Simp cr = SDRAMC[AT91RM92_SDRAMC_CR / 4]; 193159795Simp mr = SDRAMC[AT91RM92_SDRAMC_MR / 4]; 194159795Simp bw = (mr & AT91RM92_SDRAMC_MR_DBW_16) ? 1 : 2; 195159795Simp banks = (cr & AT91RM92_SDRAMC_CR_NB_4) ? 2 : 1; 196159795Simp rows = ((cr & AT91RM92_SDRAMC_CR_NR_MASK) >> 2) + 11; 197159795Simp cols = (cr & AT91RM92_SDRAMC_CR_NC_MASK) + 8; 198159814Simp return (1 << (cols + rows + banks + bw)); 199159795Simp} 200159795Simp 201155324Simpvoid * 202155324Simpinitarm(void *arg, void *arg2) 203155324Simp{ 204155324Simp struct pv_addr kernel_l1pt; 205155324Simp int loop; 206155324Simp u_int l1pagetable; 207155324Simp vm_offset_t freemempos; 208155324Simp vm_offset_t afterkern; 209155324Simp int i = 0; 210155324Simp uint32_t fake_preload[35]; 211159795Simp uint32_t memsize; 212157024Scognet vm_offset_t lastaddr; 213157024Scognet#ifdef DDB 214157024Scognet vm_offset_t zstart = 0, zend = 0; 215157024Scognet#endif 216155324Simp 217155324Simp i = 0; 218155324Simp 219155324Simp set_cpufuncs(); 220155324Simp 221155324Simp fake_preload[i++] = MODINFO_NAME; 222155324Simp fake_preload[i++] = strlen("elf kernel") + 1; 223155324Simp strcpy((char*)&fake_preload[i++], "elf kernel"); 224155324Simp i += 2; 225155324Simp fake_preload[i++] = MODINFO_TYPE; 226155324Simp fake_preload[i++] = strlen("elf kernel") + 1; 227155324Simp strcpy((char*)&fake_preload[i++], "elf kernel"); 228155324Simp i += 2; 229155324Simp fake_preload[i++] = MODINFO_ADDR; 230155324Simp fake_preload[i++] = sizeof(vm_offset_t); 231155324Simp fake_preload[i++] = KERNBASE; 232155324Simp fake_preload[i++] = MODINFO_SIZE; 233155324Simp fake_preload[i++] = sizeof(uint32_t); 234155324Simp fake_preload[i++] = (uint32_t)&end - KERNBASE; 235157024Scognet#ifdef DDB 236157024Scognet if (*(uint32_t *)KERNVIRTADDR == MAGIC_TRAMP_NUMBER) { 237157024Scognet fake_preload[i++] = MODINFO_METADATA|MODINFOMD_SSYM; 238157024Scognet fake_preload[i++] = sizeof(vm_offset_t); 239157024Scognet fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 4); 240157024Scognet fake_preload[i++] = MODINFO_METADATA|MODINFOMD_ESYM; 241157024Scognet fake_preload[i++] = sizeof(vm_offset_t); 242157024Scognet fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 8); 243157024Scognet lastaddr = *(uint32_t *)(KERNVIRTADDR + 8); 244157024Scognet zend = lastaddr; 245157024Scognet zstart = *(uint32_t *)(KERNVIRTADDR + 4); 246157024Scognet ksym_start = zstart; 247157024Scognet ksym_end = zend; 248157024Scognet } else 249157024Scognet#endif 250157024Scognet lastaddr = (vm_offset_t)&end; 251157024Scognet 252155324Simp fake_preload[i++] = 0; 253155324Simp fake_preload[i] = 0; 254155324Simp preload_metadata = (void *)fake_preload; 255155324Simp 256155324Simp 257155324Simp pcpu_init(pcpup, 0, sizeof(struct pcpu)); 258155324Simp PCPU_SET(curthread, &thread0); 259155324Simp 260155324Simp#define KERNEL_TEXT_BASE (KERNBASE) 261157024Scognet freemempos = (lastaddr + PAGE_MASK) & ~PAGE_MASK; 262155324Simp /* Define a macro to simplify memory allocation */ 263155324Simp#define valloc_pages(var, np) \ 264155324Simp alloc_pages((var).pv_va, (np)); \ 265155324Simp (var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR); 266155324Simp 267155324Simp#define alloc_pages(var, np) \ 268155324Simp (var) = freemempos; \ 269155324Simp freemempos += (np * PAGE_SIZE); \ 270155324Simp memset((char *)(var), 0, ((np) * PAGE_SIZE)); 271155324Simp 272155324Simp while (((freemempos - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) != 0) 273155324Simp freemempos += PAGE_SIZE; 274155324Simp valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); 275155324Simp for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) { 276155324Simp if (!(loop % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) { 277155324Simp valloc_pages(kernel_pt_table[loop], 278155324Simp L2_TABLE_SIZE / PAGE_SIZE); 279155324Simp } else { 280155324Simp kernel_pt_table[loop].pv_va = freemempos - 281155324Simp (loop % (PAGE_SIZE / L2_TABLE_SIZE_REAL)) * 282155324Simp L2_TABLE_SIZE_REAL; 283155324Simp kernel_pt_table[loop].pv_pa = 284155324Simp kernel_pt_table[loop].pv_va - KERNVIRTADDR + 285155324Simp KERNPHYSADDR; 286155324Simp } 287155324Simp i++; 288155324Simp } 289155324Simp /* 290155324Simp * Allocate a page for the system page mapped to V0x00000000 291155324Simp * This page will just contain the system vectors and can be 292155324Simp * shared by all processes. 293155324Simp */ 294155324Simp valloc_pages(systempage, 1); 295155324Simp 296155324Simp /* Allocate stacks for all modes */ 297155324Simp valloc_pages(irqstack, IRQ_STACK_SIZE); 298155324Simp valloc_pages(abtstack, ABT_STACK_SIZE); 299155324Simp valloc_pages(undstack, UND_STACK_SIZE); 300155324Simp valloc_pages(kernelstack, KSTACK_PAGES); 301155324Simp alloc_pages(minidataclean.pv_pa, 1); 302155324Simp valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); 303155324Simp /* 304155324Simp * Now we start construction of the L1 page table 305155324Simp * We start by mapping the L2 page tables into the L1. 306155324Simp * This means that we can replace L1 mappings later on if necessary 307155324Simp */ 308155324Simp l1pagetable = kernel_l1pt.pv_va; 309155324Simp 310155324Simp /* Map the L2 pages tables in the L1 page table */ 311155324Simp pmap_link_l2pt(l1pagetable, ARM_VECTORS_LOW, 312155324Simp &kernel_pt_table[KERNEL_PT_SYS]); 313155324Simp for (i = 0; i < KERNEL_PT_KERN_NUM; i++) 314155324Simp pmap_link_l2pt(l1pagetable, KERNBASE + i * 0x100000, 315155324Simp &kernel_pt_table[KERNEL_PT_KERN + i]); 316155324Simp pmap_map_chunk(l1pagetable, KERNBASE, KERNPHYSADDR, 317157024Scognet (((uint32_t)(lastaddr) - KERNBASE) + PAGE_SIZE) & ~(PAGE_SIZE - 1), 318155324Simp VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); 319157024Scognet afterkern = round_page((lastaddr + L1_S_SIZE) & ~(L1_S_SIZE 320155324Simp - 1)); 321155324Simp for (i = 0; i < KERNEL_PT_AFKERNEL_NUM; i++) { 322155324Simp pmap_link_l2pt(l1pagetable, afterkern + i * 0x00100000, 323155324Simp &kernel_pt_table[KERNEL_PT_AFKERNEL + i]); 324155324Simp } 325155324Simp pmap_map_entry(l1pagetable, afterkern, minidataclean.pv_pa, 326155324Simp VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); 327155324Simp 328155324Simp 329155324Simp /* Map the vector page. */ 330155324Simp pmap_map_entry(l1pagetable, ARM_VECTORS_LOW, systempage.pv_pa, 331155324Simp VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); 332155324Simp /* Map the stack pages */ 333155324Simp pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa, 334155324Simp IRQ_STACK_SIZE * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); 335155324Simp pmap_map_chunk(l1pagetable, abtstack.pv_va, abtstack.pv_pa, 336155324Simp ABT_STACK_SIZE * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); 337155324Simp pmap_map_chunk(l1pagetable, undstack.pv_va, undstack.pv_pa, 338155324Simp UND_STACK_SIZE * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); 339155324Simp pmap_map_chunk(l1pagetable, kernelstack.pv_va, kernelstack.pv_pa, 340155324Simp KSTACK_PAGES * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); 341155324Simp 342155324Simp pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, 343155324Simp L1_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); 344155324Simp pmap_map_chunk(l1pagetable, msgbufpv.pv_va, msgbufpv.pv_pa, 345155324Simp MSGBUF_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); 346155324Simp 347155324Simp 348155324Simp for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) { 349155324Simp pmap_map_chunk(l1pagetable, kernel_pt_table[loop].pv_va, 350155324Simp kernel_pt_table[loop].pv_pa, L2_TABLE_SIZE, 351155324Simp VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); 352155324Simp } 353155324Simp 354155324Simp pmap_devmap_bootstrap(l1pagetable, kb920x_devmap); 355155324Simp cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT); 356155324Simp setttb(kernel_l1pt.pv_pa); 357155324Simp cpu_tlb_flushID(); 358155324Simp cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)); 359157029Scognet cninit(); 360159795Simp memsize = board_init(); 361159814Simp physmem = memsize / PAGE_SIZE; 362159814Simp 363155324Simp /* 364155324Simp * Pages were allocated during the secondary bootstrap for the 365155324Simp * stacks for different CPU modes. 366155324Simp * We must now set the r13 registers in the different CPU modes to 367155324Simp * point to these stacks. 368155324Simp * Since the ARM stacks use STMFD etc. we must set r13 to the top end 369155324Simp * of the stack memory. 370155324Simp */ 371155324Simp 372155324Simp cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); 373155324Simp set_stackptr(PSR_IRQ32_MODE, 374155324Simp irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); 375155324Simp set_stackptr(PSR_ABT32_MODE, 376155324Simp abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); 377155324Simp set_stackptr(PSR_UND32_MODE, 378155324Simp undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); 379155324Simp 380155324Simp 381155324Simp 382155324Simp /* 383155324Simp * We must now clean the cache again.... 384155324Simp * Cleaning may be done by reading new data to displace any 385155324Simp * dirty data in the cache. This will have happened in setttb() 386155324Simp * but since we are boot strapping the addresses used for the read 387155324Simp * may have just been remapped and thus the cache could be out 388155324Simp * of sync. A re-clean after the switch will cure this. 389155324Simp * After booting there are no gross reloations of the kernel thus 390155324Simp * this problem will not occur after initarm(). 391155324Simp */ 392155324Simp cpu_idcache_wbinv_all(); 393155324Simp 394155324Simp /* Set stack for exception handlers */ 395155324Simp 396155324Simp data_abort_handler_address = (u_int)data_abort_handler; 397155324Simp prefetch_abort_handler_address = (u_int)prefetch_abort_handler; 398155324Simp undefined_handler_address = (u_int)undefinedinstruction_bounce; 399155324Simp undefined_init(); 400155324Simp 401155324Simp proc_linkup(&proc0, &ksegrp0, &thread0); 402155324Simp thread0.td_kstack = kernelstack.pv_va; 403155324Simp thread0.td_pcb = (struct pcb *) 404155324Simp (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; 405155324Simp thread0.td_pcb->pcb_flags = 0; 406155324Simp thread0.td_frame = &proc0_tf; 407155324Simp pcpup->pc_curpcb = thread0.td_pcb; 408155324Simp 409155324Simp arm_vector_init(ARM_VECTORS_LOW, ARM_VEC_ALL); 410155324Simp 411155324Simp pmap_curmaxkvaddr = afterkern + 0x100000 * (KERNEL_PT_KERN_NUM - 1); 412155324Simp pmap_bootstrap(freemempos, 413155324Simp KERNVIRTADDR + 3 * memsize, 414155324Simp &kernel_l1pt); 415155324Simp msgbufp = (void*)msgbufpv.pv_va; 416155324Simp msgbufinit(msgbufp, MSGBUF_SIZE); 417155324Simp mutex_init(); 418155324Simp 419155324Simp i = 0; 420155324Simp dump_avail[0] = KERNPHYSADDR; 421155324Simp dump_avail[1] = KERNPHYSADDR + memsize; 422155324Simp dump_avail[2] = 0; 423155324Simp dump_avail[3] = 0; 424155324Simp 425155324Simp phys_avail[0] = freemempos - KERNVIRTADDR + KERNPHYSADDR; 426155324Simp phys_avail[1] = KERNPHYSADDR + memsize; 427155324Simp phys_avail[2] = 0; 428155324Simp phys_avail[3] = 0; 429155324Simp /* Do basic tuning, hz etc */ 430155324Simp init_param1(); 431159814Simp init_param2(physmem); 432155324Simp avail_end = KERNPHYSADDR + memsize - 1; 433155324Simp kdb_init(); 434155324Simp return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - 435155324Simp sizeof(struct pcb))); 436155324Simp} 437