You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(2) |
Oct
(43) |
Nov
(4) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(78) |
Feb
(97) |
Mar
(29) |
Apr
(2) |
May
(22) |
Jun
(38) |
Jul
(11) |
Aug
(27) |
Sep
(40) |
Oct
(2) |
Nov
(17) |
Dec
(8) |
2002 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
(480) |
May
(456) |
Jun
(12) |
Jul
|
Aug
(1) |
Sep
|
Oct
(18) |
Nov
(3) |
Dec
(6) |
2003 |
Jan
|
Feb
(18) |
Mar
(1) |
Apr
|
May
(6) |
Jun
(147) |
Jul
(7) |
Aug
(3) |
Sep
(235) |
Oct
(10) |
Nov
(2) |
Dec
(1) |
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Andy P. <at...@us...> - 2002-04-10 18:36:13
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ia64/mm In directory usw-pr-cvs1:/tmp/cvs-serv12040/ia64/mm Modified Files: extable.c fault.c init.c tlb.c Log Message: synch 2.4.15 commit 36 Index: extable.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ia64/mm/extable.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- extable.c 14 Jan 2001 19:50:52 -0000 1.1.1.1 +++ extable.c 10 Apr 2002 14:27:22 -0000 1.2 @@ -1,13 +1,14 @@ /* * Kernel exception handling table support. Derived from arch/alpha/mm/extable.c. * - * Copyright (C) 1998, 1999 Hewlett-Packard Co - * Copyright (C) 1998, 1999 David Mosberger-Tang <da...@hp...> + * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co + * Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <da...@hp...> */ #include <linux/config.h> -#include <linux/module.h> + #include <asm/uaccess.h> +#include <asm/module.h> extern const struct exception_table_entry __start___ex_table[]; extern const struct exception_table_entry __stop___ex_table[]; @@ -15,54 +16,66 @@ static inline const struct exception_table_entry * search_one_table (const struct exception_table_entry *first, const struct exception_table_entry *last, - signed long value) + unsigned long ip, unsigned long gp) { - /* Abort early if the search value is out of range. */ - if (value != (signed int)value) - return 0; - while (first <= last) { const struct exception_table_entry *mid; long diff; - /* - * We know that first and last are both kernel virtual - * pointers (region 7) so first+last will cause an - * overflow. We fix that by calling __va() on the - * result, which will ensure that the top two bits get - * set again. - */ - mid = (void *) __va((((__u64) first + (__u64) last)/2/sizeof(*mid))*sizeof(*mid)); - diff = mid->addr - value; + + mid = &first[(last - first)/2]; + diff = (mid->addr + gp) - ip; if (diff == 0) return mid; else if (diff < 0) - first = mid+1; + first = mid + 1; else - last = mid-1; + last = mid - 1; } return 0; } -register unsigned long gp __asm__("gp"); +#ifndef CONFIG_MODULES +register unsigned long main_gp __asm__("gp"); +#endif -const struct exception_table_entry * +struct exception_fixup search_exception_table (unsigned long addr) { -#ifndef CONFIG_MODULE + const struct exception_table_entry *entry; + struct exception_fixup fix = { 0 }; + +#ifndef CONFIG_MODULES /* There is only the kernel to search. */ - return search_one_table(__start___ex_table, __stop___ex_table - 1, addr - gp); + entry = search_one_table(__start___ex_table, __stop___ex_table - 1, addr, main_gp); + if (entry) + fix.cont = entry->cont + main_gp; + return fix; #else - struct exception_table_entry *ret; - /* The kernel is the last "module" -- no need to treat it special. */ + struct archdata *archdata; struct module *mp; + /* The kernel is the last "module" -- no need to treat it special. */ for (mp = module_list; mp ; mp = mp->next) { if (!mp->ex_table_start) continue; - ret = search_one_table(mp->ex_table_start, mp->ex_table_end - 1, addr - mp->gp); - if (ret) - return ret; + archdata = (struct archdata *) mp->archdata_start; + entry = search_one_table(mp->ex_table_start, mp->ex_table_end - 1, + addr, (unsigned long) archdata->gp); + if (entry) { + fix.cont = entry->cont + (unsigned long) archdata->gp; + return fix; + } } - return 0; #endif + return fix; +} + +void +handle_exception (struct pt_regs *regs, struct exception_fixup fix) +{ + regs->r8 = -EFAULT; + if (fix.cont & 4) + regs->r9 = 0; + regs->cr_iip = (long) fix.cont & ~0xf; + ia64_psr(regs)->ri = fix.cont & 0x3; /* set continuation slot number */ } Index: fault.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ia64/mm/fault.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fault.c 14 Jan 2001 19:50:53 -0000 1.1.1.1 +++ fault.c 10 Apr 2002 14:27:22 -0000 1.2 @@ -1,8 +1,8 @@ /* * MMU fault handling support. * - * Copyright (C) 1998-2000 Hewlett-Packard Co - * Copyright (C) 1998-2000 David Mosberger-Tang <da...@hp...> + * Copyright (C) 1998-2001 Hewlett-Packard Co + * David Mosberger-Tang <da...@hp...> */ #include <linux/sched.h> #include <linux/kernel.h> @@ -16,7 +16,7 @@ #include <asm/uaccess.h> #include <asm/hardirq.h> -extern void die_if_kernel (char *, struct pt_regs *, long); +extern void die (char *, struct pt_regs *, long); /* * This routine is analogous to expand_stack() but instead grows the @@ -46,21 +46,20 @@ void ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *regs) { - struct mm_struct *mm = current->mm; - const struct exception_table_entry *fix; + int signal = SIGSEGV, code = SEGV_MAPERR; struct vm_area_struct *vma, *prev_vma; + struct mm_struct *mm = current->mm; + struct exception_fixup fix; struct siginfo si; - int signal = SIGSEGV; unsigned long mask; /* - * If we're in an interrupt or have no user - * context, we must not take the fault.. + * If we're in an interrupt or have no user context, we must not take the fault.. */ if (in_interrupt() || !mm) goto no_context; - down(&mm->mmap_sem); + down_read(&mm->mmap_sem); vma = find_vma_prev(mm, address, &prev_vma); if (!vma) @@ -71,6 +70,8 @@ goto check_expansion; good_area: + code = SEGV_ACCERR; + /* OK, we've got a good vm_area for this memory area. Check the access permissions: */ # define VM_READ_BIT 0 @@ -89,12 +90,13 @@ if ((vma->vm_flags & mask) != mask) goto bad_area; + survive: /* * If for any reason at all we couldn't handle the fault, make * sure we exit gracefully rather than endlessly redo the * fault. */ - switch (handle_mm_fault(mm, vma, address, mask) != 0) { + switch (handle_mm_fault(mm, vma, address, mask)) { case 1: ++current->min_flt; break; @@ -112,7 +114,7 @@ default: goto out_of_memory; } - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); return; check_expansion: @@ -135,7 +137,7 @@ goto good_area; bad_area: - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); if (isr & IA64_ISR_SP) { /* * This fault was due to a speculative load set the "ed" bit in the psr to @@ -147,7 +149,7 @@ if (user_mode(regs)) { si.si_signo = signal; si.si_errno = 0; - si.si_code = SI_KERNEL; + si.si_code = code; si.si_addr = (void *) address; force_sig_info(signal, &si, current); return; @@ -163,29 +165,40 @@ return; } +#ifdef GAS_HAS_LOCAL_TAGS + fix = search_exception_table(regs->cr_iip + ia64_psr(regs)->ri); +#else fix = search_exception_table(regs->cr_iip); - if (fix) { - regs->r8 = -EFAULT; - if (fix->skip & 1) { - regs->r9 = 0; - } - regs->cr_iip += ((long) fix->skip) & ~15; - regs->cr_ipsr &= ~IA64_PSR_RI; /* clear exception slot number */ +#endif + if (fix.cont) { + handle_exception(regs, fix); return; } /* - * Oops. The kernel tried to access some bad page. We'll have - * to terminate things with extreme prejudice. + * Oops. The kernel tried to access some bad page. We'll have to terminate things + * with extreme prejudice. */ - printk(KERN_ALERT "Unable to handle kernel paging request at " - "virtual address %016lx\n", address); - die_if_kernel("Oops", regs, isr); + bust_spinlocks(1); + + if (address < PAGE_SIZE) + printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference"); + else + printk(KERN_ALERT "Unable to handle kernel paging request at " + "virtual address %016lx\n", address); + die("Oops", regs, isr); + bust_spinlocks(0); do_exit(SIGKILL); return; out_of_memory: - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); + if (current->pid == 1) { + current->policy |= SCHED_YIELD; + schedule(); + down_read(&mm->mmap_sem); + goto survive; + } printk("VM: killing process %s\n", current->comm); if (user_mode(regs)) do_exit(SIGKILL); Index: init.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ia64/mm/init.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- init.c 14 Jan 2001 19:50:55 -0000 1.1.1.1 +++ init.c 10 Apr 2002 14:27:22 -0000 1.2 @@ -1,8 +1,8 @@ /* * Initialize MMU support. * - * Copyright (C) 1998-2000 Hewlett-Packard Co - * Copyright (C) 1998-2000 David Mosberger-Tang <da...@hp...> + * Copyright (C) 1998-2001 Hewlett-Packard Co + * Copyright (C) 1998-2001 David Mosberger-Tang <da...@hp...> */ #include <linux/config.h> #include <linux/kernel.h> @@ -23,116 +23,36 @@ #include <asm/pgalloc.h> #include <asm/sal.h> #include <asm/system.h> +#include <asm/uaccess.h> +#include <asm/tlb.h> + +mmu_gather_t mmu_gathers[NR_CPUS]; /* References to section boundaries: */ extern char _stext, _etext, _edata, __init_begin, __init_end; -/* - * These are allocated in head.S so that we get proper page alignment. - * If you change the size of these then change head.S as well. - */ -extern char empty_bad_page[PAGE_SIZE]; -extern pmd_t empty_bad_pmd_table[PTRS_PER_PMD]; -extern pte_t empty_bad_pte_table[PTRS_PER_PTE]; - extern void ia64_tlb_init (void); -static unsigned long totalram_pages; - -/* - * Fill in empty_bad_pmd_table with entries pointing to - * empty_bad_pte_table and return the address of this PMD table. - */ -static pmd_t * -get_bad_pmd_table (void) -{ - pmd_t v; - int i; - - pmd_set(&v, empty_bad_pte_table); - - for (i = 0; i < PTRS_PER_PMD; ++i) - empty_bad_pmd_table[i] = v; - - return empty_bad_pmd_table; -} - -/* - * Fill in empty_bad_pte_table with PTEs pointing to empty_bad_page - * and return the address of this PTE table. - */ -static pte_t * -get_bad_pte_table (void) -{ - pte_t v; - int i; - - set_pte(&v, pte_mkdirty(mk_pte_phys(__pa(empty_bad_page), PAGE_SHARED))); - - for (i = 0; i < PTRS_PER_PTE; ++i) - empty_bad_pte_table[i] = v; +unsigned long MAX_DMA_ADDRESS = PAGE_OFFSET + 0x100000000UL; - return empty_bad_pte_table; -} - -void -__handle_bad_pgd (pgd_t *pgd) -{ - pgd_ERROR(*pgd); - pgd_set(pgd, get_bad_pmd_table()); -} - -void -__handle_bad_pmd (pmd_t *pmd) -{ - pmd_ERROR(*pmd); - pmd_set(pmd, get_bad_pte_table()); -} - -/* - * Allocate and initialize an L3 directory page and set - * the L2 directory entry PMD to the newly allocated page. - */ -pte_t* -get_pte_slow (pmd_t *pmd, unsigned long offset) -{ - pte_t *pte; - - pte = (pte_t *) __get_free_page(GFP_KERNEL); - if (pmd_none(*pmd)) { - if (pte) { - /* everything A-OK */ - clear_page(pte); - pmd_set(pmd, pte); - return pte + offset; - } - pmd_set(pmd, get_bad_pte_table()); - return NULL; - } - free_page((unsigned long) pte); - if (pmd_bad(*pmd)) { - __handle_bad_pmd(pmd); - return NULL; - } - return (pte_t *) pmd_page(*pmd) + offset; -} +static unsigned long totalram_pages; int do_check_pgt_cache (int low, int high) { int freed = 0; - if (pgtable_cache_size > high) { - do { - if (pgd_quicklist) - free_page((unsigned long)get_pgd_fast()), ++freed; - if (pmd_quicklist) - free_page((unsigned long)get_pmd_fast()), ++freed; - if (pte_quicklist) - free_page((unsigned long)get_pte_fast()), ++freed; - } while (pgtable_cache_size > low); - } - return freed; + if (pgtable_cache_size > high) { + do { + if (pgd_quicklist) + free_page((unsigned long)pgd_alloc_one_fast(0)), ++freed; + if (pmd_quicklist) + free_page((unsigned long)pmd_alloc_one_fast(0, 0)), ++freed; + if (pte_quicklist) + free_page((unsigned long)pte_alloc_one_fast(0, 0)), ++freed; + } while (pgtable_cache_size > low); + } + return freed; } /* @@ -188,21 +108,21 @@ { /* * EFI uses 4KB pages while the kernel can use 4KB or bigger. - * Thus EFI and the kernel may have different page sizes. It is - * therefore possible to have the initrd share the same page as - * the end of the kernel (given current setup). + * Thus EFI and the kernel may have different page sizes. It is + * therefore possible to have the initrd share the same page as + * the end of the kernel (given current setup). * * To avoid freeing/using the wrong page (kernel sized) we: - * - align up the beginning of initrd - * - keep the end untouched + * - align up the beginning of initrd + * - align down the end of initrd * * | | * |=============| a000 * | | * | | * | | 9000 - * |/////////////| - * |/////////////| + * |/////////////| + * |/////////////| * |=============| 8000 * |///INITRD////| * |/////////////| @@ -211,18 +131,21 @@ * |KKKKKKKKKKKKK| * |=============| 6000 * |KKKKKKKKKKKKK| - * |KKKKKKKKKKKKK| + * |KKKKKKKKKKKKK| * K=kernel using 8KB pages - * + * * In this example, we must free page 8000 ONLY. So we must align up * initrd_start and keep initrd_end as is. */ start = PAGE_ALIGN(start); + end = end & PAGE_MASK; if (start < end) printk ("Freeing initrd memory: %ldkB freed\n", (end - start) >> 10); for (; start < end; start += PAGE_SIZE) { + if (!VALID_PAGE(virt_to_page(start))) + continue; clear_bit(PG_reserved, &virt_to_page(start)->flags); set_page_count(virt_to_page(start), 1); free_page(start); @@ -244,13 +167,40 @@ } void -show_mem (void) +show_mem(void) { int i, total = 0, reserved = 0; int shared = 0, cached = 0; printk("Mem-info:\n"); show_free_areas(); + +#ifdef CONFIG_DISCONTIGMEM + { + pg_data_t *pgdat = pgdat_list; + + printk("Free swap: %6dkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); + do { + printk("Node ID: %d\n", pgdat->node_id); + for(i = 0; i < pgdat->node_size; i++) { + if (PageReserved(pgdat->node_mem_map+i)) + reserved++; + else if (PageSwapCache(pgdat->node_mem_map+i)) + cached++; + else if (page_count(pgdat->node_mem_map + i)) + shared += page_count(pgdat->node_mem_map + i) - 1; + } + printk("\t%d pages of RAM\n", pgdat->node_size); + printk("\t%d reserved pages\n", reserved); + printk("\t%d pages shared\n", shared); + printk("\t%d pages swap cached\n", cached); + pgdat = pgdat->node_next; + } while (pgdat); + printk("Total of %ld pages in page table cache\n", pgtable_cache_size); + show_buffers(); + printk("%d free buffer pages\n", nr_free_buffer_pages()); + } +#else /* !CONFIG_DISCONTIGMEM */ printk("Free swap: %6dkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); i = max_mapnr; while (i-- > 0) { @@ -268,6 +218,7 @@ printk("%d pages swap cached\n", cached); printk("%ld pages in page table cache\n", pgtable_cache_size); show_buffers(); +#endif /* !CONFIG_DISCONTIGMEM */ } /* @@ -286,52 +237,58 @@ page_address(page)); pgd = pgd_offset_k(address); /* note: this is NOT pgd_offset()! */ - pmd = pmd_alloc(pgd, address); - if (!pmd) { - __free_page(page); - panic("Out of memory."); - return 0; - } - pte = pte_alloc(pmd, address); - if (!pte) { - __free_page(page); - panic("Out of memory."); - return 0; - } - if (!pte_none(*pte)) { - pte_ERROR(*pte); - __free_page(page); - return 0; + + spin_lock(&init_mm.page_table_lock); + { + pmd = pmd_alloc(&init_mm, pgd, address); + if (!pmd) + goto out; + pte = pte_alloc(&init_mm, pmd, address); + if (!pte) + goto out; + if (!pte_none(*pte)) { + pte_ERROR(*pte); + goto out; + } + flush_page_to_ram(page); + set_pte(pte, mk_pte(page, PAGE_GATE)); } - flush_page_to_ram(page); - set_pte(pte, mk_pte(page, PAGE_GATE)); + out: spin_unlock(&init_mm.page_table_lock); /* no need for flush_tlb */ return page; } void __init -ia64_rid_init (void) +ia64_mmu_init (void *my_cpu_data) { unsigned long flags, rid, pta, impl_va_bits; + extern void __init tlb_init (void); #ifdef CONFIG_DISABLE_VHPT # define VHPT_ENABLE_BIT 0 #else # define VHPT_ENABLE_BIT 1 #endif - /* Set up the kernel identity mappings (regions 6 & 7) and the vmalloc area (region 5): */ + /* + * Set up the kernel identity mapping for regions 6 and 5. The mapping for region + * 7 is setup up in _start(). + */ ia64_clear_ic(flags); rid = ia64_rid(IA64_REGION_ID_KERNEL, __IA64_UNCACHED_OFFSET); - ia64_set_rr(__IA64_UNCACHED_OFFSET, (rid << 8) | (_PAGE_SIZE_256M << 2)); - - rid = ia64_rid(IA64_REGION_ID_KERNEL, PAGE_OFFSET); - ia64_set_rr(PAGE_OFFSET, (rid << 8) | (_PAGE_SIZE_256M << 2)); + ia64_set_rr(__IA64_UNCACHED_OFFSET, (rid << 8) | (IA64_GRANULE_SHIFT << 2)); rid = ia64_rid(IA64_REGION_ID_KERNEL, VMALLOC_START); ia64_set_rr(VMALLOC_START, (rid << 8) | (PAGE_SHIFT << 2) | 1); + /* ensure rr6 is up-to-date before inserting the PERCPU_ADDR translation: */ + ia64_srlz_d(); + + ia64_itr(0x2, IA64_TR_PERCPU_DATA, PERCPU_ADDR, + pte_val(mk_pte_phys(__pa(my_cpu_data), PAGE_KERNEL)), PAGE_SHIFT); + __restore_flags(flags); + ia64_srlz_i(); /* * Check if the virtually mapped linear page table (VMLPT) overlaps with a mapped @@ -356,7 +313,7 @@ # define vmlpt_bits (impl_va_bits - PAGE_SHIFT + pte_bits) # define POW2(n) (1ULL << (n)) - impl_va_bits = ffz(~my_cpu_data.unimpl_va_mask); + impl_va_bits = ffz(~(local_cpu_data->unimpl_va_mask | (7UL << 61))); if (impl_va_bits < 51 || impl_va_bits > 61) panic("CPU has bogus IMPL_VA_MSB value of %lu!\n", impl_va_bits - 1); @@ -374,6 +331,8 @@ * enabled. */ ia64_set_pta(pta | (0 << 8) | (vmlpt_bits << 2) | VHPT_ENABLE_BIT); + + ia64_tlb_init(); } /* @@ -390,7 +349,7 @@ memset(zones_size, 0, sizeof(zones_size)); - max_dma = (PAGE_ALIGN(MAX_DMA_ADDRESS) >> PAGE_SHIFT); + max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT; if (max_low_pfn < max_dma) zones_size[ZONE_DMA] = max_low_pfn; else { @@ -428,6 +387,7 @@ { extern char __start_gate_section[]; long reserved_pages, codesize, datasize, initsize; + unsigned long num_pgt_pages; #ifdef CONFIG_PCI /* @@ -460,6 +420,19 @@ (unsigned long) nr_free_pages() << (PAGE_SHIFT - 10), max_mapnr << (PAGE_SHIFT - 10), codesize >> 10, reserved_pages << (PAGE_SHIFT - 10), datasize >> 10, initsize >> 10); + + /* + * Allow for enough (cached) page table pages so that we can map the entire memory + * at least once. Each task also needs a couple of page tables pages, so add in a + * fudge factor for that (don't use "threads-max" here; that would be wrong!). + * Don't allow the cache to be more than 10% of total memory, though. + */ +# define NUM_TASKS 500 /* typical number of tasks */ + num_pgt_pages = nr_free_pages() / PTRS_PER_PGD + NUM_TASKS; + if (num_pgt_pages > nr_free_pages() / 10) + num_pgt_pages = nr_free_pages() / 10; + if (num_pgt_pages > pgt_cache_water[1]) + pgt_cache_water[1] = num_pgt_pages; /* install the gate page in the global page table: */ put_gate_page(virt_to_page(__start_gate_section), GATE_ADDR); Index: tlb.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ia64/mm/tlb.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- tlb.c 14 Jan 2001 19:50:55 -0000 1.1.1.1 +++ tlb.c 10 Apr 2002 14:27:22 -0000 1.2 @@ -1,11 +1,11 @@ /* * TLB support routines. * - * Copyright (C) 1998-2000 Hewlett-Packard Co - * Copyright (C) 1998-2000 David Mosberger-Tang <da...@hp...> + * Copyright (C) 1998-2001 Hewlett-Packard Co + * David Mosberger-Tang <da...@hp...> * - * 08/02/00 A. Mallick <asi...@in...> - * Modified RID allocation for SMP + * 08/02/00 A. Mallick <asi...@in...> + * Modified RID allocation for SMP * Goutham Rao <gou...@in...> * IPI based ptc implementation and A-step IPI implementation. */ @@ -41,88 +41,6 @@ }; /* - * Seralize usage of ptc.g - */ -spinlock_t ptcg_lock = SPIN_LOCK_UNLOCKED; /* see <asm/pgtable.h> */ - -#if defined(CONFIG_SMP) && !defined(CONFIG_ITANIUM_PTCG) - -#include <linux/irq.h> - -unsigned long flush_end, flush_start, flush_nbits, flush_rid; -atomic_t flush_cpu_count; - -/* - * flush_tlb_no_ptcg is called with ptcg_lock locked - */ -static inline void -flush_tlb_no_ptcg (unsigned long start, unsigned long end, unsigned long nbits) -{ - extern void smp_send_flush_tlb (void); - unsigned long saved_tpr = 0; - unsigned long flags; - - /* - * Some times this is called with interrupts disabled and causes - * dead-lock; to avoid this we enable interrupt and raise the TPR - * to enable ONLY IPI. - */ - __save_flags(flags); - if (!(flags & IA64_PSR_I)) { - saved_tpr = ia64_get_tpr(); - ia64_srlz_d(); - ia64_set_tpr(IPI_IRQ - 16); - ia64_srlz_d(); - local_irq_enable(); - } - - spin_lock(&ptcg_lock); - flush_rid = ia64_get_rr(start); - ia64_srlz_d(); - flush_start = start; - flush_end = end; - flush_nbits = nbits; - atomic_set(&flush_cpu_count, smp_num_cpus - 1); - smp_send_flush_tlb(); - /* - * Purge local TLB entries. ALAT invalidation is done in ia64_leave_kernel. - */ - do { - asm volatile ("ptc.l %0,%1" :: "r"(start), "r"(nbits<<2) : "memory"); - start += (1UL << nbits); - } while (start < end); - - ia64_srlz_i(); /* srlz.i implies srlz.d */ - - /* - * Wait for other CPUs to finish purging entries. - */ -#if (defined(CONFIG_ITANIUM_ASTEP_SPECIFIC) || defined(CONFIG_ITANIUM_BSTEP_SPECIFIC)) - { - unsigned long start = ia64_get_itc(); - while (atomic_read(&flush_cpu_count) > 0) { - if ((ia64_get_itc() - start) > 40000UL) { - atomic_set(&flush_cpu_count, smp_num_cpus - 1); - smp_send_flush_tlb(); - start = ia64_get_itc(); - } - } - } -#else - while (atomic_read(&flush_cpu_count)) { - /* Nothing */ - } -#endif - if (!(flags & IA64_PSR_I)) { - local_irq_disable(); - ia64_set_tpr(saved_tpr); - ia64_srlz_d(); - } -} - -#endif /* CONFIG_SMP && !CONFIG_ITANIUM_PTCG */ - -/* * Acquire the ia64_ctx.lock before calling this function! */ void @@ -148,7 +66,7 @@ if (tsk_context == ia64_ctx.next) { if (++ia64_ctx.next >= ia64_ctx.limit) { /* empty range: reset the range limit and start over */ - if (ia64_ctx.next > max_ctx) + if (ia64_ctx.next > max_ctx) ia64_ctx.next = 300; ia64_ctx.limit = max_ctx + 1; goto repeat; @@ -161,16 +79,36 @@ flush_tlb_all(); } +static inline void +ia64_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbits) +{ + static spinlock_t ptcg_lock = SPIN_LOCK_UNLOCKED; + + /* HW requires global serialization of ptc.ga. */ + spin_lock(&ptcg_lock); + { + do { + /* + * Flush ALAT entries also. + */ + asm volatile ("ptc.ga %0,%1;;srlz.i;;" :: "r"(start), "r"(nbits<<2) + : "memory"); + start += (1UL << nbits); + } while (start < end); + } + spin_unlock(&ptcg_lock); +} + void __flush_tlb_all (void) { unsigned long i, j, flags, count0, count1, stride0, stride1, addr; - addr = my_cpu_data.ptce_base; - count0 = my_cpu_data.ptce_count[0]; - count1 = my_cpu_data.ptce_count[1]; - stride0 = my_cpu_data.ptce_stride[0]; - stride1 = my_cpu_data.ptce_stride[1]; + addr = local_cpu_data->ptce_base; + count0 = local_cpu_data->ptce_count[0]; + count1 = local_cpu_data->ptce_count[1]; + stride0 = local_cpu_data->ptce_stride[0]; + stride1 = local_cpu_data->ptce_stride[1]; local_irq_save(flags); for (i = 0; i < count0; ++i) { @@ -221,23 +159,15 @@ } start &= ~((1UL << nbits) - 1); -#if defined(CONFIG_SMP) && !defined(CONFIG_ITANIUM_PTCG) - flush_tlb_no_ptcg(start, end, nbits); -#else - spin_lock(&ptcg_lock); - do { # ifdef CONFIG_SMP - /* - * Flush ALAT entries also. - */ - asm volatile ("ptc.ga %0,%1;;srlz.i;;" :: "r"(start), "r"(nbits<<2) : "memory"); + platform_global_tlb_purge(start, end, nbits); # else + do { asm volatile ("ptc.l %0,%1" :: "r"(start), "r"(nbits<<2) : "memory"); -# endif start += (1UL << nbits); } while (start < end); -#endif /* CONFIG_SMP && !defined(CONFIG_ITANIUM_PTCG) */ - spin_unlock(&ptcg_lock); +# endif + ia64_insn_group_barrier(); ia64_srlz_i(); /* srlz.i implies srlz.d */ ia64_insn_group_barrier(); @@ -249,11 +179,11 @@ ia64_ptce_info_t ptce_info; ia64_get_ptce(&ptce_info); - my_cpu_data.ptce_base = ptce_info.base; - my_cpu_data.ptce_count[0] = ptce_info.count[0]; - my_cpu_data.ptce_count[1] = ptce_info.count[1]; - my_cpu_data.ptce_stride[0] = ptce_info.stride[0]; - my_cpu_data.ptce_stride[1] = ptce_info.stride[1]; + local_cpu_data->ptce_base = ptce_info.base; + local_cpu_data->ptce_count[0] = ptce_info.count[0]; + local_cpu_data->ptce_count[1] = ptce_info.count[1]; + local_cpu_data->ptce_stride[0] = ptce_info.stride[0]; + local_cpu_data->ptce_stride[1] = ptce_info.stride[1]; __flush_tlb_all(); /* nuke left overs from bootstrapping... */ } |
From: Andy P. <at...@us...> - 2002-04-10 18:36:13
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/m68k/math-emu In directory usw-pr-cvs1:/tmp/cvs-serv13561/m68k/math-emu Modified Files: multi_arith.h Log Message: synch 2.4.15 commit 37 Index: multi_arith.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/math-emu/multi_arith.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- multi_arith.h 14 Jan 2001 19:42:22 -0000 1.1.1.1 +++ multi_arith.h 10 Apr 2002 14:34:36 -0000 1.2 @@ -329,7 +329,7 @@ int carry; /* we assume here, gcc only insert move and a clr instr */ - asm volatile ("add.b %1,%0" : "=d,=g" (dest->lowmant) + asm volatile ("add.b %1,%0" : "=d,g" (dest->lowmant) : "g,d" (src->lowmant), "0,0" (dest->lowmant)); asm volatile ("addx.l %1,%0" : "=d" (dest->mant.m32[1]) : "d" (src->mant.m32[1]), "0" (dest->mant.m32[1])); @@ -360,7 +360,7 @@ extern inline void fp_submant(struct fp_ext *dest, struct fp_ext *src1, struct fp_ext *src2) { /* we assume here, gcc only insert move and a clr instr */ - asm volatile ("sub.b %1,%0" : "=d,=g" (dest->lowmant) + asm volatile ("sub.b %1,%0" : "=d,g" (dest->lowmant) : "g,d" (src2->lowmant), "0,0" (src1->lowmant)); asm volatile ("subx.l %1,%0" : "=d" (dest->mant.m32[1]) : "d" (src2->mant.m32[1]), "0" (src1->mant.m32[1])); @@ -383,7 +383,7 @@ }) #define fp_addx96(dest, src) ({ \ /* we assume here, gcc only insert move and a clr instr */ \ - asm volatile ("add.l %1,%0" : "=d,=g" (dest->m32[2]) \ + asm volatile ("add.l %1,%0" : "=d,g" (dest->m32[2]) \ : "g,d" (temp.m32[1]), "0,0" (dest->m32[2])); \ asm volatile ("addx.l %1,%0" : "=d" (dest->m32[1]) \ : "d" (temp.m32[0]), "0" (dest->m32[1])); \ |
From: Andy P. <at...@us...> - 2002-04-10 18:36:11
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ia64/tools In directory usw-pr-cvs1:/tmp/cvs-serv12040/ia64/tools Modified Files: print_offsets.awk print_offsets.c Log Message: synch 2.4.15 commit 36 Index: print_offsets.awk =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ia64/tools/print_offsets.awk,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- print_offsets.awk 14 Jan 2001 19:53:25 -0000 1.1.1.1 +++ print_offsets.awk 10 Apr 2002 14:27:23 -0000 1.2 @@ -28,6 +28,10 @@ inside_table = 0 } +/.*[.]rodata/ { + inside_table = 0 +} + { if (inside_table) { if ($1 == "//") getline; @@ -61,7 +65,7 @@ inside_table = 1 } -/tab#:/ { +/tab\#:/ { inside_table = 1 } Index: print_offsets.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ia64/tools/print_offsets.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- print_offsets.c 14 Jan 2001 19:53:26 -0000 1.1.1.1 +++ print_offsets.c 10 Apr 2002 14:27:23 -0000 1.2 @@ -1,8 +1,8 @@ /* * Utility to generate asm-ia64/offsets.h. * - * Copyright (C) 1999-2000 Hewlett-Packard Co - * Copyright (C) 1999-2000 David Mosberger-Tang <da...@hp...> + * Copyright (C) 1999-2001 Hewlett-Packard Co + * Copyright (C) 1999-2001 David Mosberger-Tang <da...@hp...> * * Note that this file has dual use: when building the kernel * natively, the file is translated into a binary and executed. When @@ -21,6 +21,8 @@ #include <asm-ia64/siginfo.h> #include <asm-ia64/sigcontext.h> +#include "../kernel/sigframe.h" + #ifdef offsetof # undef offsetof #endif @@ -45,9 +47,9 @@ { "IA64_PT_REGS_SIZE", sizeof (struct pt_regs) }, { "IA64_SWITCH_STACK_SIZE", sizeof (struct switch_stack) }, { "IA64_SIGINFO_SIZE", sizeof (struct siginfo) }, -#ifdef CONFIG_IA64_NEW_UNWIND + { "IA64_CPU_SIZE", sizeof (struct cpuinfo_ia64) }, + { "SIGFRAME_SIZE", sizeof (struct sigframe) }, { "UNW_FRAME_INFO_SIZE", sizeof (struct unw_frame_info) }, -#endif { "", 0 }, /* spacer */ { "IA64_TASK_PTRACE_OFFSET", offsetof (struct task_struct, ptrace) }, { "IA64_TASK_SIGPENDING_OFFSET", offsetof (struct task_struct, sigpending) }, @@ -55,8 +57,8 @@ { "IA64_TASK_PROCESSOR_OFFSET", offsetof (struct task_struct, processor) }, { "IA64_TASK_THREAD_OFFSET", offsetof (struct task_struct, thread) }, { "IA64_TASK_THREAD_KSP_OFFSET", offsetof (struct task_struct, thread.ksp) }, -#ifdef CONFIG_IA32_SUPPORT - { "IA64_TASK_THREAD_SIGMASK_OFFSET",offsetof (struct task_struct, thread.un.sigmask) }, +#ifdef CONFIG_PERFMON + { "IA64_TASK_PFM_MUST_BLOCK_OFFSET",offsetof(struct task_struct, thread.pfm_must_block) }, #endif { "IA64_TASK_PID_OFFSET", offsetof (struct task_struct, pid) }, { "IA64_TASK_MM_OFFSET", offsetof (struct task_struct, mm) }, @@ -151,12 +153,27 @@ { "IA64_SWITCH_STACK_AR_BSPSTORE_OFFSET", offsetof (struct switch_stack, ar_bspstore) }, { "IA64_SWITCH_STACK_PR_OFFSET", offsetof (struct switch_stack, pr) }, { "IA64_SIGCONTEXT_AR_BSP_OFFSET", offsetof (struct sigcontext, sc_ar_bsp) }, + { "IA64_SIGCONTEXT_AR_FPSR_OFFSET", offsetof (struct sigcontext, sc_ar_fpsr) }, { "IA64_SIGCONTEXT_AR_RNAT_OFFSET", offsetof (struct sigcontext, sc_ar_rnat) }, - { "IA64_SIGCONTEXT_FLAGS_OFFSET", offsetof (struct sigcontext, sc_flags) }, + { "IA64_SIGCONTEXT_AR_UNAT_OFFSET", offsetof (struct sigcontext, sc_ar_unat) }, + { "IA64_SIGCONTEXT_B0_OFFSET", offsetof (struct sigcontext, sc_br[0]) }, { "IA64_SIGCONTEXT_CFM_OFFSET", offsetof (struct sigcontext, sc_cfm) }, + { "IA64_SIGCONTEXT_FLAGS_OFFSET", offsetof (struct sigcontext, sc_flags) }, { "IA64_SIGCONTEXT_FR6_OFFSET", offsetof (struct sigcontext, sc_fr[6]) }, + { "IA64_SIGCONTEXT_PR_OFFSET", offsetof (struct sigcontext, sc_pr) }, + { "IA64_SIGCONTEXT_R12_OFFSET", offsetof (struct sigcontext, sc_gr[12]) }, + { "IA64_SIGCONTEXT_RBS_BASE_OFFSET",offsetof (struct sigcontext, sc_rbs_base) }, + { "IA64_SIGCONTEXT_LOADRS_OFFSET", offsetof (struct sigcontext, sc_loadrs) }, + { "IA64_SIGFRAME_ARG0_OFFSET", offsetof (struct sigframe, arg0) }, + { "IA64_SIGFRAME_ARG1_OFFSET", offsetof (struct sigframe, arg1) }, + { "IA64_SIGFRAME_ARG2_OFFSET", offsetof (struct sigframe, arg2) }, + { "IA64_SIGFRAME_HANDLER_OFFSET", offsetof (struct sigframe, handler) }, + { "IA64_SIGFRAME_SIGCONTEXT_OFFSET", offsetof (struct sigframe, sc) }, { "IA64_CLONE_VFORK", CLONE_VFORK }, { "IA64_CLONE_VM", CLONE_VM }, + { "IA64_CPU_IRQ_COUNT_OFFSET", offsetof (struct cpuinfo_ia64, irq_stat.f.irq_count) }, + { "IA64_CPU_BH_COUNT_OFFSET", offsetof (struct cpuinfo_ia64, irq_stat.f.bh_count) }, + { "IA64_CPU_PHYS_STACKED_SIZE_P8_OFFSET",offsetof (struct cpuinfo_ia64, phys_stacked_size_p8)}, }; static const char *tabs = "\t\t\t\t\t\t\t\t\t\t"; |
From: Andy P. <at...@us...> - 2002-04-10 18:36:10
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/m68k/sun3/prom In directory usw-pr-cvs1:/tmp/cvs-serv13561/m68k/sun3/prom Modified Files: Makefile console.c init.c misc.c printf.c Log Message: synch 2.4.15 commit 37 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/sun3/prom/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: console.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/sun3/prom/console.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: init.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/sun3/prom/init.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: misc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/sun3/prom/misc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: printf.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/sun3/prom/printf.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 |
From: Andy P. <at...@us...> - 2002-04-10 18:36:09
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/m68k/q40 In directory usw-pr-cvs1:/tmp/cvs-serv13561/m68k/q40 Modified Files: README config.c q40ints.c Log Message: synch 2.4.15 commit 37 Index: README =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/q40/README,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- README 14 Jan 2001 19:41:59 -0000 1.1.1.1 +++ README 10 Apr 2002 14:34:37 -0000 1.2 @@ -3,43 +3,48 @@ You may try http://www.geocities.com/SiliconValley/Bay/2602/ for some up to date information. Booter and other tools will be also -available from this place and ftp.uni-erlangen.de/linux/680x0/q40/ +available from this place or ftp.uni-erlangen.de/linux/680x0/q40/ and mirrors. Hints to documentation usually refer to the linux source tree in /usr/src/linux/Documentation unless URL given. -It seems IRQ unmasking can't be safely done on a Q40. Autoprobing is -not yet implemented - do not try it! (See below) +It seems IRQ unmasking can't be safely done on a Q40. IRQ probing +is not implemented - do not try it! (See below) -For a list of kernel commandline options read the documentation for the +For a list of kernel command-line options read the documentation for the particular device drivers. The floppy imposes a very high interrupt load on the CPU, approx 30K/s. When something blocks interrupts (HD) it will loose some of them, so far -this is not known to have caused any data loss. On hihgly loaded systems -it can make the floppy very slow or practicaly stop. Other Q40 OS' simply +this is not known to have caused any data loss. On highly loaded systems +it can make the floppy very slow or practically stop. Other Q40 OS' simply poll the floppy for this reason - something that can't be done in Linux. -Only possible cure is getting a 82072 contoler with fifo instead of -the 8272A +Only possible cure is getting a 82072 controller with fifo instead of +the 8272A. -drivers used by the Q40, appart from the very obvious (console etc.): +drivers used by the Q40, apart from the very obvious (console etc.): drivers/char/q40_keyb.c # use PC keymaps for national keyboards serial.c # normal PC driver - any speed lp.c # printer driver - char/joystick/* # most of this should work + genrtc.c # RTC + char/joystick/* # most of this should work, not + # in default config.in block/q40ide.c # startup for ide ide* # see Documentation/ide.txt floppy.c # normal PC driver, DMA emu in asm/floppy.h # and arch/m68k/kernel/entry.S # see drivers/block/README.fd + net/ne.c video/q40fb.c - misc/parport_pc.c + parport/* + sound/dmasound_core.c + dmasound_q40.c Various other PC drivers can be enabled simply by adding them to arch/m68k/config.in, especially 8 bit devices should be without any problems. For cards using 16bit io/mem more care is required, like -checking byteorder issues, hacking memcpy_*_io etc. +checking byte order issues, hacking memcpy_*_io etc. Debugging @@ -47,7 +52,7 @@ Upon startup the kernel will usually output "ABCQGHIJ" into the SRAM, preceded by the booter signature. This is a trace just in case something -went wrong during earliest setup stages. +went wrong during earliest setup stages of head.S. **Changed** to preserve SRAM contents by default, this is only done when requested - SRAM must start with '%LX$' signature to do this. '-d' option to 'lxx' loader enables this. @@ -55,13 +60,15 @@ SRAM can also be used as additional console device, use debug=mem. This will save kernel startup msgs into SRAM, the screen will display only the penguin - and shell prompt if it gets that far.. +Unfortunately only 2000 bytes are available. Serial console works and can also be used for debugging, see loader_txt Most problems seem to be caused by fawlty or badly configured io-cards or -harddrives anyway..there are so many things that can go wrong here. -Make sure to configure the parallel port as SPP for first testing..the -Q40 may have trouble with parallel interrupts. +hard drives anyway. +Make sure to configure the parallel port as SPP and remove IRQ/DMA jumpers +for first testing. The Q40 does not support DMA and may have trouble with +parallel ports version of interrupts. Q40 Hardware Description @@ -71,30 +78,27 @@ questions. The Q40 consists of a 68040@40 MHz, 1MB video RAM, up to 32MB RAM, AT-style -keyboard interface, 1 Programmable LED, 2 8bit DACs and up to 1MB ROM, 1MB +keyboard interface, 1 Programmable LED, 2x8bit DACs and up to 1MB ROM, 1MB shadow ROM. +The Q60 has any of 68060 or 68LC060 and up to 128 MB RAM. -Most interfacing like floppy, hd, serial, parallel ports is done via ISA +Most interfacing like floppy, IDE, serial and parallel ports is done via ISA slots. The ISA io and mem range is mapped (sparse&byteswapped!) into separate regions of the memory. The main interrupt register IIRQ_REG will indicate whether an IRQ was internal or from some ISA devices, EIRQ_REG can distinguish up to 8 ISA IRQs. The Q40 custom chip is programmable to provide 2 periodic timers: - - 50 or 200 Hz - level 2, - - 10 or 20 KHz - level 4 - !!THIS CANT BE DISABLED!! - + - 50 or 200 Hz - level 2, !!THIS CANT BE DISABLED!! + - 10 or 20 KHz - level 4, used for dma-sound + Linux uses the 200 Hz interrupt for timer and beep by default. Interrupts ========== -q40 master chip handles only level triggered interrupts :-(( - -IRQ sharing is not yet implemented but this should be only a minor -problem.. +q40 master chip handles only a subset of level triggered interrupts. Linux has some requirements wrt interrupt architecture, these are to my knowledge: @@ -103,31 +107,32 @@ (b) working enable/disable_irq Luckily these requirements are only important for drivers shared -with other architectures - ide,serial,parallel, ethernet.. +with other architectures - ide,serial,parallel, ethernet. q40ints.c now contains a trivial hack for (a), (b) is more difficult -because only irq's 4-15 can be disabled - and only all o them at once. +because only irq's 4-15 can be disabled - and only all of them at once. Thus disable_irq() can effectively block the machine if the driver goes asleep. -One thing to keep in minde when hacking around the interrupt code is -that there is no way to find out which IRQ caused a request. +One thing to keep in mind when hacking around the interrupt code is +that there is no way to find out which IRQ caused a request, [EI]IRQ_REG +displays current state of the various IRQ lines. Keyboard ======== q40 receives AT make/break codes from the keyboard, these are translated to the PC scancodes x86 Linux uses. So by theory every national keyboard should -work just by loading the apropriate x86 keytable - see any national-HOWTO. +work just by loading the appropriate x86 keytable - see any national-HOWTO. Unfortunately the AT->PC translation isn't quite trivial and even worse, my documentation of it is absolutely minimal - thus some exotic keys may not behave exactly as expected. There is still hope that it can be fixed completely though. If you encounter -problems, email me idealy this: +problems, email me ideally this: - exact keypress/release sequence - 'showkey -s' run on q40, non-X session - 'showkey -s' run on a PC, non-X session - - AT codes as displayed by the q40 debuging ROM + - AT codes as displayed by the q40 debugging ROM btw if the showkey output from PC and Q40 doesn't differ then you have some classic configuration problem - don't send me anything in this case Index: config.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/q40/config.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- config.c 14 Jan 2001 19:42:01 -0000 1.1.1.1 +++ config.c 10 Apr 2002 14:34:37 -0000 1.2 @@ -13,11 +13,9 @@ */ #include <linux/config.h> -#include <stdarg.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/mm.h> -#include <linux/kd.h> #include <linux/tty.h> #include <linux/console.h> #include <linux/linkage.h> @@ -25,6 +23,7 @@ #include <linux/major.h> #include <linux/serial_reg.h> +#include <asm/io.h> #include <asm/rtc.h> #include <asm/bootinfo.h> #include <asm/system.h> @@ -32,6 +31,7 @@ #include <asm/setup.h> #include <asm/irq.h> #include <asm/traps.h> +#include <asm/rtc.h> #include <asm/machdep.h> #include <asm/q40_master.h> #include <asm/keyboard.h> @@ -39,6 +39,8 @@ extern void floppy_eject(void); extern void floppy_setup(char *str, int *ints); +extern int q40kbd_translate(unsigned char scancode, unsigned char *keycode, + char raw_mode); extern void q40_process_int (int level, struct pt_regs *regs); extern void (*q40_sys_default_handler[]) (int, void *, struct pt_regs *); /* added just for debugging */ extern void q40_init_IRQ (void); @@ -50,16 +52,17 @@ static int q40_get_hardware_list(char *buffer); extern int q40_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id); extern void q40_sched_init(void (*handler)(int, void *, struct pt_regs *)); -extern int q40_keyb_init(void); -extern int q40_kbdrate (struct kbd_repeat *); + extern unsigned long q40_gettimeoffset (void); extern void q40_gettod (int *year, int *mon, int *day, int *hour, int *min, int *sec); extern int q40_hwclk (int, struct hwclk_time *); extern int q40_set_clock_mmss (unsigned long); extern void q40_reset (void); +void q40_halt(void); extern void q40_waitbut(void); void q40_set_vectors (void); + extern void (*kd_mksound)(unsigned int, unsigned int); void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/ ); @@ -67,16 +70,9 @@ extern char m68k_debug_device[]; static void q40_mem_console_write(struct console *co, const char *b, unsigned int count); -#if 0 -extern int ql_ticks=0; -extern int sound_ticks=0; -#endif extern int ql_ticks; -static unsigned char bcd2bin (unsigned char b); -static unsigned char bin2bcd (unsigned char b); - static int q40_wait_key(struct console *co){return 0;} static struct console q40_console_driver = { name: "debug", @@ -90,11 +86,13 @@ extern char *q40_mem_cptr; /*=(char *)0xff020000;*/ static int _cpleft; +#if 0 int q40_kbd_translate(unsigned char keycode, unsigned char *keycodep, char raw_mode) { *keycodep = keycode; return 1; } +#endif static void q40_mem_console_write(struct console *co, const char *s, unsigned int count) @@ -130,13 +128,36 @@ } #endif -void q40_reset() +static int halted=0; + +#ifdef CONFIG_HEARTBEAT +static void q40_heartbeat(int on) { + if (halted) return; + if (on) + Q40_LED_ON(); + else + Q40_LED_OFF(); +} +#endif + +void q40_reset() +{ + halted=1; printk ("\n\n*******************************************\n" "Called q40_reset : press the RESET button!! \n" "*******************************************\n"); - + Q40_LED_ON(); + while(1) ; +} +void q40_halt() +{ + halted=1; + printk ("\n\n*******************\n" + " Called q40_halt\n" + "*******************\n"); + Q40_LED_ON(); while(1) ; } @@ -202,17 +223,17 @@ void __init config_q40(void) { - mach_sched_init = q40_sched_init; /* ok */ - /*mach_kbdrate = q40_kbdrate;*/ /* unneeded ?*/ - mach_keyb_init = q40_keyb_init; /* OK */ - mach_kbd_translate = q40_kbd_translate; + mach_sched_init = q40_sched_init; + + mach_keyb_init = q40kbd_init_hw; + mach_kbd_translate = q40kbd_translate; mach_init_IRQ = q40_init_IRQ; mach_gettimeoffset = q40_gettimeoffset; mach_gettod = q40_gettod; mach_hwclk = q40_hwclk; mach_set_clock_mmss = q40_set_clock_mmss; -/* mach_mksound = q40_mksound; */ - mach_reset = q40_reset; /* use reset button instead !*/ + + mach_reset = q40_reset; mach_free_irq = q40_free_irq; mach_process_int = q40_process_int; mach_get_irq_list = q40_get_irq_list; @@ -220,26 +241,28 @@ enable_irq = q40_enable_irq; disable_irq = q40_disable_irq; mach_default_handler = &q40_sys_default_handler; - mach_get_model = q40_get_model; /* no use..*/ - mach_get_hardware_list = q40_get_hardware_list; /* no use */ + mach_get_model = q40_get_model; + mach_get_hardware_list = q40_get_hardware_list; kd_mksound = q40_mksound; - /*mach_kbd_leds = q40kbd_leds;*/ + #ifdef CONFIG_MAGIC_SYSRQ mach_sysrq_key = 0x54; #endif - conswitchp = &dummy_con; -#if 0 /*def CONFIG_BLK_DEV_FD*/ - mach_floppy_setup = floppy_setup; - mach_floppy_eject = floppy_eject; - /**/ +#ifdef CONFIG_HEARTBEAT + mach_heartbeat = q40_heartbeat; #endif + mach_halt = q40_halt; + conswitchp = &dummy_con; + /* disable a few things that SMSQ might have left enabled */ q40_disable_irqs(); - mach_max_dma_address = 32*1024*1024; /* no DMA at all, but ide-scsi requires it.. */ + /* no DMA at all, but ide-scsi requires it.. make sure + * all physical RAM fits into the boundary - otherwise + * allocator may play costly and useless tricks */ + mach_max_dma_address = 1024*1024*1024; -/* userfull for early debuging stages writes kernel messages into SRAM */ - + /* useful for early debugging stages - writes kernel messages into SRAM */ if (!strncmp( m68k_debug_device,"mem",3 )) { /*printk("using NVRAM debug, q40_mem_cptr=%p\n",q40_mem_cptr);*/ @@ -252,109 +275,24 @@ int q40_parse_bootinfo(const struct bi_record *rec) { - return 1; /* unknown */ + return 1; } -#if 0 -#define DAC_LEFT ((unsigned char *)0xff008000) -#define DAC_RIGHT ((unsigned char *)0xff008004) -void q40_mksound(unsigned int hz, unsigned int ticks) -{ - /* for now ignore hz, except that hz==0 switches off sound */ - /* simply alternate the ampl 0-255-0-.. at 200Hz */ - if (hz==0) - { - if (sound_ticks) - sound_ticks=1; /* atomic - no irq spinlock used */ - - *DAC_LEFT=0; - *DAC_RIGHT=0; - return; - } - /* sound itself is done in q40_timer_int */ - if (sound_ticks == 0) sound_ticks=1000; /* pretty long beep */ - sound_ticks=ticks<<1; -} - -static void (*q40_timer_routine)(int, void *, struct pt_regs *); -static short rtc_oldsecs=0; -unsigned rtc_irq_flags=0; -unsigned rtc_irq_ctrl=0; - -static void q40_timer_int (int irq, void *dev_id, struct pt_regs *fp) -{ -#if (HZ==10000) - master_outb(-1,SAMPLE_CLEAR_REG); -#else /* must be 50 or 100 */ - master_outb(-1,FRAME_CLEAR_REG); -#endif - -#if (HZ==100) - ql_ticks = ql_ticks ? 0 : 1; - if (sound_ticks) - { - unsigned char sval=(sound_ticks & 1) ? 0 : 255; - sound_ticks--; - *DAC_LEFT=sval; - *DAC_RIGHT=sval; - } -#ifdef CONFIG_Q40RTC - if (rtc_irq_ctrl && (rtc_oldsecs != RTC_SECS)) - { - rtc_oldsecs = RTC_SECS; - rtc_irq_flags = RTC_UIE; - rtc_interrupt(); - } -#endif - if (ql_ticks) return; -#endif - q40_timer_routine(irq, dev_id, fp); +static inline unsigned char bcd2bin (unsigned char b) +{ + return ((b>>4)*10 + (b&15)); } -#endif -#if 0 -extern void (*q40_timer_routine)(int, void *, struct pt_regs *); -extern void q40_timer_int(); - -void q40_sched_init (void (*timer_routine)(int, void *, struct pt_regs *)) +static inline unsigned char bin2bcd (unsigned char b) { - int timer_irq; - - q40_timer_routine = timer_routine; - -#if (HZ==10000) - timer_irq=Q40_IRQ_TIMER; -#else - timer_irq=Q40_IRQ_FRAME; -#endif - - /*printk("registering sched/timer IRQ %d\n", timer_irq);*/ - - if (request_irq(timer_irq, q40_timer_int, 0, - "timer", q40_timer_int)) - panic ("Couldn't register timer int"); - -#if (HZ==10000) - master_outb(SAMPLE_LOW,SAMPLE_RATE_REG); - master_outb(-1,SAMPLE_CLEAR_REG); - master_outb(1,SAMPLE_ENABLE_REG); -#else - master_outb(-1,FRAME_CLEAR_REG); /* not necessary ? */ -#if (HZ==100) - master_outb( 1,FRAME_RATE_REG); -#endif -#endif + return (((b/10)*16) + (b%10)); } -#endif + unsigned long q40_gettimeoffset (void) { -#if (HZ==100) return 5000*(ql_ticks!=0); -#else - return 0; -#endif } extern void q40_gettod (int *year, int *mon, int *day, int *hour, @@ -362,7 +300,7 @@ { RTC_CTRL |= RTC_READ; *year = bcd2bin (RTC_YEAR); - *mon = bcd2bin (RTC_MNTH)-1; + *mon = bcd2bin (RTC_MNTH); *day = bcd2bin (RTC_DATE); *hour = bcd2bin (RTC_HOUR); *min = bcd2bin (RTC_MINS); @@ -371,15 +309,6 @@ } -static unsigned char bcd2bin (unsigned char b) -{ - return ((b>>4)*10 + (b&15)); -} - -static unsigned char bin2bcd (unsigned char b) -{ - return (((b/10)*16) + (b%10)); -} /* @@ -439,8 +368,6 @@ /* * Set the minutes and seconds from seconds value 'nowtime'. Fail if * clock is out by > 30 minutes. Logic lifted from atari code. - * Algorithm is to wait for the 10ms register to change, and then to - * wait a short while, and then set it. */ int q40_set_clock_mmss (unsigned long nowtime) @@ -469,18 +396,3 @@ return retval; } -extern void q40kbd_init_hw(void); - -int q40_keyb_init (void) -{ - q40kbd_init_hw(); - return 0; -} - -#if 0 -/* dummy to cause */ -void q40_slow_io() -{ - return; -} -#endif Index: q40ints.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/q40/q40ints.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- q40ints.c 14 Jan 2001 19:42:03 -0000 1.1.1.1 +++ q40ints.c 10 Apr 2002 14:34:37 -0000 1.2 @@ -1,7 +1,7 @@ /* * arch/m68k/q40/q40ints.c * - * Copyright (C) 1999 Richard Zidlicky + * Copyright (C) 1999,2001 Richard Zidlicky * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive @@ -44,7 +44,7 @@ void q40_irq2_handler (int, void *, struct pt_regs *fp); -extern void (*q40_sys_default_handler[]) (int, void *, struct pt_regs *); /* added just for debugging */ +extern void (*q40_sys_default_handler[]) (int, void *, struct pt_regs *); static void q40_defhand (int irq, void *dev_id, struct pt_regs *fp); static void sys_default_handler(int lev, void *dev_id, struct pt_regs *regs); @@ -97,9 +97,9 @@ sys_request_irq(IRQ2,q40_irq2_handler, 0, "q40 ISA and master chip", NULL); /* now enable some ints.. */ - master_outb(1,EXT_ENABLE_REG); /* hm, aint that too early? */ + master_outb(1,EXT_ENABLE_REG); /* ISA IRQ 5-15 */ - /* would be spurious ints by now, q40kbd_init_hw() does that */ + /* make sure keyboard IRQ is disabled */ master_outb(0,KEY_IRQ_ENABLE_REG); } @@ -139,7 +139,7 @@ if (dev_id==NULL) { printk("WARNING: dev_id == NULL in request_irq\n"); - dev_id=1; + dev_id=(void*)1; } irq_tab[irq].handler = handler; irq_tab[irq].flags = flags; @@ -202,7 +202,8 @@ /* * this stuff doesn't really belong here.. */ -int ql_ticks=0; + +int ql_ticks=0; /* 200Hz ticks since last jiffie */ static int sound_ticks=0; #define SVOL 45 @@ -214,7 +215,7 @@ if (hz==0) { if (sound_ticks) - sound_ticks=1; /* atomic - no irq spinlock used */ + sound_ticks=1; *DAC_LEFT=128; *DAC_RIGHT=128; @@ -227,14 +228,9 @@ } static void (*q40_timer_routine)(int, void *, struct pt_regs *); -static short rtc_oldsecs=0; -unsigned rtc_irq_flags=0; -unsigned rtc_irq_ctrl=0; static void q40_timer_int (int irq, void * dev, struct pt_regs * regs) { - - #if (HZ==100) ql_ticks = ql_ticks ? 0 : 1; if (sound_ticks) @@ -244,12 +240,12 @@ *DAC_LEFT=sval; *DAC_RIGHT=sval; } -#ifdef CONFIG_Q40RTC - if (rtc_irq_ctrl && (rtc_oldsecs != RTC_SECS)) +#if defined(CONFIG_Q40RTC) || defined(CONFIG_GEN_RTC) + if (gen_rtc_irq_ctrl && (q40rtc_oldsecs != RTC_SECS)) { - rtc_oldsecs = RTC_SECS; - rtc_irq_flags = RTC_UIE; - rtc_interrupt(); + q40rtc_oldsecs = RTC_SECS; + gen_rtc_irq_flags = RTC_UIE; + gen_rtc_interrupt(0); } #endif if (ql_ticks) return; @@ -322,16 +318,14 @@ static int ccleirq=60; /* ISA dev IRQ's*/ /*static int cclirq=60;*/ /* internal */ -/* FIX: add shared ints,mask,unmask,probing.... */ - +/* FIXME: add shared ints,mask,unmask,probing.... */ #define IRQ_INPROGRESS 1 /*static unsigned short saved_mask;*/ static int do_tint=0; #define DEBUG_Q40INT -#define IP_USE_DISABLE /* would be nice, but crashes ???? */ -/*static int dd_count=0;*/ +/*#define IP_USE_DISABLE *//* would be nice, but crashes ???? */ static int mext_disabled=0; /* ext irq disabled by master chip? */ static int aliased_irq=0; /* how many times inside handler ?*/ @@ -404,40 +398,36 @@ if ( disabled ) { #ifdef IP_USE_DISABLE - if (irq>4){ - disabled=0; - /*dd_count--;*/ - enable_irq(irq);} + if (irq>4){ + disabled=0; + enable_irq(irq);} #else - disabled=0; + disabled=0; /*printk("reenabling irq %d\n",irq); */ -#if 0 - fp->sr = ((fp->sr) & (~0x700)); /* unneeded ?! */ -#endif #endif } goto repeat; /* return; */ } } - if (mer && ccleirq>0 && !aliased_irq) + if (mer && ccleirq>0 && !aliased_irq) printk("ISA interrupt from unknown source? EIRQ_REG = %x\n",mer),ccleirq--; } iirq: - mir=master_inb(IIRQ_REG); - if (mir&IRQ_FRAME_MASK) + mir=master_inb(IIRQ_REG); + if (mir&IRQ_FRAME_MASK) { - do_tint++; - master_outb(-1,FRAME_CLEAR_REG); - } - for(;do_tint>0;do_tint--) - { - irq_tab[Q40_IRQ_FRAME].count++; - irq_tab[Q40_IRQ_FRAME].handler(Q40_IRQ_FRAME,irq_tab[Q40_IRQ_FRAME].dev_id,fp); - } - if (mir&IRQ_KEYB_MASK) /* may handle it even if actually disabled*/ - { - irq_tab[Q40_IRQ_KEYBOARD].count++; - irq_tab[Q40_IRQ_KEYBOARD].handler(Q40_IRQ_KEYBOARD,irq_tab[Q40_IRQ_KEYBOARD].dev_id,fp); + do_tint++; + master_outb(-1,FRAME_CLEAR_REG); + } + for(;do_tint>0;do_tint--) + { + irq_tab[Q40_IRQ_FRAME].count++; + irq_tab[Q40_IRQ_FRAME].handler(Q40_IRQ_FRAME,irq_tab[Q40_IRQ_FRAME].dev_id,fp); + } + if (mir&IRQ_KEYB_MASK) /* may handle it even if actually disabled*/ + { + irq_tab[Q40_IRQ_KEYBOARD].count++; + irq_tab[Q40_IRQ_KEYBOARD].handler(Q40_IRQ_KEYBOARD,irq_tab[Q40_IRQ_KEYBOARD].dev_id,fp); } } @@ -499,7 +489,7 @@ void q40_disable_irq (unsigned int irq) { /* disable ISA iqs : only do something if the driver has been - * verified to be Q40 "compatible" - right now only IDE + * verified to be Q40 "compatible" - right now IDE, NE2K * Any driver should not attempt to sleep accross disable_irq !! */ |
From: Andy P. <at...@us...> - 2002-04-10 18:33:03
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/sparc64/boot In directory usw-pr-cvs1:/tmp/cvs-serv32333/sparc64/boot Modified Files: Makefile piggyback.c Log Message: synch 2.4.15 commit 46 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/boot/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: piggyback.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/boot/piggyback.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 |
From: Andy P. <at...@us...> - 2002-04-10 18:33:00
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/isdn/divert In directory usw-pr-cvs1:/tmp/cvs-serv1502/isdn/divert Modified Files: divert_init.c divert_procfs.c isdn_divert.c isdn_divert.h Log Message: synch 2.4.15 commit 49 Index: divert_init.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/divert/divert_init.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- divert_init.c 14 Jan 2001 18:44:11 -0000 1.1.1.1 +++ divert_init.c 10 Apr 2002 15:32:23 -0000 1.2 @@ -1,30 +1,23 @@ -/* - * $Id$ +/* $Id divert_init.c,v 1.5.6.2 2001/01/24 22:18:17 kai Exp $ * * Module init for DSS1 diversion services for i4l. * * Copyright 1999 by Werner Cornelius (we...@is...) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * */ #include <linux/module.h> #include <linux/version.h> +#include <linux/init.h> #include "isdn_divert.h" +MODULE_DESCRIPTION("ISDN4Linux: Call diversion support"); +MODULE_AUTHOR("Werner Cornelius"); +MODULE_LICENSE("GPL"); + /********************/ /* needed externals */ /********************/ @@ -46,7 +39,7 @@ /* Module interface code */ /* no cmd line parms */ /*************************/ -int init_module(void) +static int __init divert_init(void) { int i; if (divert_dev_init()) @@ -63,13 +56,13 @@ #endif printk(KERN_INFO "dss1_divert module successfully installed\n"); return(0); -} /* init_module */ +} /**********************/ /* Module deinit code */ /**********************/ -void cleanup_module(void) -{ int flags; +static void __exit divert_exit(void) +{ unsigned long flags; int i; save_flags(flags); @@ -89,6 +82,8 @@ deleterule(-1); /* delete all rules and free mem */ deleteprocs(); printk(KERN_INFO "dss1_divert module successfully removed \n"); -} /* cleanup_module */ +} +module_init(divert_init); +module_exit(divert_exit); Index: divert_procfs.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/divert/divert_procfs.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- divert_procfs.c 14 Jan 2001 18:44:12 -0000 1.1.1.1 +++ divert_procfs.c 10 Apr 2002 15:32:23 -0000 1.2 @@ -1,23 +1,11 @@ -/* - * $Id$ +/* $Id$ * * Filesystem handling for the diversion supplementary services. * * Copyright 1998 by Werner Cornelius (we...@is...) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * */ @@ -50,7 +38,7 @@ put_info_buffer(char *cp) { struct divert_info *ib; - int flags; + unsigned long flags; if (if_used <= 0) return; @@ -145,7 +133,7 @@ static int isdn_divert_open(struct inode *ino, struct file *filep) { - int flags; + unsigned long flags; lock_kernel(); save_flags(flags); @@ -168,7 +156,7 @@ isdn_divert_close(struct inode *ino, struct file *filep) { struct divert_info *inf; - int flags; + unsigned long flags; lock_kernel(); save_flags(flags); @@ -198,7 +186,8 @@ uint cmd, ulong arg) { divert_ioctl dioctl; - int i, flags; + int i; + unsigned long flags; divert_rule *rulep; char *cp; @@ -276,15 +265,9 @@ #ifdef CONFIG_PROC_FS -static loff_t -isdn_divert_lseek(struct file *file, loff_t offset, int orig) -{ - return -ESPIPE; -} - static struct file_operations isdn_fops = { - llseek: isdn_divert_lseek, + llseek: no_llseek, read: isdn_divert_read, write: isdn_divert_write, poll: isdn_divert_poll, Index: isdn_divert.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/divert/isdn_divert.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- isdn_divert.c 25 Feb 2001 23:15:10 -0000 1.1.1.2 +++ isdn_divert.c 10 Apr 2002 15:32:23 -0000 1.2 @@ -1,30 +1,14 @@ -/* - * $Id$ +/* $Id$ * * DSS1 main diversion supplementary handling for i4l. * * Copyright 1999 by Werner Cornelius (we...@is...) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * */ - - -#define __NO_VERSION__ -#include <linux/module.h> #include <linux/version.h> #include <linux/proc_fs.h> #include "isdn_divert.h" @@ -67,7 +51,7 @@ /* timer callback function */ /***************************/ static void deflect_timer_expire(ulong arg) -{ int flags; +{ unsigned long flags; struct call_struc *cs = (struct call_struc *) arg; save_flags(flags); @@ -125,7 +109,8 @@ int cf_command(int drvid, int mode, u_char proc, char *msn, u_char service, char *fwd_nr, ulong *procid) -{ int retval,msnlen,flags; +{ unsigned long flags; + int retval,msnlen; int fwd_len; char *p,*ielenp,tmp[60]; struct call_struc *cs; @@ -220,7 +205,7 @@ int deflect_extern_action(u_char cmd, ulong callid, char *to_nr) { struct call_struc *cs; isdn_ctrl ic; - int flags; + unsigned long flags; int i; if ((cmd & 0x7F) > 2) return(-EINVAL); /* invalid command */ @@ -290,8 +275,8 @@ /* insert a new rule before idx */ /********************************/ int insertrule(int idx, divert_rule *newrule) -{ struct deflect_struc *ds,*ds1; - int flags; +{ struct deflect_struc *ds,*ds1=NULL; + unsigned long flags; if (!(ds = (struct deflect_struc *) kmalloc(sizeof(struct deflect_struc), GFP_KERNEL))) @@ -337,7 +322,7 @@ /***********************************/ int deleterule(int idx) { struct deflect_struc *ds,*ds1; - int flags; + unsigned long flags; if (idx < 0) { save_flags(flags); @@ -405,7 +390,7 @@ /*************************************************/ int isdn_divert_icall(isdn_ctrl *ic) { int retval = 0; - int flags; + unsigned long flags; struct call_struc *cs = NULL; struct deflect_struc *dv; char *p,*p1; @@ -557,7 +542,7 @@ void deleteprocs(void) { struct call_struc *cs, *cs1; - int flags; + unsigned long flags; save_flags(flags); cli(); @@ -714,7 +699,8 @@ /*********************************************/ int prot_stat_callback(isdn_ctrl *ic) { struct call_struc *cs, *cs1; - int i,flags; + int i; + unsigned long flags; cs = divert_head; /* start of list */ cs1 = NULL; @@ -805,7 +791,8 @@ /***************************/ int isdn_divert_stat_callback(isdn_ctrl *ic) { struct call_struc *cs, *cs1; - int flags, retval; + unsigned long flags; + int retval; retval = -1; cs = divert_head; /* start of list */ Index: isdn_divert.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/divert/isdn_divert.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- isdn_divert.h 14 Jan 2001 18:44:16 -0000 1.1.1.1 +++ isdn_divert.h 10 Apr 2002 15:32:23 -0000 1.2 @@ -1,26 +1,13 @@ -/* - * $Id$ +/* $Id$ * * Header for the diversion supplementary ioctl interface. * * Copyright 1998 by Werner Cornelius (we...@ik...) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * */ - #include <linux/ioctl.h> #include <linux/types.h> |
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu In directory usw-pr-cvs1:/tmp/cvs-serv25860/ppc/math-emu Modified Files: Makefile double.h fabs.c fadd.c fadds.c fcmpo.c fcmpu.c fctiw.c fctiwz.c fdiv.c fdivs.c fmadd.c fmadds.c fmr.c fmsub.c fmsubs.c fmul.c fmuls.c fnabs.c fneg.c fnmadd.c fnmadds.c fnmsub.c fnmsubs.c fres.c frsp.c frsqrte.c fsel.c fsqrt.c fsqrts.c fsub.c fsubs.c lfd.c lfs.c math.c mcrfs.c mffs.c mtfsb0.c mtfsb1.c mtfsf.c mtfsfi.c op-1.h op-2.h op-4.h op-common.h sfp-machine.h single.h soft-fp.h stfd.c stfiwx.c stfs.c types.c udivmodti4.c Log Message: synch 2.4.15 commit 43 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 14 Jan 2001 19:33:40 -0000 1.1.1.1 +++ Makefile 10 Apr 2002 15:04:10 -0000 1.2 @@ -1,3 +1,5 @@ +# BK Id: SCCS/s.Makefile 1.3 05/17/01 18:14:22 cort +# # # # Index: double.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/double.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- double.h 14 Jan 2001 19:33:41 -0000 1.1.1.1 +++ double.h 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,4 +1,7 @@ /* + * BK Id: SCCS/s.double.h 1.5 05/17/01 18:14:22 cort + */ +/* * Definitions for IEEE Double Precision */ Index: fabs.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fabs.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fabs.c 14 Jan 2001 19:33:41 -0000 1.1.1.1 +++ fabs.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fabs.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fadd.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fadd.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fadd.c 14 Jan 2001 19:33:41 -0000 1.1.1.1 +++ fadd.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fadd.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fadds.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fadds.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fadds.c 14 Jan 2001 19:33:41 -0000 1.1.1.1 +++ fadds.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fadds.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fcmpo.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fcmpo.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fcmpo.c 14 Jan 2001 19:33:41 -0000 1.1.1.1 +++ fcmpo.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fcmpo.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fcmpu.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fcmpu.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fcmpu.c 14 Jan 2001 19:33:42 -0000 1.1.1.1 +++ fcmpu.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fcmpu.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fctiw.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fctiw.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fctiw.c 14 Jan 2001 19:33:42 -0000 1.1.1.1 +++ fctiw.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fctiw.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fctiwz.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fctiwz.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fctiwz.c 14 Jan 2001 19:33:42 -0000 1.1.1.1 +++ fctiwz.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fctiwz.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fdiv.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fdiv.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fdiv.c 14 Jan 2001 19:33:42 -0000 1.1.1.1 +++ fdiv.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fdiv.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fdivs.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fdivs.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fdivs.c 14 Jan 2001 19:33:42 -0000 1.1.1.1 +++ fdivs.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fdivs.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fmadd.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fmadd.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fmadd.c 14 Jan 2001 19:33:42 -0000 1.1.1.1 +++ fmadd.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fmadd.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fmadds.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fmadds.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fmadds.c 14 Jan 2001 19:33:42 -0000 1.1.1.1 +++ fmadds.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fmadds.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fmr.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fmr.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fmr.c 14 Jan 2001 19:33:42 -0000 1.1.1.1 +++ fmr.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fmr.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fmsub.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fmsub.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fmsub.c 14 Jan 2001 19:33:42 -0000 1.1.1.1 +++ fmsub.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fmsub.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fmsubs.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fmsubs.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fmsubs.c 14 Jan 2001 19:33:43 -0000 1.1.1.1 +++ fmsubs.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fmsubs.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fmul.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fmul.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fmul.c 14 Jan 2001 19:33:43 -0000 1.1.1.1 +++ fmul.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fmul.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fmuls.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fmuls.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fmuls.c 14 Jan 2001 19:33:43 -0000 1.1.1.1 +++ fmuls.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fmuls.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fnabs.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fnabs.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fnabs.c 14 Jan 2001 19:33:43 -0000 1.1.1.1 +++ fnabs.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fnabs.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fneg.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fneg.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fneg.c 14 Jan 2001 19:33:43 -0000 1.1.1.1 +++ fneg.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fneg.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fnmadd.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fnmadd.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fnmadd.c 14 Jan 2001 19:33:43 -0000 1.1.1.1 +++ fnmadd.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fnmadd.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fnmadds.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fnmadds.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fnmadds.c 14 Jan 2001 19:33:43 -0000 1.1.1.1 +++ fnmadds.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fnmadds.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fnmsub.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fnmsub.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fnmsub.c 14 Jan 2001 19:33:43 -0000 1.1.1.1 +++ fnmsub.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fnmsub.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fnmsubs.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fnmsubs.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fnmsubs.c 14 Jan 2001 19:33:43 -0000 1.1.1.1 +++ fnmsubs.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fnmsubs.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fres.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fres.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fres.c 14 Jan 2001 19:33:44 -0000 1.1.1.1 +++ fres.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fres.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: frsp.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/frsp.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- frsp.c 14 Jan 2001 19:33:44 -0000 1.1.1.1 +++ frsp.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.frsp.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: frsqrte.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/frsqrte.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- frsqrte.c 14 Jan 2001 19:33:44 -0000 1.1.1.1 +++ frsqrte.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.frsqrte.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fsel.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fsel.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fsel.c 14 Jan 2001 19:33:44 -0000 1.1.1.1 +++ fsel.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fsel.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fsqrt.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fsqrt.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fsqrt.c 14 Jan 2001 19:33:44 -0000 1.1.1.1 +++ fsqrt.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fsqrt.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fsqrts.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fsqrts.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fsqrts.c 14 Jan 2001 19:33:44 -0000 1.1.1.1 +++ fsqrts.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fsqrts.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fsub.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fsub.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fsub.c 14 Jan 2001 19:33:44 -0000 1.1.1.1 +++ fsub.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fsub.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: fsubs.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/fsubs.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fsubs.c 14 Jan 2001 19:33:44 -0000 1.1.1.1 +++ fsubs.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.fsubs.c 1.6 05/17/01 18:14:22 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: lfd.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/lfd.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- lfd.c 14 Jan 2001 19:33:44 -0000 1.1.1.1 +++ lfd.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.lfd.c 1.6 05/17/01 18:14:23 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: lfs.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/lfs.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- lfs.c 14 Jan 2001 19:33:44 -0000 1.1.1.1 +++ lfs.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.lfs.c 1.6 05/17/01 18:14:23 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: math.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/math.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- math.c 14 Jan 2001 19:33:46 -0000 1.1.1.1 +++ math.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,4 +1,7 @@ -/* $Id$ +/* + * BK Id: SCCS/s.math.c 1.6 05/17/01 18:14:23 cort + */ +/* * arch/ppc/math-emu/math.c * * Copyright (C) 1999 Eddie C. Dost (ec...@at...) Index: mcrfs.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/mcrfs.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- mcrfs.c 14 Jan 2001 19:33:46 -0000 1.1.1.1 +++ mcrfs.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.mcrfs.c 1.6 05/17/01 18:14:23 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: mffs.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/mffs.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- mffs.c 14 Jan 2001 19:33:46 -0000 1.1.1.1 +++ mffs.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.mffs.c 1.6 05/17/01 18:14:23 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: mtfsb0.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/mtfsb0.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- mtfsb0.c 14 Jan 2001 19:33:46 -0000 1.1.1.1 +++ mtfsb0.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.mtfsb0.c 1.6 05/17/01 18:14:23 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: mtfsb1.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/mtfsb1.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- mtfsb1.c 14 Jan 2001 19:33:46 -0000 1.1.1.1 +++ mtfsb1.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.mtfsb1.c 1.6 05/17/01 18:14:23 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: mtfsf.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/mtfsf.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- mtfsf.c 14 Jan 2001 19:33:46 -0000 1.1.1.1 +++ mtfsf.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.mtfsf.c 1.6 05/17/01 18:14:23 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: mtfsfi.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/mtfsfi.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- mtfsfi.c 14 Jan 2001 19:33:46 -0000 1.1.1.1 +++ mtfsfi.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.mtfsfi.c 1.6 05/17/01 18:14:23 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: op-1.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/op-1.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- op-1.h 14 Jan 2001 19:33:47 -0000 1.1.1.1 +++ op-1.h 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,4 +1,7 @@ /* + * BK Id: SCCS/s.op-1.h 1.5 05/17/01 18:14:23 cort + */ +/* * Basic one-word fraction declaration and manipulation. */ Index: op-2.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/op-2.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- op-2.h 14 Jan 2001 19:33:49 -0000 1.1.1.1 +++ op-2.h 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,4 +1,7 @@ /* + * BK Id: SCCS/s.op-2.h 1.5 05/17/01 18:14:23 cort + */ +/* * Basic two-word fraction declaration and manipulation. */ Index: op-4.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/op-4.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- op-4.h 14 Jan 2001 19:33:51 -0000 1.1.1.1 +++ op-4.h 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,4 +1,7 @@ /* + * BK Id: SCCS/s.op-4.h 1.5 05/17/01 18:14:23 cort + */ +/* * Basic four-word fraction declaration and manipulation. * * When adding quadword support for 32 bit machines, we need Index: op-common.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/op-common.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- op-common.h 14 Jan 2001 19:33:54 -0000 1.1.1.1 +++ op-common.h 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,3 +1,6 @@ +/* + * BK Id: SCCS/s.op-common.h 1.5 05/17/01 18:14:23 cort + */ #define _FP_DECL(wc, X) \ _FP_I_TYPE X##_c, X##_s, X##_e; \ Index: sfp-machine.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/sfp-machine.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- sfp-machine.h 14 Jan 2001 19:33:55 -0000 1.1.1.1 +++ sfp-machine.h 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,3 +1,6 @@ +/* + * BK Id: SCCS/s.sfp-machine.h 1.5 05/17/01 18:14:23 cort + */ /* Machine-dependent software floating-point definitions. PPC version. Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Index: single.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/single.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- single.h 14 Jan 2001 19:33:56 -0000 1.1.1.1 +++ single.h 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,4 +1,7 @@ /* + * BK Id: SCCS/s.single.h 1.5 05/17/01 18:14:23 cort + */ +/* * Definitions for IEEE Single Precision */ Index: soft-fp.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/soft-fp.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- soft-fp.h 14 Jan 2001 19:33:56 -0000 1.1.1.1 +++ soft-fp.h 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,3 +1,6 @@ +/* + * BK Id: SCCS/s.soft-fp.h 1.5 05/17/01 18:14:23 cort + */ #ifndef SOFT_FP_H #define SOFT_FP_H Index: stfd.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/stfd.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- stfd.c 14 Jan 2001 19:33:56 -0000 1.1.1.1 +++ stfd.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.stfd.c 1.6 05/17/01 18:14:23 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: stfiwx.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/stfiwx.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- stfiwx.c 14 Jan 2001 19:33:56 -0000 1.1.1.1 +++ stfiwx.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.stfiwx.c 1.6 05/17/01 18:14:23 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: stfs.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/stfs.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- stfs.c 14 Jan 2001 19:33:56 -0000 1.1.1.1 +++ stfs.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,6 +1,6 @@ -/* $Id$ +/* + * BK Id: SCCS/s.stfs.c 1.6 05/17/01 18:14:23 cort */ - #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> Index: types.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/types.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- types.c 14 Jan 2001 19:33:56 -0000 1.1.1.1 +++ types.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,3 +1,6 @@ +/* + * BK Id: SCCS/s.types.c 1.5 05/17/01 18:14:23 cort + */ #include "soft-fp.h" #include "double.h" Index: udivmodti4.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/math-emu/udivmodti4.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- udivmodti4.c 14 Jan 2001 19:33:57 -0000 1.1.1.1 +++ udivmodti4.c 10 Apr 2002 15:04:11 -0000 1.2 @@ -1,3 +1,6 @@ +/* + * BK Id: SCCS/s.udivmodti4.c 1.5 05/17/01 18:14:23 cort + */ /* This has so very few changes over libgcc2's __udivmoddi4 it isn't funny. */ #include "soft-fp.h" |
From: Andy P. <at...@us...> - 2002-04-10 18:32:48
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/alpha/mm In directory usw-pr-cvs1:/tmp/cvs-serv19209/alpha/mm Modified Files: Makefile extable.c fault.c init.c Added Files: numa.c Log Message: synch 2.4.15 commit 31 --- NEW FILE --- /* * linux/arch/alpha/mm/numa.c * * DISCONTIGMEM NUMA alpha support. * * Copyright (C) 2001 Andrea Arcangeli <an...@su...> SuSE */ #include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/bootmem.h> #include <linux/swap.h> #ifdef CONFIG_BLK_DEV_INITRD #include <linux/blk.h> #endif #include <asm/hwrpb.h> #include <asm/pgalloc.h> plat_pg_data_t *plat_node_data[MAX_NUMNODES]; bootmem_data_t plat_node_bdata[MAX_NUMNODES]; #undef DEBUG_DISCONTIG #ifdef DEBUG_DISCONTIG #define DBGDCONT(args...) printk(args) #else #define DBGDCONT(args...) #endif #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) #define PFN_PHYS(x) ((x) << PAGE_SHIFT) #define for_each_mem_cluster(memdesc, cluster, i) \ for ((cluster) = (memdesc)->cluster, (i) = 0; \ (i) < (memdesc)->numclusters; (i)++, (cluster)++) static void __init show_mem_layout(void) { struct memclust_struct * cluster; struct memdesc_struct * memdesc; int i; /* Find free clusters, and init and free the bootmem accordingly. */ memdesc = (struct memdesc_struct *) (hwrpb->mddt_offset + (unsigned long) hwrpb); printk("Raw memory layout:\n"); for_each_mem_cluster(memdesc, cluster, i) { printk(" memcluster %2d, usage %1lx, start %8lu, end %8lu\n", i, cluster->usage, cluster->start_pfn, cluster->start_pfn + cluster->numpages); } } static void __init setup_memory_node(int nid, void *kernel_end) { extern unsigned long mem_size_limit; struct memclust_struct * cluster; struct memdesc_struct * memdesc; unsigned long start_kernel_pfn, end_kernel_pfn; unsigned long bootmap_size, bootmap_pages, bootmap_start; unsigned long start, end; unsigned long node_pfn_start, node_pfn_end; int i; unsigned long node_datasz = PFN_UP(sizeof(plat_pg_data_t)); int show_init = 0; /* Find the bounds of current node */ node_pfn_start = (nid * NODE_MAX_MEM_SIZE) >> PAGE_SHIFT; node_pfn_end = node_pfn_start + (NODE_MAX_MEM_SIZE >> PAGE_SHIFT); /* Find free clusters, and init and free the bootmem accordingly. */ memdesc = (struct memdesc_struct *) (hwrpb->mddt_offset + (unsigned long) hwrpb); /* find the bounds of this node (min_low_pfn/max_low_pfn) */ min_low_pfn = ~0UL; for_each_mem_cluster(memdesc, cluster, i) { /* Bit 0 is console/PALcode reserved. Bit 1 is non-volatile memory -- we might want to mark this for later. */ if (cluster->usage & 3) continue; start = cluster->start_pfn; end = start + cluster->numpages; if (start >= node_pfn_end || end <= node_pfn_start) continue; if (!show_init) { show_init = 1; printk("Initialing bootmem allocator on Node ID %d\n", nid); } printk(" memcluster %2d, usage %1lx, start %8lu, end %8lu\n", i, cluster->usage, cluster->start_pfn, cluster->start_pfn + cluster->numpages); if (start < node_pfn_start) start = node_pfn_start; if (end > node_pfn_end) end = node_pfn_end; if (start < min_low_pfn) min_low_pfn = start; if (end > max_low_pfn) max_low_pfn = end; } if (mem_size_limit && max_low_pfn >= mem_size_limit) { printk("setup: forcing memory size to %ldK (from %ldK).\n", mem_size_limit << (PAGE_SHIFT - 10), max_low_pfn << (PAGE_SHIFT - 10)); max_low_pfn = mem_size_limit; } if (min_low_pfn >= max_low_pfn) return; num_physpages += max_low_pfn - min_low_pfn; /* Cute trick to make sure our local node data is on local memory */ PLAT_NODE_DATA(nid) = (plat_pg_data_t *)(__va(min_low_pfn << PAGE_SHIFT)); /* Quasi-mark the plat_pg_data_t as in-use */ min_low_pfn += node_datasz; if (min_low_pfn >= max_low_pfn) { printk(" not enough mem to reserve PLAT_NODE_DATA"); return; } NODE_DATA(nid)->bdata = &plat_node_bdata[nid]; printk(" Detected node memory: start %8lu, end %8lu\n", min_low_pfn, max_low_pfn); DBGDCONT(" DISCONTIG: plat_node_data[%d] is at 0x%p\n", nid, PLAT_NODE_DATA(nid)); DBGDCONT(" DISCONTIG: NODE_DATA(%d)->bdata is at 0x%p\n", nid, NODE_DATA(nid)->bdata); /* Find the bounds of kernel memory. */ start_kernel_pfn = PFN_DOWN(KERNEL_START_PHYS); end_kernel_pfn = PFN_UP(virt_to_phys(kernel_end)); bootmap_start = -1; if (!nid && (max_low_pfn < end_kernel_pfn || min_low_pfn > start_kernel_pfn)) panic("kernel loaded out of ram"); /* Zone start phys-addr must be 2^(MAX_ORDER-1) aligned */ min_low_pfn = (min_low_pfn + ((1UL << (MAX_ORDER-1))-1)) & ~((1UL << (MAX_ORDER-1))-1); /* We need to know how many physically contiguous pages we'll need for the bootmap. */ bootmap_pages = bootmem_bootmap_pages(max_low_pfn-min_low_pfn); /* Now find a good region where to allocate the bootmap. */ for_each_mem_cluster(memdesc, cluster, i) { if (cluster->usage & 3) continue; start = cluster->start_pfn; end = start + cluster->numpages; if (start >= max_low_pfn || end <= min_low_pfn) continue; if (end > max_low_pfn) end = max_low_pfn; if (start < min_low_pfn) start = min_low_pfn; if (start < start_kernel_pfn) { if (end > end_kernel_pfn && end - end_kernel_pfn >= bootmap_pages) { bootmap_start = end_kernel_pfn; break; } else if (end > start_kernel_pfn) end = start_kernel_pfn; } else if (start < end_kernel_pfn) start = end_kernel_pfn; if (end - start >= bootmap_pages) { bootmap_start = start; break; } } if (bootmap_start == -1) panic("couldn't find a contigous place for the bootmap"); /* Allocate the bootmap and mark the whole MM as reserved. */ bootmap_size = init_bootmem_node(NODE_DATA(nid), bootmap_start, min_low_pfn, max_low_pfn); DBGDCONT(" bootmap_start %lu, bootmap_size %lu, bootmap_pages %lu\n", bootmap_start, bootmap_size, bootmap_pages); /* Mark the free regions. */ for_each_mem_cluster(memdesc, cluster, i) { if (cluster->usage & 3) continue; start = cluster->start_pfn; end = cluster->start_pfn + cluster->numpages; if (start >= max_low_pfn || end <= min_low_pfn) continue; if (end > max_low_pfn) end = max_low_pfn; if (start < min_low_pfn) start = min_low_pfn; if (start < start_kernel_pfn) { if (end > end_kernel_pfn) { free_bootmem_node(NODE_DATA(nid), PFN_PHYS(start), (PFN_PHYS(start_kernel_pfn) - PFN_PHYS(start))); printk(" freeing pages %ld:%ld\n", start, start_kernel_pfn); start = end_kernel_pfn; } else if (end > start_kernel_pfn) end = start_kernel_pfn; } else if (start < end_kernel_pfn) start = end_kernel_pfn; if (start >= end) continue; free_bootmem_node(NODE_DATA(nid), PFN_PHYS(start), PFN_PHYS(end) - PFN_PHYS(start)); printk(" freeing pages %ld:%ld\n", start, end); } /* Reserve the bootmap memory. */ reserve_bootmem_node(NODE_DATA(nid), PFN_PHYS(bootmap_start), bootmap_size); printk(" reserving pages %ld:%ld\n", bootmap_start, bootmap_start+PFN_UP(bootmap_size)); numnodes++; } void __init setup_memory(void *kernel_end) { int nid; show_mem_layout(); numnodes = 0; for (nid = 0; nid < MAX_NUMNODES; nid++) setup_memory_node(nid, kernel_end); #ifdef CONFIG_BLK_DEV_INITRD initrd_start = INITRD_START; if (initrd_start) { initrd_end = initrd_start+INITRD_SIZE; printk("Initial ramdisk at: 0x%p (%lu bytes)\n", (void *) initrd_start, INITRD_SIZE); if ((void *)initrd_end > phys_to_virt(PFN_PHYS(max_low_pfn))) { printk("initrd extends beyond end of memory " "(0x%08lx > 0x%p)\ndisabling initrd\n", initrd_end, phys_to_virt(PFN_PHYS(max_low_pfn))); initrd_start = initrd_end = 0; } else { reserve_bootmem_node(NODE_DATA(KVADDR_TO_NID(initrd_start)), virt_to_phys((void *)initrd_start), INITRD_SIZE); } } #endif /* CONFIG_BLK_DEV_INITRD */ } void __init paging_init(void) { unsigned int nid; unsigned long zones_size[MAX_NR_ZONES] = {0, }; unsigned long dma_local_pfn; /* * The old global MAX_DMA_ADDRESS per-arch API doesn't fit * in the NUMA model, for now we convert it to a pfn and * we interpret this pfn as a local per-node information. * This issue isn't very important since none of these machines * have legacy ISA slots anyways. */ dma_local_pfn = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; for (nid = 0; nid < numnodes; nid++) { unsigned long start_pfn = plat_node_bdata[nid].node_boot_start >> PAGE_SHIFT; unsigned long end_pfn = plat_node_bdata[nid].node_low_pfn; unsigned long lmax_mapnr; if (dma_local_pfn >= end_pfn - start_pfn) zones_size[ZONE_DMA] = end_pfn - start_pfn; else { zones_size[ZONE_DMA] = dma_local_pfn; zones_size[ZONE_NORMAL] = (end_pfn - start_pfn) - dma_local_pfn; } free_area_init_node(nid, NODE_DATA(nid), NULL, zones_size, start_pfn<<PAGE_SHIFT, NULL); lmax_mapnr = PLAT_NODE_DATA_STARTNR(nid) + PLAT_NODE_DATA_SIZE(nid); if (lmax_mapnr > max_mapnr) { max_mapnr = lmax_mapnr; DBGDCONT("Grow max_mapnr to %ld\n", max_mapnr); } } /* Initialize the kernel's ZERO_PGE. */ memset((void *)ZERO_PGE, 0, PAGE_SIZE); } #define printkdot() \ do { \ if (!(i++ % ((100UL*1024*1024)>>PAGE_SHIFT))) \ printk("."); \ } while(0) #define clobber(p, size) memset((p)->virtual, 0xaa, (size)) void __init mem_stress(void) { LIST_HEAD(x); LIST_HEAD(xx); struct page * p; unsigned long i = 0; printk("starting memstress"); while ((p = alloc_pages(GFP_ATOMIC, 1))) { clobber(p, PAGE_SIZE*2); list_add(&p->list, &x); printkdot(); } while ((p = alloc_page(GFP_ATOMIC))) { clobber(p, PAGE_SIZE); list_add(&p->list, &xx); printkdot(); } while (!list_empty(&x)) { p = list_entry(x.next, struct page, list); clobber(p, PAGE_SIZE*2); list_del(x.next); __free_pages(p, 1); printkdot(); } while (!list_empty(&xx)) { p = list_entry(xx.next, struct page, list); clobber(p, PAGE_SIZE); list_del(xx.next); __free_pages(p, 0); printkdot(); } printk("I'm still alive duh!\n"); } #undef printkdot #undef clobber void __init mem_init(void) { unsigned long codesize, reservedpages, datasize, initsize, pfn; extern int page_is_ram(unsigned long) __init; extern char _text, _etext, _data, _edata; extern char __init_begin, __init_end; extern unsigned long totalram_pages; unsigned long nid, i; mem_map_t * lmem_map; high_memory = (void *) __va(max_mapnr <<PAGE_SHIFT); reservedpages = 0; for (nid = 0; nid < numnodes; nid++) { /* * This will free up the bootmem, ie, slot 0 memory */ totalram_pages += free_all_bootmem_node(NODE_DATA(nid)); lmem_map = NODE_MEM_MAP(nid); pfn = NODE_DATA(nid)->node_start_paddr >> PAGE_SHIFT; for (i = 0; i < PLAT_NODE_DATA_SIZE(nid); i++, pfn++) if (page_is_ram(pfn) && PageReserved(lmem_map+i)) reservedpages++; } codesize = (unsigned long) &_etext - (unsigned long) &_text; datasize = (unsigned long) &_edata - (unsigned long) &_data; initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; printk("Memory: %luk/%luk available (%luk kernel code, %luk reserved, " "%luk data, %luk init)\n", nr_free_pages() << (PAGE_SHIFT-10), num_physpages << (PAGE_SHIFT-10), codesize >> 10, reservedpages << (PAGE_SHIFT-10), datasize >> 10, initsize >> 10); #if 0 mem_stress(); #endif } void show_mem(void) { long i,free = 0,total = 0,reserved = 0; long shared = 0, cached = 0; int nid; printk("\nMem-info:\n"); show_free_areas(); printk("Free swap: %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10)); for (nid = 0; nid < numnodes; nid++) { mem_map_t * lmem_map = NODE_MEM_MAP(nid); i = PLAT_NODE_DATA_SIZE(nid); while (i-- > 0) { total++; if (PageReserved(lmem_map+i)) reserved++; else if (PageSwapCache(lmem_map+i)) cached++; else if (!page_count(lmem_map+i)) free++; else shared += atomic_read(&lmem_map[i].count) - 1; } } printk("%ld pages of RAM\n",total); printk("%ld free pages\n",free); printk("%ld reserved pages\n",reserved); printk("%ld pages shared\n",shared); printk("%ld pages swap cached\n",cached); printk("%ld pages in page table cache\n",pgtable_cache_size); show_buffers(); } Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/mm/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 14 Jan 2001 19:22:57 -0000 1.1.1.1 +++ Makefile 10 Apr 2002 13:07:23 -0000 1.2 @@ -7,9 +7,10 @@ # # Note 2! The CFLAGS definition is now in the main makefile... -OBJS = init.o fault.o extable.o +O_TARGET := mm.o -mm.o: $(OBJS) - $(LD) -r -o mm.o $(OBJS) +obj-y := init.o fault.o extable.o + +obj-$(CONFIG_DISCONTIGMEM) += numa.o include $(TOPDIR)/Rules.make Index: extable.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/mm/extable.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- extable.c 14 Jan 2001 19:23:00 -0000 1.1.1.1 +++ extable.c 10 Apr 2002 13:07:23 -0000 1.2 @@ -45,20 +45,26 @@ /* There is only the kernel to search. */ ret = search_one_table(__start___ex_table, __stop___ex_table - 1, addr - gp); - if (ret) return ret; #else + extern spinlock_t modlist_lock; + unsigned long flags; /* The kernel is the last "module" -- no need to treat it special. */ struct module *mp; + + ret = 0; + spin_lock_irqsave(&modlist_lock, flags); for (mp = module_list; mp ; mp = mp->next) { - if (!mp->ex_table_start) + if (!mp->ex_table_start || !(mp->flags&(MOD_RUNNING|MOD_INITIALIZING))) continue; ret = search_one_table(mp->ex_table_start, mp->ex_table_end - 1, addr - mp->gp); - if (ret) return ret; + if (ret) + break; } + spin_unlock_irqrestore(&modlist_lock, flags); #endif - return 0; + return ret; } unsigned @@ -71,15 +77,23 @@ addr - exc_gp); if (ret) return ret; #else + extern spinlock_t modlist_lock; + unsigned long flags; /* The kernel is the last "module" -- no need to treat it special. */ struct module *mp; + + ret = 0; + spin_lock_irqsave(&modlist_lock, flags); for (mp = module_list; mp ; mp = mp->next) { - if (!mp->ex_table_start) + if (!mp->ex_table_start || !(mp->flags&(MOD_RUNNING|MOD_INITIALIZING))) continue; ret = search_one_table(mp->ex_table_start, mp->ex_table_end - 1, addr - exc_gp); - if (ret) return ret; + if (ret) + break; } + spin_unlock_irqrestore(&modlist_lock, flags); + if (ret) return ret; #endif /* Index: fault.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/mm/fault.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fault.c 14 Jan 2001 19:22:58 -0000 1.1.1.1 +++ fault.c 10 Apr 2002 13:07:23 -0000 1.2 @@ -113,7 +113,7 @@ goto vmalloc_fault; #endif - down(&mm->mmap_sem); + down_read(&mm->mmap_sem); vma = find_vma(mm, address); if (!vma) goto bad_area; @@ -140,13 +140,14 @@ goto bad_area; } + survive: /* * If for any reason at all we couldn't handle the fault, * make sure we exit gracefully rather than endlessly redo * the fault. */ fault = handle_mm_fault(mm, vma, address, cause > 0); - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); if (fault < 0) goto out_of_memory; @@ -160,7 +161,7 @@ * Fix it, but check if it's kernel or user first.. */ bad_area: - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); if (user_mode(regs)) { force_sig(SIGSEGV, current); @@ -194,6 +195,12 @@ * us unable to handle the page fault gracefully. */ out_of_memory: + if (current->pid == 1) { + current->policy |= SCHED_YIELD; + schedule(); + down_read(&mm->mmap_sem); + goto survive; + } printk(KERN_ALERT "VM: killing process %s(%d)\n", current->comm, current->pid); if (!user_mode(regs)) Index: init.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/mm/init.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- init.c 14 Jan 2001 19:22:59 -0000 1.1.1.1 +++ init.c 10 Apr 2002 13:07:23 -0000 1.2 @@ -32,8 +32,11 @@ #include <asm/dma.h> #include <asm/mmu_context.h> #include <asm/console.h> +#include <asm/tlb.h> -static unsigned long totalram_pages; +mmu_gather_t mmu_gathers[NR_CPUS]; + +unsigned long totalram_pages; extern void die_if_kernel(char *,struct pt_regs *,long); @@ -43,20 +46,6 @@ struct pgtable_cache_struct quicklists; #endif -void -__bad_pmd(pgd_t *pgd) -{ - printk("Bad pgd in pmd_alloc: %08lx\n", pgd_val(*pgd)); - pgd_set(pgd, BAD_PAGETABLE); -} - -void -__bad_pte(pmd_t *pmd) -{ - printk("Bad pmd in pte_alloc: %08lx\n", pmd_val(*pmd)); - pmd_set(pmd, (pte_t *) BAD_PAGETABLE); -} - pgd_t * get_pgd_slow(void) { @@ -80,66 +69,26 @@ return ret; } -pmd_t * -get_pmd_slow(pgd_t *pgd, unsigned long offset) -{ - pmd_t *pmd; - - pmd = (pmd_t *) __get_free_page(GFP_KERNEL); - if (pgd_none(*pgd)) { - if (pmd) { - clear_page((void *)pmd); - pgd_set(pgd, pmd); - return pmd + offset; - } - pgd_set(pgd, BAD_PAGETABLE); - return NULL; - } - free_page((unsigned long)pmd); - if (pgd_bad(*pgd)) { - __bad_pmd(pgd); - return NULL; - } - return (pmd_t *) pgd_page(*pgd) + offset; -} - -pte_t * -get_pte_slow(pmd_t *pmd, unsigned long offset) -{ - pte_t *pte; - - pte = (pte_t *) __get_free_page(GFP_KERNEL); - if (pmd_none(*pmd)) { - if (pte) { - clear_page((void *)pte); - pmd_set(pmd, pte); - return pte + offset; - } - pmd_set(pmd, (pte_t *) BAD_PAGETABLE); - return NULL; - } - free_page((unsigned long)pte); - if (pmd_bad(*pmd)) { - __bad_pte(pmd); - return NULL; - } - return (pte_t *) pmd_page(*pmd) + offset; -} - int do_check_pgt_cache(int low, int high) { int freed = 0; - if(pgtable_cache_size > high) { - do { - if(pgd_quicklist) - free_pgd_slow(get_pgd_fast()), freed++; - if(pmd_quicklist) - free_pmd_slow(get_pmd_fast()), freed++; - if(pte_quicklist) - free_pte_slow(get_pte_fast()), freed++; - } while(pgtable_cache_size > low); - } - return freed; + if(pgtable_cache_size > high) { + do { + if(pgd_quicklist) { + free_pgd_slow(get_pgd_fast()); + freed++; + } + if(pmd_quicklist) { + pmd_free_slow(pmd_alloc_one_fast(NULL, 0)); + freed++; + } + if(pte_quicklist) { + pte_free_slow(pte_alloc_one_fast(NULL, 0)); + freed++; + } + } while(pgtable_cache_size > low); + } + return freed; } /* @@ -169,6 +118,7 @@ return pte_mkdirty(mk_pte(virt_to_page(EMPTY_PGE), PAGE_SHARED)); } +#ifndef CONFIG_DISCONTIGMEM void show_mem(void) { @@ -198,6 +148,7 @@ printk("%ld pages in page table cache\n",pgtable_cache_size); show_buffers(); } +#endif static inline unsigned long load_PCB(struct thread_struct * pcb) @@ -329,6 +280,7 @@ } +#ifndef CONFIG_DISCONTIGMEM /* * paging_init() sets up the memory map. */ @@ -341,16 +293,7 @@ dma_pfn = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; high_pfn = max_low_pfn; -#define ORDER_MASK (~((1L << (MAX_ORDER-1))-1)) -#define ORDER_ALIGN(n) (((n) + ~ORDER_MASK) & ORDER_MASK) - - dma_pfn = ORDER_ALIGN(dma_pfn); - high_pfn = ORDER_ALIGN(high_pfn); - -#undef ORDER_MASK -#undef ORDER_ALIGN - - if (dma_pfn > high_pfn) + if (dma_pfn >= high_pfn) zones_size[ZONE_DMA] = high_pfn; else { zones_size[ZONE_DMA] = dma_pfn; @@ -363,6 +306,7 @@ /* Initialize the kernel's ZERO_PGE. */ memset((void *)ZERO_PGE, 0, PAGE_SIZE); } +#endif /* CONFIG_DISCONTIGMEM */ #if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_SRM) void @@ -381,6 +325,7 @@ } #endif +#ifndef CONFIG_DISCONTIGMEM static void __init printk_memory_info(void) { @@ -420,6 +365,7 @@ printk_memory_info(); } +#endif /* CONFIG_DISCONTIGMEM */ void free_initmem (void) @@ -442,13 +388,14 @@ void free_initrd_mem(unsigned long start, unsigned long end) { + unsigned long __start = start; for (; start < end; start += PAGE_SIZE) { ClearPageReserved(virt_to_page(start)); set_page_count(virt_to_page(start), 1); free_page(start); totalram_pages++; } - printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10); + printk ("Freeing initrd memory: %ldk freed\n", (end - __start) >> 10); } #endif |
From: Andy P. <at...@us...> - 2002-04-10 18:32:40
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip32 In directory usw-pr-cvs1:/tmp/cvs-serv18937/mips64/sgi-ip32 Added Files: Makefile crime.c ip32-berr.c ip32-irq-glue.S ip32-irq.c ip32-pci-dma.c ip32-pci.c ip32-rtc.c ip32-setup.c ip32-timer.c Log Message: synch 2.4.15 commit 38 --- NEW FILE --- # # Makefile for the SGI specific kernel interface routines # under Linux. # # Note! Dependencies are done automagically by 'make dep', which also # removes any old dependencies. DON'T put your own dependencies here # unless it's something special (ie not a .c file). # # Note 2! The CFLAGS definitions are now in the main makefile... .S.s: $(CPP) $(CFLAGS) $< -o $*.s .S.o: $(CC) $(CFLAGS) -c $< -o $*.o O_TARGET := ip32-kern.a all: ip32-kern.a ip32-irq-glue.o obj-y += ip32-irq.o ip32-rtc.o ip32-setup.o ip32-irq-glue.o \ ip32-berr.o ip32-timer.o crime.o ifdef CONFIG_PCI obj-y += ip32-pci.o ip32-pci-dma.o endif include $(TOPDIR)/Rules.make --- NEW FILE --- /* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2001 Keith M Wesolowski */ #include <linux/types.h> #include <linux/init.h> #include <linux/kernel.h> #include <asm/ip32/crime.h> #include <asm/ptrace.h> #include <asm/promlib.h> void __init crime_init (void) { u64 id = crime_read_64 (CRIME_ID); u64 rev = id & CRIME_ID_REV; id = (id & CRIME_ID_IDBITS) >> 4; printk ("CRIME id %1lx rev %ld detected at %016lx\n", id, rev, (unsigned long) CRIME_BASE); } /* XXX Like on Sun, these give us various useful information to printk. */ void crime_memerr_intr (unsigned int irq, void *dev_id, struct pt_regs *regs) { u64 memerr = crime_read_64 (CRIME_MEM_ERROR_STAT); u64 addr = crime_read_64 (CRIME_MEM_ERROR_ADDR); memerr &= CRIME_MEM_ERROR_STAT_MASK; printk ("CRIME memory error at physaddr 0x%08lx status %08lx\n", addr << 2, memerr); crime_write_64 (CRIME_MEM_ERROR_STAT, 0); } void crime_cpuerr_intr (unsigned int irq, void *dev_id, struct pt_regs *regs) { u64 cpuerr = crime_read_64 (CRIME_CPU_ERROR_STAT); u64 addr = crime_read_64 (CRIME_CPU_ERROR_ADDR); cpuerr &= CRIME_CPU_ERROR_MASK; addr <<= 2UL; printk ("CRIME CPU interface error detected at %09lx status %08lx\n", addr, cpuerr); crime_write_64 (CRIME_CPU_ERROR_STAT, 0); } --- NEW FILE --- /* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1994, 1995, 1996, 1999, 2000 by Ralf Baechle * Copyright (C) 1999, 2000 by Silicon Graphics */ #include <linux/init.h> #include <linux/kernel.h> #include <asm/uaccess.h> #include <asm/paccess.h> #include <asm/addrspace.h> #include <asm/ptrace.h> /* XXX I have no idea what this does --kmw */ extern asmlinkage void handle_ibe(void); extern asmlinkage void handle_dbe(void); extern const struct exception_table_entry __start___dbe_table[]; extern const struct exception_table_entry __stop___dbe_table[]; static inline unsigned long search_one_table(const struct exception_table_entry *first, const struct exception_table_entry *last, unsigned long value) { while (first <= last) { const struct exception_table_entry *mid; long diff; mid = (last - first) / 2 + first; diff = mid->insn - value; if (diff == 0) return mid->nextinsn; else if (diff < 0) first = mid+1; else last = mid-1; } return 0; } static inline unsigned long search_dbe_table(unsigned long addr) { unsigned long ret; /* There is only the kernel to search. */ ret = search_one_table(__start___dbe_table, __stop___dbe_table-1, addr); if (ret) return ret; return 0; } void do_ibe(struct pt_regs *regs) { printk("Got ibe at 0x%lx\n", regs->cp0_epc); show_regs(regs); dump_tlb_addr(regs->cp0_epc); force_sig(SIGBUS, current); while(1); } void do_dbe(struct pt_regs *regs) { unsigned long fixup; fixup = search_dbe_table(regs->cp0_epc); if (fixup) { long new_epc; new_epc = fixup_exception(dpf_reg, fixup, regs->cp0_epc); regs->cp0_epc = new_epc; return; } printk("Got dbe at 0x%lx\n", regs->cp0_epc); show_regs(regs); dump_tlb_all(); while(1); force_sig(SIGBUS, current); } void __init bus_error_init(void) { int dummy; set_except_vector(6, handle_ibe); set_except_vector(7, handle_dbe); /* At this time nothing uses the DBE protection mechanism on the O2, so this here is needed to make the kernel link. */ get_dbe(dummy, (int *)KSEG0); } --- NEW FILE --- /* * Low level interrupt handler for the SGI O2 aka IP32 aka Moosehead * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2000 Harald Koerfgen * Copyright (C) 2001 Keith M Wesolowski */ #include <asm/asm.h> #include <asm/regdef.h> #include <asm/mipsregs.h> #include <asm/stackframe.h> #include <asm/addrspace.h> #include <asm/ip32/ip32_ints.h> .text .set noreorder .set noat .align 5 NESTED(ip32_handle_int, PT_SIZE, ra) .set noat SAVE_ALL CLI # TEST: interrupts should be off .set at .set noreorder mfc0 s0,CP0_CAUSE andi t1, s0, IE_IRQ0 bnez t1, handle_irq0 andi t1, s0, IE_IRQ1 bnez t1, handle_irq1 andi t1, s0, IE_IRQ2 bnez t1, handle_irq2 andi t1, s0, IE_IRQ3 bnez t1, handle_irq3 andi t1, s0, IE_IRQ4 bnez t1, handle_irq4 andi t1, s0, IE_IRQ5 bnez t1, handle_irq5 nop /* Either someone has triggered the "software interrupts" * or we lost an interrupt somehow. Ignore it. */ j ret_from_irq nop handle_irq0: jal ip32_irq0 move a0, sp j ret_from_irq nop handle_irq1: jal ip32_irq1 move a0, sp j ret_from_irq nop handle_irq2: jal ip32_irq2 move a0, sp j ret_from_irq nop handle_irq3: jal ip32_irq3 move a0, sp j ret_from_irq nop handle_irq4: jal ip32_irq4 move a0, sp j ret_from_irq nop handle_irq5: jal ip32_irq5 move a0, sp j ret_from_irq nop END(ip32_handle_int) --- NEW FILE --- /* * Code to handle IP32 IRQs * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2000 Harald Koerfgen * Copyright (C) 2001 Keith M Wesolowski */ #include <linux/init.h> #include <linux/kernel_stat.h> #include <linux/types.h> #include <linux/interrupt.h> #include <linux/irq.h> #include <linux/bitops.h> #include <asm/bitops.h> #include <asm/mipsregs.h> #include <asm/system.h> #include <asm/ip32/ip32_ints.h> #include <asm/ip32/crime.h> #include <asm/ip32/mace.h> #include <asm/signal.h> #undef DEBUG_IRQ #ifdef DEBUG_IRQ #define DBG(x...) printk(x) #else #define DBG(x...) #endif /* O2 irq map * * IP0 -> software (ignored) * IP1 -> software (ignored) * IP2 -> (irq0) C crime 1.1 all interrupts; crime 1.5 ??? * IP3 -> (irq1) X unknown * IP4 -> (irq2) X unknown * IP5 -> (irq3) X unknown * IP6 -> (irq4) X unknown * IP7 -> (irq5) 0 CPU count/compare timer (system timer) * * crime: (C) * * CRIME_INT_STAT 31:0: * * 0 -> 1 Video in 1 * 1 -> 2 Video in 2 * 2 -> 3 Video out * 3 -> 4 Mace ethernet * 4 -> S SuperIO sub-interrupt * 5 -> M Miscellaneous sub-interrupt * 6 -> A Audio sub-interrupt * 7 -> 8 PCI bridge errors * 8 -> 9 PCI SCSI aic7xxx 0 * 9 -> 10 PCI SCSI aic7xxx 1 * 10 -> 11 PCI slot 0 * 11 -> 12 unused (PCI slot 1) * 12 -> 13 unused (PCI slot 2) * 13 -> 14 unused (PCI shared 0) * 14 -> 15 unused (PCI shared 1) * 15 -> 16 unused (PCI shared 2) * 16 -> 17 GBE0 (E) * 17 -> 18 GBE1 (E) * 18 -> 19 GBE2 (E) * 19 -> 20 GBE3 (E) * 20 -> 21 CPU errors * 21 -> 22 Memory errors * 22 -> 23 RE empty edge (E) * 23 -> 24 RE full edge (E) * 24 -> 25 RE idle edge (E) * 25 -> 26 RE empty level * 26 -> 27 RE full level * 27 -> 28 RE idle level * 28 -> 29 unused (software 0) (E) * 29 -> 30 unused (software 1) (E) * 30 -> 31 unused (software 2) - crime 1.5 CPU SysCorError (E) * 31 -> 32 VICE * * S, M, A: Use the MACE ISA interrupt register * MACE_ISA_INT_STAT 31:0 * * 0-7 -> 33-40 Audio * 8 -> 41 RTC * 9 -> 42 Keyboard * 10 -> X Keyboard polled * 11 -> 44 Mouse * 12 -> X Mouse polled * 13-15 -> 46-48 Count/compare timers * 16-19 -> 49-52 Parallel (16 E) * 20-25 -> 53-58 Serial 1 (22 E) * 26-31 -> 59-64 Serial 2 (28 E) * * Note that this means IRQs 5-7, 43, and 45 do not exist. This is a * different IRQ map than IRIX uses, but that's OK as Linux irq handling * is quite different anyway. */ /* Some initial interrupts to set up */ extern void crime_memerr_intr (unsigned int irq, void *dev_id, struct pt_regs *regs); extern void crime_cpuerr_intr (unsigned int irq, void *dev_id, struct pt_regs *regs); struct irqaction memerr_irq = { crime_memerr_intr, SA_INTERRUPT, 0, "CRIME memory error", NULL, NULL }; struct irqaction cpuerr_irq = { crime_cpuerr_intr, SA_INTERRUPT, 0, "CRIME CPU error", NULL, NULL }; unsigned long spurious_count = 0; extern void ip32_handle_int (void); extern void do_IRQ (unsigned int irq, struct pt_regs *regs); /* For interrupts wired from a single device to the CPU. Only the clock * uses this it seems, which is IRQ 0 and IP7. */ static void enable_cpu_irq (unsigned int irq) { set_cp0_status (STATUSF_IP7); } static unsigned int startup_cpu_irq (unsigned int irq) { enable_cpu_irq (irq); return 0; } static void disable_cpu_irq (unsigned int irq) { clear_cp0_status (STATUSF_IP7); } static void end_cpu_irq (unsigned int irq) { if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) enable_cpu_irq (irq); } #define shutdown_cpu_irq disable_cpu_irq #define mask_and_ack_cpu_irq disable_cpu_irq static struct hw_interrupt_type ip32_cpu_interrupt = { "IP32 CPU", startup_cpu_irq, shutdown_cpu_irq, enable_cpu_irq, disable_cpu_irq, mask_and_ack_cpu_irq, end_cpu_irq, NULL }; /* * This is for pure CRIME interrupts - ie not MACE. The advantage? * We get to split the register in half and do faster lookups. */ static void enable_crime_irq (unsigned int irq) { u64 crime_mask; unsigned long flags; save_and_cli (flags); crime_mask = crime_read_64 (CRIME_INT_MASK); crime_mask |= 1 << (irq - 1); crime_write_64 (CRIME_INT_MASK, crime_mask); restore_flags (flags); } static unsigned int startup_crime_irq (unsigned int irq) { enable_crime_irq (irq); return 0; /* This is probably not right; we could have pending irqs */ } static void disable_crime_irq (unsigned int irq) { u64 crime_mask; unsigned long flags; save_and_cli (flags); crime_mask = crime_read_64 (CRIME_INT_MASK); crime_mask &= ~(1 << (irq - 1)); crime_write_64 (CRIME_INT_MASK, crime_mask); restore_flags (flags); } static void mask_and_ack_crime_irq (unsigned int irq) { u64 crime_mask; unsigned long flags; /* Edge triggered interrupts must be cleared. */ if ((irq <= CRIME_GBE0_IRQ && irq >= CRIME_GBE3_IRQ) || (irq <= CRIME_RE_EMPTY_E_IRQ && irq >= CRIME_RE_IDLE_E_IRQ) || (irq <= CRIME_SOFT0_IRQ && irq >= CRIME_SOFT2_IRQ)) { save_and_cli (flags); crime_mask = crime_read_64 (CRIME_HARD_INT); crime_mask &= ~(1 << (irq - 1)); crime_write_64 (CRIME_HARD_INT, crime_mask); restore_flags (flags); } disable_crime_irq (irq); } static void end_crime_irq (unsigned int irq) { if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) enable_crime_irq (irq); } #define shutdown_crime_irq disable_crime_irq static struct hw_interrupt_type ip32_crime_interrupt = { "IP32 CRIME", startup_crime_irq, shutdown_crime_irq, enable_crime_irq, disable_crime_irq, mask_and_ack_crime_irq, end_crime_irq, NULL }; /* This is for MACE PCI interrupts. We can decrease bus traffic by masking * as close to the source as possible. This also means we can take the * next chunk of the CRIME register in one piece. */ static void enable_macepci_irq (unsigned int irq) { u32 mace_mask; u64 crime_mask; unsigned long flags; save_and_cli (flags); mace_mask = mace_read_32 (MACEPCI_CONTROL); mace_mask |= MACEPCI_CONTROL_INT (irq - 9); mace_write_32 (MACEPCI_CONTROL, mace_mask); /* In case the CRIME interrupt isn't enabled, we must enable it; * however, we never disable interrupts at that level. */ crime_mask = crime_read_64 (CRIME_INT_MASK); crime_mask |= 1 << (irq - 1); crime_write_64 (CRIME_INT_MASK, crime_mask); restore_flags (flags); } static unsigned int startup_macepci_irq (unsigned int irq) { enable_macepci_irq (irq); return 0; /* XXX */ } static void disable_macepci_irq (unsigned int irq) { u32 mace_mask; unsigned long flags; save_and_cli (flags); mace_mask = mace_read_32 (MACEPCI_CONTROL); mace_mask &= ~MACEPCI_CONTROL_INT (irq - 9); mace_write_32 (MACEPCI_CONTROL, mace_mask); restore_flags (flags); } static void end_macepci_irq (unsigned int irq) { if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) enable_macepci_irq (irq); } #define shutdown_macepci_irq disable_macepci_irq #define mask_and_ack_macepci_irq disable_macepci_irq static struct hw_interrupt_type ip32_macepci_interrupt = { "IP32 MACE PCI", startup_macepci_irq, shutdown_macepci_irq, enable_macepci_irq, disable_macepci_irq, mask_and_ack_macepci_irq, end_macepci_irq, NULL }; /* This is used for MACE ISA interrupts. That means bits 4-6 in the * CRIME register. */ static void enable_maceisa_irq (unsigned int irq) { u64 crime_mask; u32 mace_mask; unsigned int crime_int = 0; unsigned long flags; DBG ("maceisa enable: %u\n", irq); switch (irq) { case MACEISA_AUDIO_SW_IRQ ... MACEISA_AUDIO3_MERR_IRQ: crime_int = MACE_AUDIO_INT; break; case MACEISA_RTC_IRQ ... MACEISA_TIMER2_IRQ: crime_int = MACE_MISC_INT; break; case MACEISA_PARALLEL_IRQ ... MACEISA_SERIAL2_RDMAOR_IRQ: crime_int = MACE_SUPERIO_INT; break; } DBG ("crime_int %016lx enabled\n", crime_int); save_and_cli (flags); crime_mask = crime_read_64 (CRIME_INT_MASK); crime_mask |= crime_int; crime_write_64 (CRIME_INT_MASK, crime_mask); mace_mask = mace_read_32 (MACEISA_INT_MASK); mace_mask |= 1 << (irq - 33); mace_write_32 (MACEISA_INT_MASK, mace_mask); restore_flags (flags); } static unsigned int startup_maceisa_irq (unsigned int irq) { enable_maceisa_irq (irq); return 0; } static void disable_maceisa_irq (unsigned int irq) { u32 mace_mask; unsigned long flags; save_and_cli (flags); mace_mask = mace_read_32 (MACEISA_INT_MASK); mace_mask &= ~(1 << (irq - 33)); mace_write_32 (MACEISA_INT_MASK, mace_mask); restore_flags (flags); } static void mask_and_ack_maceisa_irq (unsigned int irq) { u32 mace_mask; unsigned long flags; switch (irq) { case MACEISA_PARALLEL_IRQ: case MACEISA_SERIAL1_TDMAPR_IRQ: case MACEISA_SERIAL2_TDMAPR_IRQ: save_and_cli (flags); mace_mask = mace_read_32 (MACEISA_INT_STAT); mace_mask &= ~(1 << (irq - 33)); mace_write_32 (MACEISA_INT_STAT, mace_mask); restore_flags (flags); break; } disable_maceisa_irq (irq); } static void end_maceisa_irq (unsigned irq) { if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) enable_maceisa_irq (irq); } #define shutdown_maceisa_irq disable_maceisa_irq static struct hw_interrupt_type ip32_maceisa_interrupt = { "IP32 MACE ISA", startup_maceisa_irq, shutdown_maceisa_irq, enable_maceisa_irq, disable_maceisa_irq, mask_and_ack_maceisa_irq, end_maceisa_irq, NULL }; /* This is used for regular non-ISA, non-PCI MACE interrupts. That means * bits 0-3 and 7 in the CRIME register. */ static void enable_mace_irq (unsigned int irq) { u64 crime_mask; unsigned long flags; save_and_cli (flags); crime_mask = crime_read_64 (CRIME_INT_MASK); crime_mask |= 1 << (irq - 1); crime_write_64 (CRIME_INT_MASK, crime_mask); restore_flags (flags); } static unsigned int startup_mace_irq (unsigned int irq) { enable_mace_irq (irq); return 0; } static void disable_mace_irq (unsigned int irq) { u64 crime_mask; unsigned long flags; save_and_cli (flags); crime_mask = crime_read_64 (CRIME_INT_MASK); crime_mask &= ~(1 << (irq - 1)); crime_write_64 (CRIME_INT_MASK, crime_mask); restore_flags (flags); } static void end_mace_irq (unsigned int irq) { if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) enable_mace_irq (irq); } #define shutdown_mace_irq disable_mace_irq #define mask_and_ack_mace_irq disable_mace_irq static struct hw_interrupt_type ip32_mace_interrupt = { "IP32 MACE", startup_mace_irq, shutdown_mace_irq, enable_mace_irq, disable_mace_irq, mask_and_ack_mace_irq, end_mace_irq, NULL }; static void ip32_unknown_interrupt (struct pt_regs *regs) { u64 crime; u32 mace; printk ("Unknown interrupt occurred!\n"); printk ("cp0_status: %08x\tcp0_cause: %08x\n", read_32bit_cp0_register (CP0_STATUS), read_32bit_cp0_register (CP0_CAUSE)); crime = crime_read_64 (CRIME_INT_MASK); printk ("CRIME interrupt mask: %016lx\n", crime); crime = crime_read_64 (CRIME_INT_STAT); printk ("CRIME interrupt status: %016lx\n", crime); crime = crime_read_64 (CRIME_HARD_INT); printk ("CRIME hardware interrupt register: %016lx\n", crime); mace = mace_read_32 (MACEISA_INT_MASK); printk ("MACE ISA interrupt mask: %08x\n", mace); mace = mace_read_32 (MACEISA_INT_STAT); printk ("MACE ISA interrupt status: %08x\n", mace); mace = mace_read_32 (MACEPCI_CONTROL); printk ("MACE PCI control register: %08x\n", mace); printk ("Register dump:\n"); show_regs (regs); printk ("Please mail this report to lin...@os...\n"); printk ("Spinning..."); while (1) ; } void __init ip32_irq_init(void) { unsigned int irq; extern void init_generic_irq (void); /* Install our interrupt handler, then clear and disable all * CRIME and MACE interrupts. */ crime_write_64 (CRIME_INT_MASK, 0); crime_write_64 (CRIME_HARD_INT, 0); crime_write_64 (CRIME_SOFT_INT, 0); mace_write_32 (MACEISA_INT_STAT, 0); mace_write_32 (MACEISA_INT_MASK, 0); set_except_vector(0, ip32_handle_int); init_generic_irq (); for (irq = 0; irq <= IP32_IRQ_MAX; irq++) { hw_irq_controller *controller; if (irq == CLOCK_IRQ) controller = &ip32_cpu_interrupt; else if (irq <= MACE_PCI_BRIDGE_IRQ && irq >= MACE_VID_IN1_IRQ) controller = &ip32_mace_interrupt; else if (irq <= MACEPCI_SHARED2_IRQ && irq >= MACEPCI_SCSI0_IRQ) controller = &ip32_macepci_interrupt; else if (irq <= CRIME_VICE_IRQ && irq >= CRIME_GBE0_IRQ) controller = &ip32_crime_interrupt; else controller = &ip32_maceisa_interrupt; irq_desc[irq].status = IRQ_DISABLED; irq_desc[irq].action = 0; irq_desc[irq].depth = 0; irq_desc[irq].handler = controller; } setup_irq (CRIME_MEMERR_IRQ, &memerr_irq); setup_irq (CRIME_CPUERR_IRQ, &cpuerr_irq); } /* CRIME 1.1 appears to deliver all interrupts to this one pin. */ void ip32_irq0 (struct pt_regs *regs) { u64 crime_int = crime_read_64 (CRIME_INT_STAT); int irq = 0; if (crime_int & CRIME_MACE_INT_MASK) { crime_int &= CRIME_MACE_INT_MASK; irq = ffs (crime_int); } else if (crime_int & CRIME_MACEISA_INT_MASK) { u32 mace_int; mace_int = mace_read_32 (MACEISA_INT_STAT); if (mace_int == 0) irq = 0; else irq = ffs (mace_int) + 32; } else if (crime_int & CRIME_MACEPCI_INT_MASK) { crime_int &= CRIME_MACEPCI_INT_MASK; crime_int >>= 8; irq = ffs (crime_int) + 8; } else if (crime_int & 0xffff0000) { crime_int >>= 16; irq = ffs (crime_int) + 16; } if (irq == 0) ip32_unknown_interrupt (regs); DBG ("*irq %u*\n", irq); do_IRQ (irq, regs); } void ip32_irq1 (struct pt_regs *regs) { ip32_unknown_interrupt (regs); } void ip32_irq2 (struct pt_regs *regs) { ip32_unknown_interrupt (regs); } void ip32_irq3 (struct pt_regs *regs) { ip32_unknown_interrupt (regs); } void ip32_irq4 (struct pt_regs *regs) { ip32_unknown_interrupt (regs); } void ip32_irq5 (struct pt_regs *regs) { do_IRQ (CLOCK_IRQ, regs); } --- NEW FILE --- /* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2000 Ani Joshi <aj...@un...> * Copyright (C) 2000 Ralf Baechle <ra...@gn...> * swiped from i386, and cloned for MIPS by Geert, polished by Ralf. */ #include <linux/types.h> #include <linux/mm.h> #include <linux/string.h> #include <linux/pci.h> #include <asm/io.h> #include <asm/addrspace.h> #include <asm/ip32/mace.h> void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t * dma_handle) { void *ret; int gfp = GFP_ATOMIC; if (hwdev == NULL || hwdev->dma_mask != 0xffffffff) gfp |= GFP_DMA; ret = (void *) __get_free_pages(gfp, get_order(size)); if (ret != NULL) { memset(ret, 0, size); dma_cache_wback_inv((unsigned long) ret, size); *dma_handle = virt_to_bus(ret); } return ret; } void pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle) { free_pages((unsigned long) vaddr, get_order(size)); } --- NEW FILE --- /* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2000, 2001 Keith M Wesolowski */ #include <linux/config.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/types.h> #include <asm/pci.h> #include <asm/ip32/mace.h> #include <asm/ip32/crime.h> #include <asm/ip32/ip32_ints.h> #include <linux/delay.h> #undef DEBUG_MACE_PCI /* * O2 has up to 5 PCI devices connected into the MACE bridge. The device * map looks like this: * * 0 aic7xxx 0 * 1 aic7xxx 1 * 2 expansion slot * 3 N/C * 4 N/C */ #define chkslot(dev) \ do { \ if ((dev)->bus->number > 0 || PCI_SLOT ((dev)->devfn) < 1 \ || PCI_SLOT ((dev)->devfn) > 3) \ return PCIBIOS_DEVICE_NOT_FOUND; \ } while (0) #define mkaddr(dev, where) \ ((((dev)->devfn & 0xffUL) << 8) | ((where) & 0xfcUL)) void macepci_error (int irq, void *dev, struct pt_regs *regs); static int macepci_read_config_byte (struct pci_dev *dev, int where, u8 *val) { *val = 0xff; chkslot (dev); mace_write_32 (MACEPCI_CONFIG_ADDR, mkaddr (dev, where)); *val = mace_read_8 (MACEPCI_CONFIG_DATA + ((where & 3UL) ^ 3UL)); return PCIBIOS_SUCCESSFUL; } static int macepci_read_config_word (struct pci_dev *dev, int where, u16 *val) { *val = 0xffff; chkslot (dev); if (where & 1) return PCIBIOS_BAD_REGISTER_NUMBER; mace_write_32 (MACEPCI_CONFIG_ADDR, mkaddr (dev, where)); *val = mace_read_16 (MACEPCI_CONFIG_DATA + ((where & 2UL) ^ 2UL)); return PCIBIOS_SUCCESSFUL; } static int macepci_read_config_dword (struct pci_dev *dev, int where, u32 *val) { *val = 0xffffffff; chkslot (dev); if (where & 3) return PCIBIOS_BAD_REGISTER_NUMBER; mace_write_32 (MACEPCI_CONFIG_ADDR, mkaddr (dev, where)); *val = mace_read_32 (MACEPCI_CONFIG_DATA); return PCIBIOS_SUCCESSFUL; } static int macepci_write_config_byte (struct pci_dev *dev, int where, u8 val) { chkslot (dev); mace_write_32 (MACEPCI_CONFIG_ADDR, mkaddr (dev, where)); mace_write_8 (MACEPCI_CONFIG_DATA + ((where & 3UL) ^ 3UL), val); return PCIBIOS_SUCCESSFUL; } static int macepci_write_config_word (struct pci_dev *dev, int where, u16 val) { chkslot (dev); if (where & 1) return PCIBIOS_BAD_REGISTER_NUMBER; mace_write_32 (MACEPCI_CONFIG_ADDR, mkaddr (dev, where)); mace_write_16 (MACEPCI_CONFIG_DATA + ((where & 2UL) ^ 2UL), val); return PCIBIOS_SUCCESSFUL; } static int macepci_write_config_dword (struct pci_dev *dev, int where, u32 val) { chkslot (dev); if (where & 3) return PCIBIOS_BAD_REGISTER_NUMBER; mace_write_32 (MACEPCI_CONFIG_ADDR, mkaddr (dev, where)); mace_write_32 (MACEPCI_CONFIG_DATA, val); return PCIBIOS_SUCCESSFUL; } static struct pci_ops macepci_ops = { macepci_read_config_byte, macepci_read_config_word, macepci_read_config_dword, macepci_write_config_byte, macepci_write_config_word, macepci_write_config_dword }; struct pci_fixup pcibios_fixups[] = { { 0 } }; void __init pcibios_init (void) { struct pci_dev *dev; u32 start, size; u16 cmd; u32 base_io = 0x3000; /* The first i/o address to assign after SCSI */ u32 base_mem = 0x80100000; /* Likewise */ u32 rev = mace_read_32 (MACEPCI_REV); int i; printk ("MACE: PCI rev %d detected at %016lx\n", rev, (u64) MACE_BASE + MACE_PCI); /* These are *bus* addresses */ ioport_resource.start = 0; ioport_resource.end = 0xffffffffUL; iomem_resource.start = 0x80000000UL; iomem_resource.end = 0xffffffffUL; /* Clear any outstanding errors and enable interrupts */ mace_write_32 (MACEPCI_ERROR_ADDR, 0); mace_write_32 (MACEPCI_ERROR_FLAGS, 0); mace_write_32 (MACEPCI_CONTROL, 0xff008500); crime_write_64 (CRIME_HARD_INT, 0UL); crime_write_64 (CRIME_SOFT_INT, 0UL); crime_write_64 (CRIME_INT_STAT, 0x000000000000ff00UL); if (request_irq (MACE_PCI_BRIDGE_IRQ, macepci_error, 0, "MACE PCI error", NULL)) panic ("PCI bridge can't get interrupt; can't happen.\n"); pci_scan_bus (0, &macepci_ops, NULL); #ifdef DEBUG_MACE_PCI pci_for_each_dev (dev) { printk ("Device: %d/%d/%d ARCS-assigned bus resource map\n", dev->bus->number, PCI_SLOT (dev->devfn), PCI_FUNC (dev->devfn)); for (i=0; i < DEVICE_COUNT_RESOURCE; i++) { if (dev->resource[i].start == 0) continue; printk ("%d: %016lx - %016lx (flags %04lx)\n", i, dev->resource[i].start, dev->resource[i].end, dev->resource[i].flags); } } #endif /* * Assign sane resources to and enable all devices. The requirement * for the SCSI controllers is well-known: a 256-byte I/O region * which we must assign, and a 1-page memory region which is * assigned by the system firmware. */ pci_for_each_dev (dev) { switch (PCI_SLOT (dev->devfn)) { case 1: /* SCSI bus 0 */ dev->resource[0].start = 0x1000UL; dev->resource[0].end = 0x10ffUL; break; case 2: /* SCSI bus 1 */ dev->resource[0].start = 0x2000UL; dev->resource[0].end = 0x20ffUL; break; default: /* Slots - I guess we have only 1 */ for (i=0; i < 6; i++) { size = dev->resource[i].end - dev->resource[i].start; if (!size || !(dev->resource[i].flags & (IORESOURCE_IO|IORESOURCE_MEM))) { dev->resource[i].start = dev->resource[i].end = 0UL; continue; } if (dev->resource[i].flags & IORESOURCE_IO) { dev->resource[i].start = base_io; base_io += PAGE_ALIGN (size); } else { dev->resource[i].start = base_mem; base_mem += 0x100000UL; } dev->resource[i].end = dev->resource[i].start + size; } break; } for (i=0; i < 6; i++) { if (dev->resource[i].start == 0) continue; start = dev->resource[i].start; if (dev->resource[i].flags & IORESOURCE_IO) start |= 1; pci_write_config_dword (dev, PCI_BASE_ADDRESS_0 + (i << 2), (u32) start); } pci_write_config_byte (dev, PCI_CACHE_LINE_SIZE, 0x20); pci_write_config_byte (dev, PCI_LATENCY_TIMER, 0x30); pci_read_config_word (dev, PCI_COMMAND, &cmd); cmd |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_PARITY); pci_write_config_word (dev, PCI_COMMAND, cmd); pci_set_master (dev); } #ifdef DEBUG_MACE_PCI printk ("Triggering PCI bridge interrupt...\n"); mace_write_32 (MACEPCI_ERROR_FLAGS, MACEPCI_ERROR_INTERRUPT_TEST); pci_for_each_dev (dev) { printk ("Device: %d/%d/%d final bus resource map\n", dev->bus->number, PCI_SLOT (dev->devfn), PCI_FUNC (dev->devfn)); for (i=0; i < DEVICE_COUNT_RESOURCE; i++) { if (dev->resource[i].start == 0) continue; printk ("%d: %016lx - %016lx (flags %04lx)\n", i, dev->resource[i].start, dev->resource[i].end, dev->resource[i].flags); } } #endif } /* * Given a PCI slot number (a la PCI_SLOT(...)) and the interrupt pin of * the device (1-4 => A-D), tell what irq to use. Note that we don't * in theory have slots 4 and 5, and we never normally use the shared * irqs. I suppose a device without a pin A will thank us for doing it * right if there exists such a broken piece of crap. */ static int __init macepci_map_irq (struct pci_dev *dev, u8 slot, u8 pin) { chkslot (dev); if (pin == 0) pin = 1; switch (slot) { case 1: return MACEPCI_SCSI0_IRQ; case 2: return MACEPCI_SCSI1_IRQ; case 3: switch (pin) { case 2: return MACEPCI_SHARED0_IRQ; case 3: return MACEPCI_SHARED1_IRQ; case 4: return MACEPCI_SHARED2_IRQ; case 1: default: return MACEPCI_SLOT0_IRQ; } case 4: switch (pin) { case 2: return MACEPCI_SHARED2_IRQ; case 3: return MACEPCI_SHARED0_IRQ; case 4: return MACEPCI_SHARED1_IRQ; case 1: default: return MACEPCI_SLOT1_IRQ; } return MACEPCI_SLOT1_IRQ; case 5: switch (pin) { case 2: return MACEPCI_SHARED1_IRQ; case 3: return MACEPCI_SHARED2_IRQ; case 4: return MACEPCI_SHARED0_IRQ; case 1: default: return MACEPCI_SLOT2_IRQ; } default: return 0; } } /* * It's not entirely clear what this does in a system with no bridges. * In any case, bridges are not supported by Linux in O2. */ static u8 __init macepci_swizzle (struct pci_dev *dev, u8 *pinp) { if (PCI_SLOT (dev->devfn) == 2) *pinp = 2; else *pinp = 1; return PCI_SLOT (dev->devfn); } /* All devices are enabled during initialization. */ int pcibios_enable_device (struct pci_dev *dev) { return PCIBIOS_SUCCESSFUL; } char * __init pcibios_setup (char *str) { return str; } void __init pcibios_align_resource (void *data, struct resource *res, unsigned long size) { } void __init pcibios_update_resource (struct pci_dev *dev, struct resource *root, struct resource *res, int resource) { } void __init pcibios_update_irq (struct pci_dev *dev, int irq) { pci_write_config_byte (dev, PCI_INTERRUPT_LINE, irq); } void __init pcibios_fixup_bus (struct pci_bus *b) { pci_fixup_irqs (macepci_swizzle, macepci_map_irq); } /* XXX anybody know what this is supposed to do? */ void __init pcibios_fixup_pbus_ranges(struct pci_bus * bus, struct pbus_set_ranges_data * ranges) { ranges->io_start -= bus->resource[0]->start; ranges->io_end -= bus->resource[0]->start; ranges->mem_start -= bus->resource[1]->start; ranges->mem_end -= bus->resource[1]->start; } /* * Handle errors from the bridge. This includes master and target aborts, * various command and address errors, and the interrupt test. This gets * registered on the bridge error irq. It's conceivable that some of these * conditions warrant a panic. Anybody care to say which ones? */ void macepci_error (int irq, void *dev, struct pt_regs *regs) { u32 flags, error_addr; char space; flags = mace_read_32 (MACEPCI_ERROR_FLAGS); error_addr = mace_read_32 (MACEPCI_ERROR_ADDR); if (flags & MACEPCI_ERROR_MEMORY_ADDR) space = 'M'; else if (flags & MACEPCI_ERROR_CONFIG_ADDR) space = 'C'; else space = 'X'; if (flags & MACEPCI_ERROR_MASTER_ABORT) { printk ("MACEPCI: Master abort at 0x%08x (%c)\n", error_addr, space); mace_write_32 (MACEPCI_ERROR_FLAGS, flags & ~MACEPCI_ERROR_MASTER_ABORT); } if (flags & MACEPCI_ERROR_TARGET_ABORT) { printk ("MACEPCI: Target abort at 0x%08x (%c)\n", error_addr, space); mace_write_32 (MACEPCI_ERROR_FLAGS, flags & ~MACEPCI_ERROR_TARGET_ABORT); } if (flags & MACEPCI_ERROR_DATA_PARITY_ERR) { printk ("MACEPCI: Data parity error at 0x%08x (%c)\n", error_addr, space); mace_write_32 (MACEPCI_ERROR_FLAGS, flags & ~MACEPCI_ERROR_DATA_PARITY_ERR); } if (flags & MACEPCI_ERROR_RETRY_ERR) { printk ("MACEPCI: Retry error at 0x%08x (%c)\n", error_addr, space); mace_write_32 (MACEPCI_ERROR_FLAGS, flags & ~MACEPCI_ERROR_RETRY_ERR); } if (flags & MACEPCI_ERROR_ILLEGAL_CMD) { printk ("MACEPCI: Illegal command at 0x%08x (%c)\n", error_addr, space); mace_write_32 (MACEPCI_ERROR_FLAGS, flags & ~MACEPCI_ERROR_ILLEGAL_CMD); } if (flags & MACEPCI_ERROR_SYSTEM_ERR) { printk ("MACEPCI: System error at 0x%08x (%c)\n", error_addr, space); mace_write_32 (MACEPCI_ERROR_FLAGS, flags & ~MACEPCI_ERROR_SYSTEM_ERR); } if (flags & MACEPCI_ERROR_PARITY_ERR) { printk ("MACEPCI: Parity error at 0x%08x (%c)\n", error_addr, space); mace_write_32 (MACEPCI_ERROR_FLAGS, flags & ~MACEPCI_ERROR_PARITY_ERR); } if (flags & MACEPCI_ERROR_OVERRUN) { printk ("MACEPCI: Overrun error at 0x%08x (%c)\n", error_addr, space); mace_write_32 (MACEPCI_ERROR_FLAGS, flags & ~MACEPCI_ERROR_OVERRUN); } if (flags & MACEPCI_ERROR_SIG_TABORT) { printk ("MACEPCI: Signaled target abort (clearing)\n"); mace_write_32 (MACEPCI_ERROR_FLAGS, flags & ~MACEPCI_ERROR_SIG_TABORT); } if (flags & MACEPCI_ERROR_INTERRUPT_TEST) { printk ("MACEPCI: Interrupt test triggered (clearing)\n"); mace_write_32 (MACEPCI_ERROR_FLAGS, flags & ~MACEPCI_ERROR_INTERRUPT_TEST); } } --- NEW FILE --- /* * RTC routines for IP32 style attached Dallas chip. * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2000 Harald Koerfgen */ #include <linux/mc146818rtc.h> #include <asm/ip32/mace.h> static unsigned char ip32_rtc_read_data(unsigned long addr) { return (unsigned char) mace_read_8 (MACEISA_RTC_BASE + (addr << 8)); } static void ip32_rtc_write_data(unsigned char data, unsigned long addr) { mace_write_8 (MACEISA_RTC_BASE + (addr << 8), data); } static int ip32_rtc_bcd_mode(void) { return 0; } struct rtc_ops ip32_rtc_ops = { &ip32_rtc_read_data, &ip32_rtc_write_data, &ip32_rtc_bcd_mode }; --- NEW FILE --- /* * IP32 basic setup * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2000 Harald Koerfgen */ #include <linux/sched.h> #include <linux/interrupt.h> #include <linux/mc146818rtc.h> #include <linux/param.h> #include <linux/init.h> #include <linux/irq.h> #include <asm/mipsregs.h> #include <asm/bootinfo.h> #include <asm/irq.h> #include <asm/mmu_context.h> #include <asm/ip32/crime.h> #include <asm/ip32/mace.h> #include <asm/ip32/ip32_ints.h> #include <asm/sgialib.h> extern struct rtc_ops ip32_rtc_ops; extern u32 cc_interval; void __init ip32_init (int argc, char **argv, char **envp) { arc_meminit (); } void __init ip32_setup(void) { #ifdef CONFIG_SERIAL_CONSOLE char *ctype; #endif TLBMISS_HANDLER_SETUP (); #ifdef CONFIG_SERIAL_CONSOLE ctype = ArcGetEnvironmentVariable("console"); if (*ctype == 'd') { if (ctype[1] == '2') console_setup ("ttyS1"); else console_setup ("ttyS0"); } #endif #ifdef CONFIG_VT conswitchp = &dummy_con; #endif rtc_ops = &ip32_rtc_ops; crime_init (); } int __init page_is_ram (unsigned long pagenr) { /* XXX: to do? */ return 1; } --- NEW FILE --- /* * IP32 timer calibration * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2001 Keith M Wesolowski */ #include <linux/irq.h> #include <linux/kernel.h> #include <linux/init.h> #include <asm/mipsregs.h> #include <asm/param.h> #include <asm/ip32/crime.h> #include <asm/ip32/ip32_ints.h> extern u32 cc_interval; /* An arbitrary time; this can be decreased if reliability looks good */ #define WAIT_MS 10 #define PER_MHZ (1000000 / 2 / HZ) void __init ip32_timer_setup (struct irqaction *irq) { u64 crime_time; u32 cc_tick; printk("Calibrating system timer... "); crime_time = crime_read_64 (CRIME_TIME) & CRIME_TIME_MASK; cc_tick = read_32bit_cp0_register (CP0_COUNT); while ((crime_read_64 (CRIME_TIME) & CRIME_TIME_MASK) - crime_time < WAIT_MS * 1000000 / CRIME_NS_PER_TICK) ; cc_tick = read_32bit_cp0_register (CP0_COUNT) - cc_tick; cc_interval = cc_tick / HZ * (1000 / WAIT_MS); /* The round-off seems unnecessary; in testing, the error of the * above procedure is < 100 ticks, which means it gets filtered * out by the HZ adjustment. */ cc_interval = (cc_interval / PER_MHZ) * PER_MHZ; printk("%d MHz CPU detected\n", (int) (cc_interval / PER_MHZ)); setup_irq (CLOCK_IRQ, irq); } |
From: Andy P. <at...@us...> - 2002-04-10 18:32:40
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips64/tools In directory usw-pr-cvs1:/tmp/cvs-serv18937/mips64/tools Modified Files: Makefile Log Message: synch 2.4.15 commit 38 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/tools/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 14 Jan 2001 19:54:49 -0000 1.1.1.1 +++ Makefile 10 Apr 2002 14:43:23 -0000 1.2 @@ -1,4 +1,3 @@ -# $Id$ # # Makefile for MIPS kernel build tools. # |
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips/philips/nino In directory usw-pr-cvs1:/tmp/cvs-serv20728/mips/philips/nino Added Files: Makefile int-handler.S irq.c kgdb.c power.c prom.c reset.c rtc.c setup.c time.c Log Message: synch 2.4.15 commit 39 --- NEW FILE --- # # Makefile for the Philips Nino specific parts of the kernel # # Note! Dependencies are done automagically by 'make dep', which also # removes any old dependencies. DON'T put your own dependencies here # unless it's something special (ie not a .c file). # .S.s: $(CPP) $(AFLAGS) $< -o $@ .S.o: $(CC) $(AFLAGS) -c $< -o $@ O_TARGET := nino.o all: nino.o obj-y := int-handler.o setup.o irq.o time.o reset.o rtc.o prom.o power.o int-handler.o: int-handler.S obj-$(CONFIG_REMOTE_DEBUG) += kgdb.o obj-$(CONFIG_BLK_DEV_INITRD) += ramdisk.o ramdisk.o: $(MAKE) -C ramdisk mv ramdisk/ramdisk.o ramdisk.o clean: rm -f *.o include $(TOPDIR)/Rules.make --- NEW FILE --- /* * linux/arch/mips/philips/nino/int-handler.S * * Copyright (C) 1999 Harald Koerfgen * Copyright (C) 2000 Jim Pick (ji...@ji...) * Copyright (C) 2001 Steven J. Hill (sj...@re...) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Interrupt handler for Philips Nino. */ #include <asm/asm.h> #include <asm/regdef.h> #include <asm/mipsregs.h> #include <asm/stackframe.h> #include <asm/tx3912.h> .data .globl HighPriVect HighPriVect: .word spurious # Reserved .word io_posnegint0 # IOPOSINT(0) or IONEGINT(0) .word spurious # CHIDMACNTINT .word spurious # TELDMACNTINT .word spurious # SNDDMACNTINT .word spurious # Reserved .word io_negint56 # IONEGINT(6) or IONEGINT(5) .word spurious # Reserved .word io_posint56 # IOPOSINT(6) or IOPOSINT(5) .word spurious # Reserved .word spurious # UARTBRXINT .word uarta_rx # UARTARXINT .word spurious # Reserved .word periodic_timer # PERINT .word spurious # ALARMINT .word spurious # POSPWROKINT or NEGPWROKINT /* * Here is the entry point to handle all interrupts. */ .text .set noreorder .align 5 NESTED(nino_handle_int, PT_SIZE, ra) .set noat SAVE_ALL CLI .set at /* * Get pending Interrupts */ mfc0 t0, CP0_CAUSE # Get pending interrupts andi t2, t0, IE_IRQ4 # IRQ4 (high priority) bne t2, IE_IRQ4, low_priority nop /* * Ok, we've got a high priority interrupt (a.k.a. an external interrupt). * Read Interrupt Status Register 6 to get vector. */ high_priority: lui t0, %hi(IntStatus6) lw t1, %lo(IntStatus6)(t0) andi t1, INT6_INTVECT la t2, HighPriVect addu t1, t1, t2 lw t2, 0(t1) jr t2 nop /* * Ok, we've got one of over a hundred other interupts. */ low_priority: lui t0, %hi(IntStatus1) lw t1, %lo(IntStatus1)(t0) j handle_it li a0, 20 /* * We don't currently handle spurious interrupts. */ spurious: j spurious_interrupt nop /* * We have the IRQ number, dispatch to the real handler. */ handle_it: jal do_IRQ move a1,sp j ret_from_irq nop /************************************ * High priority interrupt mappings * ************************************/ /* * Periodic timer - IRQ 0 */ periodic_timer: j handle_it li a0, 0 /* * UARTA RX - IRQ 3 */ uarta_rx: j handle_it li a0, 3 /* * GPIO Pin 0 transition - IRQ 10 */ io_posnegint0: j handle_it li a0, 10 /* * GPIO Pin 5 or 6 transition (0-to-1) - IRQ 11 */ io_posint56: j handle_it li a0, 11 /* * GPIO Pin 5 or 6 transition (1-to-0) - IRQ 12 */ io_negint56: j handle_it li a0, 12 END(nino_handle_int) --- NEW FILE --- /* * linux/arch/mips/philips/nino/irq.c * * Copyright (C) 1992 Linus Torvalds * Copyright (C) 1999 Harald Koerfgen * Copyright (C) 2000 Pavel Machek (pa...@su...) * Copyright (C) 2001 Steven J. Hill (sj...@re...) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Generic interrupt handler for Philips Nino. */ #include <linux/errno.h> #include <linux/init.h> #include <linux/kernel_stat.h> #include <linux/signal.h> #include <linux/sched.h> #include <linux/types.h> #include <linux/interrupt.h> #include <linux/ioport.h> #include <linux/timex.h> #include <linux/slab.h> #include <linux/random.h> #include <asm/bitops.h> #include <asm/bootinfo.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/mipsregs.h> #include <asm/system.h> #include <asm/tx3912.h> unsigned long spurious_count = 0; irq_cpustat_t irq_stat [NR_CPUS]; static inline void mask_irq(unsigned int irq_nr) { switch (irq_nr) { case 0: /* Periodic Timer Interrupt */ IntClear5 = INT5_PERIODICINT; IntClear6 = INT6_PERIODICINT; IntEnable6 &= ~INT6_PERIODICINT; break; case 3: /* Serial port receive interrupt */ break; case 2: /* Serial port transmit interrupt */ break; default: printk( "Attempt to mask unknown IRQ %d?\n", irq_nr ); } } static inline void unmask_irq(unsigned int irq_nr) { switch (irq_nr) { case 0: IntEnable6 |= INT6_PERIODICINT; break; case 3: /* Serial port receive interrupt */ break; case 2: /* Serial port transmit interrupt */ break; default: printk( "Attempt to unmask unknown IRQ %d?\n", irq_nr ); } } void disable_irq(unsigned int irq_nr) { unsigned long flags; save_and_cli(flags); mask_irq(irq_nr); restore_flags(flags); } void enable_irq(unsigned int irq_nr) { unsigned long flags; save_and_cli(flags); unmask_irq(irq_nr); restore_flags(flags); } /* * Pointers to the low-level handlers: first the general ones, then the * fast ones, then the bad ones. */ extern void interrupt(void); static struct irqaction *irq_action[NR_IRQS] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; int get_irq_list(char *buf) { int i, len = 0; struct irqaction *action; for (i = 0; i < NR_IRQS; i++) { action = irq_action[i]; if (!action) continue; len += sprintf(buf + len, "%2d: %8d %c %s", i, kstat.irqs[0][i], (action->flags & SA_INTERRUPT) ? '+' : ' ', action->name); for (action = action->next; action; action = action->next) { len += sprintf(buf + len, ",%s %s", (action->flags & SA_INTERRUPT) ? " +" : "", action->name); } len += sprintf(buf + len, "\n"); } return len; } atomic_t __mips_bh_counter; /* * do_IRQ handles IRQ's that have been installed without the * SA_INTERRUPT flag: it uses the full signal-handling return * and runs with other interrupts enabled. All relatively slow * IRQ's should use this format: notably the keyboard/timer * routines. */ asmlinkage void do_IRQ(int irq, struct pt_regs *regs) { struct irqaction *action; int do_random, cpu; if (irq == 20) { if (IntStatus2 & 0xfffff00) { if (IntStatus2 & 0x0f000000) return do_IRQ(2, regs); } } cpu = smp_processor_id(); irq_enter(cpu, irq); kstat.irqs[cpu][irq]++; if (irq == 20) { printk("20 %08lx %08lx\n %08lx %08lx\n %08lx\n", IntStatus1, IntStatus2, IntStatus3, IntStatus4, IntStatus5 ); printk("20 %08lx %08lx\n %08lx %08lx\n %08lx\n", IntEnable1, IntEnable2, IntEnable3, IntEnable4, IntEnable5 ); } mask_irq(irq); action = *(irq + irq_action); if (action) { if (!(action->flags & SA_INTERRUPT)) __sti(); do_random = 0; do { do_random |= action->flags; action->handler(irq, action->dev_id, regs); action = action->next; } while (action); if (do_random & SA_SAMPLE_RANDOM) add_interrupt_randomness(irq); unmask_irq(irq); __cli(); } else { IntClear1 = ~0; IntClear3 = ~0; IntClear4 = ~0; IntClear5 = ~0; unmask_irq(irq); } irq_exit(cpu, irq); /* unmasking and bottom half handling is done magically for us. */ } /* * Idea is to put all interrupts * in a single table and differenciate them just by number. */ int setup_nino_irq(int irq, struct irqaction *new) { int shared = 0; struct irqaction *old, **p; unsigned long flags; p = irq_action + irq; if ((old = *p) != NULL) { /* Can't share interrupts unless both agree to */ if (!(old->flags & new->flags & SA_SHIRQ)) return -EBUSY; /* Can't share interrupts unless both are same type */ if ((old->flags ^ new->flags) & SA_INTERRUPT) return -EBUSY; /* add new interrupt at end of irq queue */ do { p = &old->next; old = *p; } while (old); shared = 1; } if (new->flags & SA_SAMPLE_RANDOM) rand_initialize_irq(irq); save_and_cli(flags); *p = new; if (!shared) { unmask_irq(irq); } restore_flags(flags); return 0; } int request_irq(unsigned int irq, void (*handler) (int, void *, struct pt_regs *), unsigned long irqflags, const char *devname, void *dev_id) { int retval; struct irqaction *action; if (irq >= NR_IRQS) return -EINVAL; if (!handler) return -EINVAL; action = (struct irqaction *) kmalloc(sizeof(struct irqaction), GFP_KERNEL); if (!action) return -ENOMEM; action->handler = handler; action->flags = irqflags; action->mask = 0; action->name = devname; action->next = NULL; action->dev_id = dev_id; retval = setup_nino_irq(irq, action); if (retval) kfree(action); return retval; } void free_irq(unsigned int irq, void *dev_id) { struct irqaction *action, **p; unsigned long flags; if (irq >= NR_IRQS) { printk(KERN_CRIT __FUNCTION__ ": trying to free IRQ%d\n", irq); return; } for (p = irq + irq_action; (action = *p) != NULL; p = &action->next) { if (action->dev_id != dev_id) continue; /* Found it - now free it */ save_and_cli(flags); *p = action->next; if (!irq[irq_action]) mask_irq(irq); restore_flags(flags); kfree(action); return; } printk(KERN_CRIT __FUNCTION__ ": trying to free free IRQ%d\n", irq); } unsigned long probe_irq_on(void) { /* TODO */ return 0; } int probe_irq_off(unsigned long irqs) { /* TODO */ return 0; } void __init init_IRQ(void) { irq_setup(); } --- NEW FILE --- /* * linux/arch/mips/philips/nino/kgdb.c * * Copyright (C) 2001 Steven J. Hill (sj...@re...) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Kernel debugging on the Philips Nino. */ #include <asm/system.h> #include <asm/tx3912.h> static int remoteDebugInitialized = 0; void debugInit(void) { /* * If low-level debugging (before GDB or console operational) is * configured, then we do not need to re-initialize the UART. */ #ifndef CONFIG_DEBUG_LL earlyInitUartPR31700(); #endif } char getDebugChar(void) { char buf; unsigned long int2, flags; if (!remoteDebugInitialized) { debugInit(); remoteDebugInitialized = 1; } save_and_cli(flags); int2 = IntEnable2; IntEnable2 = 0; while(!(UartA_Ctrl1 & UART_RX_HOLD_FULL)); buf = UartA_Data; IntEnable2 = int2; restore_flags(flags); return buf; } int putDebugChar(char c) { int i; unsigned long int2; if (!remoteDebugInitialized) { debugInit(); remoteDebugInitialized = 1; } int2 = IntEnable2; IntEnable2 &= ~(INT2_UARTATXINT | INT2_UARTATXOVERRUN | INT2_UARTAEMPTY); for (i = 0; !(IntStatus2 & INT2_UARTATXINT) && (i < 10000); i++); IntClear2 = INT2_UARTATXINT | INT2_UARTATXOVERRUN | INT2_UARTAEMPTY; UartA_Data = c; for (i = 0; !(IntStatus2 & INT2_UARTATXINT) && (i < 10000); i++); IntClear2 = INT2_UARTATXINT | INT2_UARTATXOVERRUN | INT2_UARTAEMPTY; IntEnable2 = int2; return 1; } --- NEW FILE --- /* * linux/arch/mips/philips/nino/power.c * * Copyright (C) 2000 Jim Pick <ji...@ji...> * Copyright (C) 2001 Steven J. Hill (sj...@re...) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Power management routines on the Philips Nino. */ #include <asm/tx3912.h> void nino_wait(void) { /* We stop the CPU to conserve power */ PowerControl |= PWR_STOPCPU; /* * We wait until an interrupt happens... */ /* We resume here */ PowerControl &= ~PWR_STOPCPU; /* Give ourselves a little delay */ __asm__ __volatile__( "nop\n\t" "nop\n\t" "nop\n\t" "nop\n\t" "nop\n\t" "nop\n\t" "nop\n\t"); } --- NEW FILE --- /* * linux/arch/mips/philips/nino/prom.c * * Copyright (C) 2001 Steven J. Hill (sj...@re...) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Early initialization code for the Philips Nino. */ #include <linux/config.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/string.h> #include <asm/bootinfo.h> #include <asm/addrspace.h> #include <asm/page.h> char arcs_cmdline[COMMAND_LINE_SIZE]; #ifdef CONFIG_FB_TX3912 extern u_long tx3912fb_paddr; extern u_long tx3912fb_vaddr; extern u_long tx3912fb_size; #endif /* Do basic initialization */ void __init prom_init(int argc, char **argv, unsigned long magic, int *prom_vec) { u_long free_end, mem_size; u_int i; /* * collect args and prepare cmd_line */ for (i = 1; i < argc; i++) { strcat(arcs_cmdline, argv[i]); if (i < (argc - 1)) strcat(arcs_cmdline, " "); } mips_machgroup = MACH_GROUP_PHILIPS; mips_machtype = MACH_PHILIPS_NINO; #ifdef CONFIG_NINO_4MB mem_size = 4 << 20; #elif CONFIG_NINO_8MB mem_size = 8 << 20; #elif CONFIG_NINO_16MB mem_size = 16 << 20; #endif #ifdef CONFIG_FB_TX3912 /* * The LCD controller requires that the framebuffer * start address fall within a 1MB segment and is * aligned on a 16 byte boundary. The way to assure * this is to place the framebuffer at the end of * memory and mark it as reserved. */ free_end = (mem_size - tx3912fb_size) & PAGE_MASK; add_memory_region(0, free_end, BOOT_MEM_RAM); add_memory_region(free_end, (mem_size - free_end), BOOT_MEM_RESERVED); /* * Calculate physical and virtual addresses for * the beginning of the framebuffer. */ tx3912fb_paddr = PHYSADDR(free_end); tx3912fb_vaddr = KSEG1ADDR(free_end); #else add_memory_region(0, mem_size, BOOT_MEM_RAM); #endif } void __init prom_free_prom_memory (void) { } --- NEW FILE --- /* * linux/arch/mips/philips/nino/reset.c * * Copyright (C) 2001 Steven J. Hill (sj...@re...) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Generic restart, halt and power off functions for Philips Nino. */ #include <linux/init.h> #include <asm/reboot.h> void (*reset_vector)(void) = (void (*)(void)) 0xBFC00000; void nino_machine_restart(char *command) { reset_vector(); } void nino_machine_halt(void) { reset_vector(); } void nino_machine_power_off(void) { reset_vector(); } void __init setup_nino_reset_vectors(void) { _machine_restart = nino_machine_restart; _machine_halt = nino_machine_halt; _machine_power_off = nino_machine_power_off; } --- NEW FILE --- /* * linux/arch/mips/philips/nino/rtc.c * * Copyright (C) 2001 Steven J. Hill (sj...@re...) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Functions to access RTC on the Philips Nino. */ #include <linux/spinlock.h> #include <linux/mc146818rtc.h> static unsigned char nino_rtc_read_data(unsigned long addr) { return 0; } static void nino_rtc_write_data(unsigned char data, unsigned long addr) { } static int nino_rtc_bcd_mode(void) { return 0; } struct rtc_ops nino_rtc_ops = { &nino_rtc_read_data, &nino_rtc_write_data, &nino_rtc_bcd_mode }; --- NEW FILE --- /* * linux/arch/mips/philips/nino/setup.c * * Copyright (C) 2001 Steven J. Hill (sj...@re...) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Interrupt and exception initialization for Philips Nino. */ #include <linux/console.h> #include <linux/init.h> #include <linux/interrupt.h> #include <linux/mc146818rtc.h> #include <linux/sched.h> #include <asm/addrspace.h> #include <asm/gdb-stub.h> #include <asm/irq.h> #include <asm/wbflush.h> #include <asm/tx3912.h> extern struct rtc_ops nino_rtc_ops; extern void nino_wait(void); extern void setup_nino_reset_vectors(void); extern asmlinkage void nino_handle_int(void); extern int setup_nino_irq(int, struct irqaction *); void (*board_time_init) (struct irqaction * irq); #ifdef CONFIG_REMOTE_DEBUG extern void set_debug_traps(void); extern void breakpoint(void); static int remote_debug = 0; #endif static void __init nino_irq_setup(void) { unsigned int tmp; /* Turn all interrupts off */ IntEnable1 = 0; IntEnable2 = 0; IntEnable3 = 0; IntEnable4 = 0; IntEnable5 = 0; IntEnable6 = 0; /* Clear all interrupts */ IntClear1 = 0xffffffff; IntClear2 = 0xffffffff; IntClear3 = 0xffffffff; IntClear4 = 0xffffffff; IntClear5 = 0xffffffff; IntClear6 = 0xffffffff; /* * Enable only the interrupts for the UART and negative * edge (1-to-0) triggered multi-function I/O pins. */ change_cp0_status(ST0_BEV, 0); tmp = read_32bit_cp0_register(CP0_STATUS); change_cp0_status(ST0_IM, tmp | IE_IRQ2 | IE_IRQ4); /* Register the global interrupt handler */ set_except_vector(0, nino_handle_int); #ifdef CONFIG_REMOTE_DEBUG if (remote_debug) { set_debug_traps(); breakpoint(); } #endif } static __init void nino_time_init(struct irqaction *irq) { unsigned int scratch = 0; /* * Enable periodic interrupts */ setup_nino_irq(0, irq); RTCperiodTimer = PER_TIMER_COUNT; RTCtimerControl = TIM_ENPERTIMER; IntEnable5 |= INT5_PERIODICINT; scratch = inl(TX3912_CLK_CTRL_BASE); scratch |= TX3912_CLK_CTRL_ENTIMERCLK; outl(scratch, TX3912_CLK_CTRL_BASE); /* Enable all interrupts */ IntEnable6 |= INT6_GLOBALEN | INT6_PERIODICINT; } void __init nino_setup(void) { irq_setup = nino_irq_setup; board_time_init = nino_time_init; /* Base address to use for PC type I/O accesses */ mips_io_port_base = KSEG1ADDR(0xB0C00000); setup_nino_reset_vectors(); /* Function called during process idle (cpu_idle) */ cpu_wait = nino_wait; #ifdef CONFIG_FB conswitchp = &dummy_con; #endif #ifdef CONFIG_REMOTE_DEBUG remote_debug = 1; #endif rtc_ops = &nino_rtc_ops; } --- NEW FILE --- /* * linux/arch/mips/philips/nino/time.c * * Copyright (C) 1999 Harald Koerfgen * Copyright (C) 2000 Pavel Machek (pa...@su...) * Copyright (C) 2001 Steven J. Hill (sj...@re...) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Time handling functinos for Philips Nino. */ #include <linux/errno.h> #include <linux/init.h> #include <linux/sched.h> #include <linux/kernel.h> #include <linux/param.h> #include <linux/string.h> #include <linux/mm.h> #include <linux/interrupt.h> #include <linux/timex.h> #include <linux/delay.h> #include <asm/tx3912.h> extern volatile unsigned long wall_jiffies; extern rwlock_t xtime_lock; static struct timeval xbase; #define USECS_PER_JIFFY (1000000/HZ) /* * Poll the Interrupt Status Registers */ #undef POLL_STATUS static unsigned long do_gettimeoffset(void) { /* * This is a kludge */ return 0; } static void inline readRTC(unsigned long *high, unsigned long *low) { /* read twice, and keep reading till we find two * the same pairs. This is needed in case the RTC * was updating its registers and we read a old * High but a new Low. */ do { *high = RTChigh & RTC_HIGHMASK; *low = RTClow; } while (*high != (RTChigh & RTC_HIGHMASK) || RTClow!=*low); } /* * This version of gettimeofday has near millisecond resolution. */ void do_gettimeofday(struct timeval *tv) { unsigned long flags; unsigned long high, low; read_lock_irqsave(&xtime_lock, flags); // 40 bit RTC, driven by 32khz source: // +-----------+-----------------------------------------+ // | HHHH.HHHH | LLLL.LLLL.LLLL.LLLL.LMMM.MMMM.MMMM.MMMM | // +-----------+-----------------------------------------+ readRTC(&high,&low); tv->tv_sec = (high << 17) | (low >> 15); tv->tv_usec = (low % 32768) * 1953 / 64; tv->tv_sec += xbase.tv_sec; tv->tv_usec += xbase.tv_usec; tv->tv_usec += do_gettimeoffset(); /* * xtime is atomically updated in timer_bh. lost_ticks is * nonzero if the timer bottom half hasnt executed yet. */ if (jiffies - wall_jiffies) tv->tv_usec += USECS_PER_JIFFY; read_unlock_irqrestore(&xtime_lock, flags); if (tv->tv_usec >= 1000000) { tv->tv_usec -= 1000000; tv->tv_sec++; } } void do_settimeofday(struct timeval *tv) { write_lock_irq(&xtime_lock); /* This is revolting. We need to set the xtime.tv_usec * correctly. However, the value in this location is * is value at the last tick. * Discover what correction gettimeofday * would have done, and then undo it! */ tv->tv_usec -= do_gettimeoffset(); if (tv->tv_usec < 0) { tv->tv_usec += 1000000; tv->tv_sec--; } /* reset RTC to 0 (real time is xbase + RTC) */ xbase = *tv; RTCtimerControl |= TIM_RTCCLEAR; RTCtimerControl &= ~TIM_RTCCLEAR; RTCalarmHigh = RTCalarmLow = ~0UL; xtime = *tv; time_state = TIME_BAD; time_maxerror = MAXPHASE; time_esterror = MAXPHASE; write_unlock_irq(&xtime_lock); } static int set_rtc_mmss(unsigned long nowtime) { int retval = 0; return retval; } /* last time the cmos clock got updated */ static long last_rtc_update = 0; /* * timer_interrupt() needs to keep up the real-time clock, * as well as call the "do_timer()" routine every clocktick */ int do_write = 1; static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { #ifdef POLL_STATUS static unsigned long old_IntStatus1 = 0; static unsigned long old_IntStatus3 = 0; static unsigned long old_IntStatus4 = 0; static unsigned long old_IntStatus5 = 0; static int counter = 0; int i; new_spircv = SPIData & 0xff; if ((old_spircv != new_spircv) && (new_spircv != 0xff)) { printk( "SPIData changed: %x\n", new_spircv ); } old_spircv = new_spircv; if (do_write) SPIData = 0; #endif if (!user_mode(regs)) { if (prof_buffer && current->pid) { extern int _stext; unsigned long pc = regs->cp0_epc; pc -= (unsigned long) &_stext; pc >>= prof_shift; /* * Dont ignore out-of-bounds pc values silently, * put them into the last histogram slot, so if * present, they will show up as a sharp peak. */ if (pc > prof_len - 1) pc = prof_len - 1; atomic_inc((atomic_t *) & prof_buffer[pc]); } } /* * aaaand... action! */ do_timer(regs); /* * If we have an externally syncronized Linux clock, then update * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be * called as close as possible to 500 ms before the new second starts. */ if (time_state != TIME_BAD && xtime.tv_sec > last_rtc_update + 660 && xtime.tv_usec > 500000 - (tick >> 1) && xtime.tv_usec < 500000 + (tick >> 1)) { if (set_rtc_mmss(xtime.tv_sec) == 0) last_rtc_update = xtime.tv_sec; else last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ } } static struct irqaction irq0 = {timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL}; void (*board_time_init) (struct irqaction * irq); int __init time_init(void) { struct timeval starttime; starttime.tv_sec = mktime(2000, 1, 1, 0, 0, 0); starttime.tv_usec = 0; do_settimeofday(&starttime); board_time_init(&irq0); return 0; } |
From: Andy P. <at...@us...> - 2002-04-10 18:32:34
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip27 In directory usw-pr-cvs1:/tmp/cvs-serv18937/mips64/sgi-ip27 Modified Files: Makefile ip27-berr.c ip27-console.c ip27-init.c ip27-irq-glue.S ip27-irq.c ip27-klconfig.c ip27-klnuma.c ip27-memory.c ip27-pci-dma.c ip27-pci.c ip27-setup.c ip27-timer.c Log Message: synch 2.4.15 commit 38 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip27/Makefile,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- Makefile 25 Feb 2001 23:15:22 -0000 1.1.1.2 +++ Makefile 10 Apr 2002 14:43:22 -0000 1.2 @@ -7,7 +7,7 @@ .S.o: $(CC) $(CFLAGS) -c $< -o $*.o -O_TARGET = ip27.a +O_TARGET = ip27.o obj-y := ip27-berr.o ip27-console.o ip27-irq.o ip27-init.o ip27-irq-glue.o \ ip27-klconfig.o ip27-klnuma.o ip27-memory.o ip27-nmi.o ip27-pci.o \ Index: ip27-berr.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip27/ip27-berr.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip27-berr.c 14 Jan 2001 19:54:37 -0000 1.1.1.1 +++ ip27-berr.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -8,6 +8,9 @@ */ #include <linux/init.h> #include <linux/kernel.h> +#include <linux/module.h> + +#include <asm/module.h> #include <asm/sn/addrs.h> #include <asm/sn/arch.h> #include <asm/sn/sn0/hub.h> @@ -43,16 +46,43 @@ return 0; } +extern spinlock_t modlist_lock; + static inline unsigned long search_dbe_table(unsigned long addr) { unsigned long ret; +#ifndef CONFIG_MODULES /* There is only the kernel to search. */ ret = search_one_table(__start___dbe_table, __stop___dbe_table-1, addr); - if (ret) return ret; - - return 0; + return ret; +#else + unsigned long flags; + + /* The kernel is the last "module" -- no need to treat it special. */ + struct module *mp; + struct archdata *ap; + + spin_lock_irqsave(&modlist_lock, flags); + for (mp = module_list; mp != NULL; mp = mp->next) { + if (!mod_member_present(mp, archdata_end) || + !mod_archdata_member_present(mp, struct archdata, + dbe_table_end)) + continue; + ap = (struct archdata *)(mod->archdata_start); + + if (ap->dbe_table_start == NULL || + !(mp->flags & (MOD_RUNNING | MOD_INITIALIZING))) + continue; + ret = search_one_table(ap->dbe_table_start, + ap->dbe_table_end - 1, addr); + if (ret) + break; + } + spin_unlock_irqrestore(&modlist_lock, flags); + return ret; +#endif } void do_ibe(struct pt_regs *regs) @@ -64,9 +94,43 @@ while(1); } +static void dump_hub_information(unsigned long errst0, unsigned long errst1) +{ + static char *err_type[2][8] = { + { NULL, "Uncached Partial Read PRERR", "DERR", "Read Timeout", + NULL, NULL, NULL, NULL }, + { "WERR", "Uncached Partial Write", "PWERR", "Write Timeout", + NULL, NULL, NULL, NULL } + }; + int wrb = errst1 & PI_ERR_ST1_WRBRRB_MASK; + + if (!(errst0 & PI_ERR_ST0_VALID_MASK)) { + printk("Hub does not contain valid error information\n"); + return; + } + + + printk("Hub has valid error information:\n"); + if (errst0 & PI_ERR_ST0_OVERRUN_MASK) + printk("Overrun is set. Error stack may contain additional " + "information.\n"); + printk("Hub error address is %08lx\n", + (errst0 & PI_ERR_ST0_ADDR_MASK) >> (PI_ERR_ST0_ADDR_SHFT - 3)); + printk("Incoming message command 0x%lx\n", + (errst0 & PI_ERR_ST0_CMD_MASK) >> PI_ERR_ST0_CMD_SHFT); + printk("Supplemental field of incoming message is 0x%lx\n", + (errst0 & PI_ERR_ST0_SUPPL_MASK) >> PI_ERR_ST0_SUPPL_SHFT); + printk("T5 Rn (for RRB only) is 0x%lx\n", + (errst0 & PI_ERR_ST0_REQNUM_MASK) >> PI_ERR_ST0_REQNUM_SHFT); + printk("Error type is %s\n", err_type[wrb] + [(errst0 & PI_ERR_ST0_TYPE_MASK) >> PI_ERR_ST0_TYPE_SHFT] + ? : "invalid"); +} + void do_dbe(struct pt_regs *regs) { - unsigned long fixup; + unsigned long fixup, errst0, errst1; + int cpu = LOCAL_HUB_L(PI_CPU_NUM); fixup = search_dbe_table(regs->cp0_epc); if (fixup) { @@ -77,7 +141,12 @@ return; } - printk("Got dbe at 0x%lx\n", regs->cp0_epc); + printk("Slice %c got dbe at 0x%lx\n", 'A' + cpu, regs->cp0_epc); + printk("Hub information:\n"); + printk("ERR_INT_PEND = 0x%06lx\n", LOCAL_HUB_L(PI_ERR_INT_PEND)); + errst0 = LOCAL_HUB_L(cpu ? PI_ERR_STATUS0_B : PI_ERR_STATUS0_A); + errst1 = LOCAL_HUB_L(cpu ? PI_ERR_STATUS1_B : PI_ERR_STATUS1_A); + dump_hub_information(errst0, errst1); show_regs(regs); dump_tlb_all(); while(1); @@ -95,7 +164,7 @@ set_except_vector(7, handle_dbe); LOCAL_HUB_S(PI_ERR_INT_PEND, - cpu ? PI_ERR_CLEAR_ALL_A : PI_ERR_CLEAR_ALL_B); + cpu ? PI_ERR_CLEAR_ALL_B : PI_ERR_CLEAR_ALL_A); LOCAL_HUB_S(PI_ERR_INT_MASK_A + cpuoff, 0); LOCAL_HUB_S(PI_ERR_STACK_ADDR_A + cpuoff, 0); LOCAL_HUB_S(PI_ERR_STACK_SIZE, 0); /* Disable error stack */ Index: ip27-console.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip27/ip27-console.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip27-console.c 14 Jan 2001 19:54:49 -0000 1.1.1.1 +++ ip27-console.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -2,6 +2,8 @@ * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. + * + * Copyright (C) 2001 Ralf Baechle */ #include <linux/init.h> #include <linux/console.h> @@ -11,7 +13,6 @@ #include <asm/sn/sn0/hub.h> #include <asm/sn/klconfig.h> #include <asm/sn/ioc3.h> -#include <asm/sgialib.h> #include <asm/sn/sn_private.h> void prom_putchar(char c) Index: ip27-init.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip27/ip27-init.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- ip27-init.c 25 Feb 2001 23:15:22 -0000 1.1.1.2 +++ ip27-init.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -1,3 +1,12 @@ +/* + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file "COPYING" in the main directory of this + * archive for more details. + * + * Copyright (C) 2000 - 2001 by Kanoj Sarcar (ka...@sg...) + * Copyright (C) 2000 - 2001 by Silicon Graphics, Inc. + */ + #include <linux/config.h> #include <linux/kernel.h> #include <linux/init.h> @@ -23,14 +32,14 @@ #include <asm/sn/sn_private.h> #include <asm/sn/sn0/ip27.h> #include <asm/sn/mapped_kernel.h> +#include <asm/sn/sn0/addrs.h> +#include <asm/sn/gda.h> #define CPU_NONE (cpuid_t)-1 -#define CPUMASK_CLRALL(p) (p) = 0 -#define CPUMASK_SETB(p, bit) (p) |= 1 << (bit) -#define CPUMASK_CLRB(p, bit) (p) &= ~(1ULL << (bit)) -#define CPUMASK_TSTB(p, bit) ((p) & (1ULL << (bit))) - +/* + * The following should work till 64 nodes, ie 128p SN0s. + */ #define CNODEMASK_CLRALL(p) (p) = 0 #define CNODEMASK_TSTB(p, bit) ((p) & (1ULL << (bit))) #define CNODEMASK_SETB(p, bit) ((p) |= 1ULL << (bit)) @@ -42,11 +51,13 @@ static spinlock_t hub_mask_lock = SPIN_LOCK_UNLOCKED; static cnodemask_t hub_init_mask; static atomic_t numstarted = ATOMIC_INIT(1); +static int router_distance; nasid_t master_nasid = INVALID_NASID; cnodeid_t nasid_to_compact_node[MAX_NASIDS]; nasid_t compact_to_nasid_node[MAX_COMPACT_NODES]; cnodeid_t cpuid_to_compact_node[MAXCPUS]; +char node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES]; hubreg_t get_region(cnodeid_t cnode) { @@ -89,9 +100,13 @@ return brd->brd_nasid; } +/* Tweak this for maximum number of CPUs to activate */ +static int max_cpus = NR_CPUS; + int do_cpumask(cnodeid_t cnode, nasid_t nasid, cpumask_t *boot_cpumask, int *highest) { + static int tot_cpus_found = 0; lboard_t *brd; klcpu_t *acpu; int cpus_found = 0; @@ -109,9 +124,11 @@ if (cpuid > *highest) *highest = cpuid; /* Only let it join in if it's marked enabled */ - if (acpu->cpu_info.flags & KLINFO_ENABLE) { + if ((acpu->cpu_info.flags & KLINFO_ENABLE) && + (tot_cpus_found != max_cpus)) { CPUMASK_SETB(*boot_cpumask, cpuid); cpus_found++; + tot_cpus_found++; } acpu = (klcpu_t *)find_component(brd, (klinfo_t *)acpu, KLSTRUCT_CPU); @@ -172,6 +189,9 @@ void mlreset (void) { int i; + void init_topology_matrix(void); + void dump_topology(void); + master_nasid = get_nasid(); fine_mode = is_fine_dirmode(); @@ -184,6 +204,9 @@ maxcpus = cpu_node_probe(&boot_cpumask, &numnodes); printk("Discovered %d cpus on %d nodes\n", maxcpus, numnodes); + init_topology_matrix(); + dump_topology(); + gen_region_mask(®ion_mask, numnodes); CNODEMASK_CLRALL(hub_init_mask); @@ -474,7 +497,7 @@ alloc_cpupda(cpu, num_cpus); del_from_runqueue(p); p->processor = num_cpus; - p->has_cpu = 1; /* we schedule the first task manually */ + p->cpus_runnable = 1 << num_cpus; /* we schedule the first task manually */ unhash_process(p); /* Attach to the address space of init_task. */ atomic_inc(&init_mm.mm_count); @@ -534,3 +557,284 @@ #else /* CONFIG_SMP */ void cboot(void) {} #endif /* CONFIG_SMP */ + + +#define rou_rflag rou_flags + +void +router_recurse(klrou_t *router_a, klrou_t *router_b, int depth) +{ + klrou_t *router; + lboard_t *brd; + int port; + + if (router_a->rou_rflag == 1) + return; + + if (depth >= router_distance) + return; + + router_a->rou_rflag = 1; + + for (port = 1; port <= MAX_ROUTER_PORTS; port++) { + if (router_a->rou_port[port].port_nasid == INVALID_NASID) + continue; + + brd = (lboard_t *)NODE_OFFSET_TO_K0( + router_a->rou_port[port].port_nasid, + router_a->rou_port[port].port_offset); + + if (brd->brd_type == KLTYPE_ROUTER) { + router = (klrou_t *)NODE_OFFSET_TO_K0(NASID_GET(brd), brd->brd_compts[0]); + if (router == router_b) { + if (depth < router_distance) + router_distance = depth; + } + else + router_recurse(router, router_b, depth + 1); + } + } + + router_a->rou_rflag = 0; +} + +int +node_distance(nasid_t nasid_a, nasid_t nasid_b) +{ + nasid_t nasid; + cnodeid_t cnode; + lboard_t *brd, *dest_brd; + int port; + klrou_t *router, *router_a = NULL, *router_b = NULL; + + /* Figure out which routers nodes in question are connected to */ + for (cnode = 0; cnode < numnodes; cnode++) { + nasid = COMPACT_TO_NASID_NODEID(cnode); + + if (nasid == -1) continue; + + brd = find_lboard_class((lboard_t *)KL_CONFIG_INFO(nasid), + KLTYPE_ROUTER); + + if (!brd) + continue; + + do { + if (brd->brd_flags & DUPLICATE_BOARD) + continue; + + router = (klrou_t *)NODE_OFFSET_TO_K0(NASID_GET(brd), brd->brd_compts[0]); + router->rou_rflag = 0; + + for (port = 1; port <= MAX_ROUTER_PORTS; port++) { + if (router->rou_port[port].port_nasid == INVALID_NASID) + continue; + + dest_brd = (lboard_t *)NODE_OFFSET_TO_K0( + router->rou_port[port].port_nasid, + router->rou_port[port].port_offset); + + if (dest_brd->brd_type == KLTYPE_IP27) { + if (dest_brd->brd_nasid == nasid_a) + router_a = router; + if (dest_brd->brd_nasid == nasid_b) + router_b = router; + } + } + + } while ( (brd = find_lboard_class(KLCF_NEXT(brd), KLTYPE_ROUTER)) ); + } + + if (router_a == NULL) { + printk("node_distance: router_a NULL\n"); + return -1; + } + if (router_b == NULL) { + printk("node_distance: router_b NULL\n"); + return -1; + } + + if (nasid_a == nasid_b) + return 0; + + if (router_a == router_b) + return 1; + + router_distance = 100; + router_recurse(router_a, router_b, 2); + + return router_distance; +} + +void +init_topology_matrix(void) +{ + nasid_t nasid, nasid2; + cnodeid_t row, col; + + for (row = 0; row < MAX_COMPACT_NODES; row++) + for (col = 0; col < MAX_COMPACT_NODES; col++) + node_distances[row][col] = -1; + + for (row = 0; row < numnodes; row++) { + nasid = COMPACT_TO_NASID_NODEID(row); + for (col = 0; col < numnodes; col++) { + nasid2 = COMPACT_TO_NASID_NODEID(col); + node_distances[row][col] = node_distance(nasid, nasid2); + } + } +} + +void +dump_topology(void) +{ + nasid_t nasid; + cnodeid_t cnode; + lboard_t *brd, *dest_brd; + int port; + int router_num = 0; + klrou_t *router; + cnodeid_t row, col; + + printk("************** Topology ********************\n"); + + printk(" "); + for (col = 0; col < numnodes; col++) + printk("%02d ", col); + printk("\n"); + for (row = 0; row < numnodes; row++) { + printk("%02d ", row); + for (col = 0; col < numnodes; col++) + printk("%2d ", node_distances[row][col]); + printk("\n"); + } + + for (cnode = 0; cnode < numnodes; cnode++) { + nasid = COMPACT_TO_NASID_NODEID(cnode); + + if (nasid == -1) continue; + + brd = find_lboard_class((lboard_t *)KL_CONFIG_INFO(nasid), + KLTYPE_ROUTER); + + if (!brd) + continue; + + do { + if (brd->brd_flags & DUPLICATE_BOARD) + continue; + printk("Router %d:", router_num); + router_num++; + + router = (klrou_t *)NODE_OFFSET_TO_K0(NASID_GET(brd), brd->brd_compts[0]); + + for (port = 1; port <= MAX_ROUTER_PORTS; port++) { + if (router->rou_port[port].port_nasid == INVALID_NASID) + continue; + + dest_brd = (lboard_t *)NODE_OFFSET_TO_K0( + router->rou_port[port].port_nasid, + router->rou_port[port].port_offset); + + if (dest_brd->brd_type == KLTYPE_IP27) + printk(" %d", dest_brd->brd_nasid); + if (dest_brd->brd_type == KLTYPE_ROUTER) + printk(" r"); + } + printk("\n"); + + } while ( (brd = find_lboard_class(KLCF_NEXT(brd), KLTYPE_ROUTER)) ); + } +} + +#if 0 +#define brd_widgetnum brd_slot +#define NODE_OFFSET_TO_KLINFO(n,off) ((klinfo_t*) TO_NODE_CAC(n,off)) +void +dump_klcfg(void) +{ + cnodeid_t cnode; + int i; + nasid_t nasid; + lboard_t *lbptr; + gda_t *gdap; + + gdap = (gda_t *)GDA_ADDR(get_nasid()); + if (gdap->g_magic != GDA_MAGIC) { + printk("dumpklcfg_cmd: Invalid GDA MAGIC\n"); + return; + } + + for (cnode = 0; cnode < MAX_COMPACT_NODES; cnode ++) { + nasid = gdap->g_nasidtable[cnode]; + + if (nasid == INVALID_NASID) + continue; + + printk("\nDumpping klconfig Nasid %d:\n", nasid); + + lbptr = KL_CONFIG_INFO(nasid); + + while (lbptr) { + printk(" %s, Nasid %d, Module %d, widget 0x%x, partition %d, NIC 0x%x lboard 0x%lx", + "board name here", /* BOARD_NAME(lbptr->brd_type), */ + lbptr->brd_nasid, lbptr->brd_module, + lbptr->brd_widgetnum, + lbptr->brd_partition, + (lbptr->brd_nic), lbptr); + if (lbptr->brd_flags & DUPLICATE_BOARD) + printk(" -D"); + printk("\n"); + for (i = 0; i < lbptr->brd_numcompts; i++) { + klinfo_t *kli; + kli = NODE_OFFSET_TO_KLINFO(NASID_GET(lbptr), lbptr->brd_compts[i]); + printk(" type %2d, flags 0x%04x, diagval %3d, physid %4d, virtid %2d: %s\n", + kli->struct_type, + kli->flags, + kli->diagval, + kli->physid, + kli->virtid, + "comp. name here"); + /* COMPONENT_NAME(kli->struct_type)); */ + } + lbptr = KLCF_NEXT(lbptr); + } + } + printk("\n"); + + /* Useful to print router maps also */ + + for (cnode = 0; cnode < MAX_COMPACT_NODES; cnode ++) { + klrou_t *kr; + int i; + + nasid = gdap->g_nasidtable[cnode]; + if (nasid == INVALID_NASID) + continue; + lbptr = KL_CONFIG_INFO(nasid); + + while (lbptr) { + + lbptr = find_lboard_class(lbptr, KLCLASS_ROUTER); + if(!lbptr) + break; + if (!KL_CONFIG_DUPLICATE_BOARD(lbptr)) { + printk("%llx -> \n", lbptr->brd_nic); + kr = (klrou_t *)find_first_component(lbptr, + KLSTRUCT_ROU); + for (i = 1; i <= MAX_ROUTER_PORTS; i++) { + printk("[%d, %llx]; ", + kr->rou_port[i].port_nasid, + kr->rou_port[i].port_offset); + } + printk("\n"); + } + lbptr = KLCF_NEXT(lbptr); + } + printk("\n"); + } + + dump_topology(); +} +#endif + Index: ip27-irq-glue.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip27/ip27-irq-glue.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip27-irq-glue.S 14 Jan 2001 19:54:39 -0000 1.1.1.1 +++ ip27-irq-glue.S 10 Apr 2002 14:43:22 -0000 1.2 @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. Index: ip27-irq.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip27/ip27-irq.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- ip27-irq.c 25 Feb 2001 23:15:22 -0000 1.1.1.2 +++ ip27-irq.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -3,6 +3,7 @@ * * Copyright (C) 1999, 2000 Ralf Baechle (ra...@gn...) * Copyright (C) 1999, 2000 Silicon Graphics, Inc. + * Copyright (C) 1999 - 2001 Kanoj Sarcar */ #include <linux/config.h> #include <linux/init.h> @@ -25,6 +26,7 @@ #include <asm/io.h> #include <asm/mipsregs.h> #include <asm/system.h> +#include <asm/irq.h> #include <asm/ptrace.h> #include <asm/processor.h> @@ -42,6 +44,10 @@ #define DBG(x...) #endif +/* These should die */ +unsigned char bus_to_wid[256]; /* widget id for linux pci bus */ +unsigned char bus_to_nid[256]; /* nasid for linux pci bus */ +unsigned char num_bridges; /* number of bridges in the system */ /* * Linux has a controller-independent x86 interrupt architecture. @@ -67,11 +73,11 @@ unsigned long spurious_count = 0; /* - * we need to map irq's up to at least bit 7 of the INT_MASK0_A register - * since bits 0-6 are pre-allocated for other purposes. + * There is a single intpend register per node, and we want to have + * distinct levels for intercpu intrs for both cpus A and B on a node. */ -#define IRQ_TO_SWLEVEL(cpu, i) i + 7 -#define SWLEVEL_TO_IRQ(cpu, s) s - 7 +int node_level_to_irq[MAX_COMPACT_NODES][PERNODE_LEVELS]; + /* * use these macros to get the encoded nasid and widget id * from the irq value @@ -82,6 +88,41 @@ #define WID_FROM_PCI_IRQ(i) bus_to_wid[IRQ_TO_BUS(i)] #define SLOT_FROM_PCI_IRQ(i) irq_to_slot[i] +static inline int alloc_level(cpuid_t cpunum, int irq) +{ + cnodeid_t nodenum = CPUID_TO_COMPACT_NODEID(cpunum); + int j = LEAST_LEVEL + 3; /* resched & crosscall entries taken */ + + while (++j < PERNODE_LEVELS) { + if (node_level_to_irq[nodenum][j] == -1) { + node_level_to_irq[nodenum][j] = irq; + return j; + } + } + printk("Cpu %ld flooded with devices\n", cpunum); + while(1); + return -1; +} + +static inline int find_level(cpuid_t *cpunum, int irq) +{ + int j; + cnodeid_t nodenum = INVALID_CNODEID; + + while (++nodenum < MAX_COMPACT_NODES) { + j = LEAST_LEVEL + 3; /* resched & crosscall entries taken */ + while (++j < PERNODE_LEVELS) + if (node_level_to_irq[nodenum][j] == irq) { + *cpunum = 0; /* XXX Fixme */ + return(j); + } + } + printk("Could not identify cpu/level for irq %d\n", irq); + while(1); + return(-1); +} + + void disable_irq(unsigned int irq_nr) { panic("disable_irq() called ..."); @@ -146,7 +187,8 @@ } irq_exit(thiscpu, irq); - /* unmasking and bottom half handling is done magically for us. */ + if (softirq_pending(thiscpu)) + do_softirq(); } /* @@ -196,7 +238,7 @@ swlevel = ms1bit(pend0); LOCAL_HUB_CLR_INTR(swlevel); /* "map" swlevel to irq */ - irq = SWLEVEL_TO_IRQ(thiscpu, swlevel); + irq = LEVEL_TO_IRQ(thiscpu, swlevel); do_IRQ(thiscpu, irq, regs); /* clear bit in pend0 */ pend0 ^= 1ULL << swlevel; @@ -227,7 +269,7 @@ * "map" irq to a swlevel greater than 6 since the first 6 bits * of INT_PEND0 are taken */ - swlevel = IRQ_TO_SWLEVEL(cpu, irq); + swlevel = alloc_level(cpu, irq); intr_connect_level(cpu, swlevel); bridge->b_int_addr[pin].addr = (0x20000 | swlevel | (master << 8)); @@ -254,6 +296,7 @@ { bridge_t *bridge; int pin, swlevel; + cpuid_t cpu; bridge = (bridge_t *) NODE_SWIN_BASE(NASID_FROM_PCI_IRQ(irq), WID_FROM_PCI_IRQ(irq)); @@ -264,8 +307,9 @@ * map irq to a swlevel greater than 6 since the first 6 bits * of INT_PEND0 are taken */ - swlevel = IRQ_TO_SWLEVEL(cpu, irq); - intr_disconnect_level(smp_processor_id(), swlevel); + swlevel = find_level(&cpu, irq); + intr_disconnect_level(cpu, swlevel); + LEVEL_TO_IRQ(cpu, swlevel) = -1; bridge->b_int_enable &= ~(1 << pin); bridge->b_widget.w_tflush; /* Flush */ @@ -423,7 +467,6 @@ printk(" ]\nStack dumps:"); for(i = 0; i < smp_num_cpus; i++) { - unsigned long esp; if (i == cpu) continue; printk("\nCPU %d:",i); @@ -661,37 +704,50 @@ #ifdef CONFIG_SMP #if (CPUS_PER_NODE == 2) static int done = 0; - int irq; /* * This is a hack till we have a pernode irqlist. Currently, * just have the master cpu set up the handlers for the per * cpu irqs. */ + if (done == 0) { + int j; - irq = CPU_RESCHED_A_IRQ + cputoslice(cpu); - intr_connect_level(cpu, IRQ_TO_SWLEVEL(cpu, irq)); - if (done == 0) - if (request_irq(irq, handle_resched_intr, 0, "resched", 0)) - panic("intercpu intr unconnectible\n"); - irq = CPU_CALL_A_IRQ + cputoslice(cpu); - intr_connect_level(cpu, IRQ_TO_SWLEVEL(cpu, irq)); - if (done == 0) - if (request_irq(irq, smp_call_function_interrupt, 0, - "callfunc", 0)) - panic("intercpu intr unconnectible\n"); - /* HACK STARTS */ - if (done) - return; - irq = CPU_RESCHED_A_IRQ + cputoslice(cpu) + 1; - if (request_irq(irq, handle_resched_intr, 0, "resched", 0)) - panic("intercpu intr unconnectible\n"); - irq = CPU_CALL_A_IRQ + cputoslice(cpu) + 1; - if (request_irq(irq, smp_call_function_interrupt, 0, - "callfunc", 0)) - panic("intercpu intr unconnectible\n"); - done = 1; - /* HACK ENDS */ + if (request_irq(CPU_RESCHED_A_IRQ, handle_resched_intr, + 0, "resched", 0)) + panic("intercpu intr unconnectible\n"); + if (request_irq(CPU_RESCHED_B_IRQ, handle_resched_intr, + 0, "resched", 0)) + panic("intercpu intr unconnectible\n"); + if (request_irq(CPU_CALL_A_IRQ, smp_call_function_interrupt, + 0, "callfunc", 0)) + panic("intercpu intr unconnectible\n"); + if (request_irq(CPU_CALL_B_IRQ, smp_call_function_interrupt, + 0, "callfunc", 0)) + panic("intercpu intr unconnectible\n"); + + for (j = 0; j < PERNODE_LEVELS; j++) + LEVEL_TO_IRQ(0, j) = -1; + LEVEL_TO_IRQ(0, FAST_IRQ_TO_LEVEL(CPU_RESCHED_A_IRQ)) = + CPU_RESCHED_A_IRQ; + LEVEL_TO_IRQ(0, FAST_IRQ_TO_LEVEL(CPU_RESCHED_B_IRQ)) = + CPU_RESCHED_B_IRQ; + LEVEL_TO_IRQ(0, FAST_IRQ_TO_LEVEL(CPU_CALL_A_IRQ)) = + CPU_CALL_A_IRQ; + LEVEL_TO_IRQ(0, FAST_IRQ_TO_LEVEL(CPU_CALL_B_IRQ)) = + CPU_CALL_B_IRQ; + for (j = 1; j < MAX_COMPACT_NODES; j++) + memcpy(&node_level_to_irq[j][0], + &node_level_to_irq[0][0], + sizeof(node_level_to_irq[0][0])*PERNODE_LEVELS); + + done = 1; + } + + intr_connect_level(cpu, FAST_IRQ_TO_LEVEL(CPU_RESCHED_A_IRQ + + cputoslice(cpu))); + intr_connect_level(cpu, FAST_IRQ_TO_LEVEL(CPU_CALL_A_IRQ + + cputoslice(cpu))); #else /* CPUS_PER_NODE */ #error Must redefine this for more than 2 CPUS. #endif /* CPUS_PER_NODE */ @@ -700,7 +756,9 @@ void install_tlbintr(int cpu) { +#if 0 int intr_bit = N_INTPEND_BITS + TLB_INTR_A + cputoslice(cpu); intr_connect_level(cpu, intr_bit); +#endif } Index: ip27-klconfig.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip27/ip27-klconfig.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip27-klconfig.c 14 Jan 2001 19:54:42 -0000 1.1.1.1 +++ ip27-klconfig.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * Copyright (C) 1999, 2000 Ralf Baechle (ra...@gn...) * Copyright (C) 1999, 2000 Silicon Graphics, Inc. */ @@ -57,6 +56,19 @@ return start; start = KLCF_NEXT(start); } + /* Didn't find it. */ + return (lboard_t *)NULL; +} + +lboard_t * find_lboard_class(lboard_t *start, unsigned char brd_type) +{ + /* Search all boards stored on this node. */ + while (start) { + if (KLCLASS(start->brd_type) == KLCLASS(brd_type)) + return start; + start = KLCF_NEXT(start); + } + /* Didn't find it. */ return (lboard_t *)NULL; } Index: ip27-klnuma.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip27/ip27-klnuma.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip27-klnuma.c 14 Jan 2001 19:54:49 -0000 1.1.1.1 +++ ip27-klnuma.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -1,6 +1,7 @@ /* * Ported from IRIX to Linux by Kanoj Sarcar, 06/08/00. - * Copyright 2000 Silicon Graphics, Inc. + * Copyright 2000 - 2001 Silicon Graphics, Inc. + * Copyright 2000 - 2001 Kanoj Sarcar (ka...@sg...) */ #include <linux/config.h> #include <linux/init.h> @@ -9,6 +10,7 @@ #include <linux/string.h> #include <asm/page.h> +#include <asm/smp.h> #include <asm/sn/types.h> #include <asm/sn/arch.h> #include <asm/sn/gda.h> @@ -16,10 +18,6 @@ #include <asm/sn/klkernvars.h> #include <asm/sn/mapped_kernel.h> #include <asm/sn/sn_private.h> - -#define CPUMASK_CLRALL(p) (p) = 0 -#define CPUMASK_SETB(p, bit) (p) |= 1 << (bit) -#define CPUMASK_TSTB(p, bit) ((p) & (1ULL << (bit))) extern char _end; static cpumask_t ktext_repmask; Index: ip27-memory.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip27/ip27-memory.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip27-memory.c 14 Jan 2001 19:54:43 -0000 1.1.1.1 +++ ip27-memory.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -20,6 +20,7 @@ #include <asm/bootinfo.h> #include <asm/addrspace.h> #include <asm/pgtable.h> +#include <asm/pgalloc.h> #include <asm/sn/types.h> #include <asm/sn/addrs.h> #include <asm/sn/klconfig.h> @@ -227,15 +228,24 @@ void __init paging_init(void) { + pmd_t *pmd = kpmdtbl; + pte_t *pte = kptbl; + cnodeid_t node; unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; + int i; /* Initialize the entire pgd. */ pgd_init((unsigned long)swapper_pg_dir); pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table); memset((void *)invalid_pte_table, 0, sizeof(pte_t) * PTRS_PER_PTE); - pmd_init((unsigned long)empty_bad_pmd_table, (unsigned long)empty_bad_page_table); - memset((void *)empty_bad_page_table, 0, sizeof(pte_t) * PTRS_PER_PTE); + + /* This is for vmalloc */ + memset((void *)kptbl, 0, PAGE_SIZE << KPTBL_PAGE_ORDER); + memset((void *)kpmdtbl, 0, PAGE_SIZE); + pgd_set(swapper_pg_dir, kpmdtbl); + for (i = 0; i < (1 << KPTBL_PAGE_ORDER); pmd++,i++,pte+=PTRS_PER_PTE) + pmd_val(*pmd) = (unsigned long)pte; for (node = 0; node < numnodes; node++) { pfn_t start_pfn = slot_getbasepfn(node, 0); Index: ip27-pci-dma.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip27/ip27-pci-dma.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip27-pci-dma.c 14 Jan 2001 19:54:43 -0000 1.1.1.1 +++ ip27-pci-dma.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * Dynamic DMA mapping support. * * On the Origin there is dynamic DMA address translation for all PCI DMA. @@ -52,4 +51,114 @@ void *vaddr, dma_addr_t dma_handle) { free_pages((unsigned long)vaddr, __get_order(size)); +} + +/* + * Map a single buffer of the indicated size for DMA in streaming mode. + * The 32-bit bus address to use is returned. + * + * Once the device is given the dma address, the device owns this memory + * until either pci_unmap_single or pci_dma_sync_single is performed. + */ +dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, + int direction) +{ + if (direction == PCI_DMA_NONE) + BUG(); + + return (bus_to_baddr[hwdev->bus->number] | __pa(ptr)); +} + +/* + * Unmap a single streaming mode DMA translation. The dma_addr and size + * must match what was provided for in a previous pci_map_single call. All + * other usages are undefined. + * + * After this call, reads by the cpu to the buffer are guarenteed to see + * whatever the device wrote there. + */ +void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, + size_t size, int direction) +{ + if (direction == PCI_DMA_NONE) + BUG(); + + /* Nothing to do */ +} + +/* + * Map a set of buffers described by scatterlist in streaming + * mode for DMA. This is the scather-gather version of the + * above pci_map_single interface. Here the scatter gather list + * elements are each tagged with the appropriate dma address + * and length. They are obtained via sg_dma_{address,length}(SG). + * + * NOTE: An implementation may be able to use a smaller number of + * DMA address/length pairs than there are SG table elements. + * (for example via virtual mapping capabilities) + * The routine returns the number of addr/length pairs actually + * used, at most nents. + * + * Device ownership issues as mentioned above for pci_map_single are + * the same here. + */ +int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, + int direction) +{ + int i; + + if (direction == PCI_DMA_NONE) + BUG(); + + /* Make sure that gcc doesn't leave the empty loop body. */ + for (i = 0; i < nents; i++, sg++) { + sg->address = (char *)(bus_to_baddr[hwdev->bus->number] | __pa(sg->address)); + } + + return nents; +} + +/* + * Unmap a set of streaming mode DMA translations. + * Again, cpu read rules concerning calls here are the same as for + * pci_unmap_single() above. + */ +void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, + int direction) +{ + if (direction == PCI_DMA_NONE) + BUG(); + + /* Nothing to do */ +} + +/* + * Make physical memory consistent for a single + * streaming mode DMA translation after a transfer. + * + * If you perform a pci_map_single() but wish to interrogate the + * buffer using the cpu, yet do not wish to teardown the PCI dma + * mapping, you must call this function before doing so. At the + * next point you give the PCI dma address back to the card, the + * device again owns the buffer. + */ +void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, + size_t size, int direction) +{ + if (direction == PCI_DMA_NONE) + BUG(); +} + +/* + * Make physical memory consistent for a set of streaming + * mode DMA translations after a transfer. + * + * The same as pci_dma_sync_single but for a scatter-gather list, + * same rules and usage. + */ +void pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, + int nelems, int direction) +{ + if (direction == PCI_DMA_NONE) + BUG(); } Index: ip27-pci.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip27/ip27-pci.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip27-pci.c 14 Jan 2001 19:54:44 -0000 1.1.1.1 +++ ip27-pci.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -18,7 +18,7 @@ /* * Max #PCI busses we can handle; ie, max #PCI bridges. */ -#define MAX_PCI_BUSSES 20 +#define MAX_PCI_BUSSES 40 /* * Max #PCI devices (like scsi controllers) we handle on a bus. @@ -55,8 +55,12 @@ bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id], \ bus_to_wid[bus_id]); \ \ - /*if (dev->bus->number) */ \ - /* return PCIBIOS_DEVICE_NOT_FOUND; */ \ + if (dev->vendor == PCI_VENDOR_ID_SGI \ + && dev->device == PCI_DEVICE_ID_SGI_IOC3 \ + && ((where >= 0x14 && where < 0x40) || (where >= 0x48))) { \ + *value = 0; \ + return PCIBIOS_SUCCESSFUL; \ + } \ \ __bit = (((where) & (bm)) << 3); \ addr = &bridge->b_type0_cfg_dev[slot].f[fn].l[where >> 2]; \ @@ -96,11 +100,9 @@ bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id], \ bus_to_wid[bus_id]); \ \ - /* if (dev->bus->number) */ \ - /* return PCIBIOS_DEVICE_NOT_FOUND; */ \ - \ if (dev->vendor == PCI_VENDOR_ID_SGI \ - && dev->device == PCI_DEVICE_ID_SGI_IOC3) \ + && dev->device == PCI_DEVICE_ID_SGI_IOC3 \ + && ((where >= 0x14 && where < 0x40) || (where >= 0x48))) \ return PCIBIOS_SUCCESSFUL; \ \ __bit = (((where) & (bm)) << 3); \ @@ -147,6 +149,7 @@ int i; ioport_resource.end = ~0UL; + iomem_resource.end = ~0UL; for (i=0; i<num_bridges; i++) { printk("PCI: Probing PCI hardware on host bus %2d.\n", i); @@ -178,7 +181,7 @@ * All observed requests have pin == 1. We could have a global here, that * gets incremented and returned every time - unfortunately, pci_map_irq * may be called on the same device over and over, and need to return the - * same value. On o2000, pin can be 0 or 1, and PCI slots can be [0..7]. + * same value. On O2000, pin can be 0 or 1, and PCI slots can be [0..7]. * * A given PCI device, in general, should be able to intr any of the cpus * on any one of the hubs connected to its xbow. @@ -186,25 +189,23 @@ static int __init pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) { - if ((dev->bus->number >= MAX_PCI_BUSSES) || (pin != 1) || \ - (slot >= MAX_DEVICES_PER_PCIBUS)) { - printk("Increase supported PCI busses %d,%d,%d\n", \ - dev->bus->number, slot, pin); - while(1); - } + if ((dev->bus->number >= MAX_PCI_BUSSES) + || (pin != 1) + || (slot >= MAX_DEVICES_PER_PCIBUS)) + panic("Increase supported PCI busses %d,%d,%d\n", + dev->bus->number, slot, pin); /* * Already assigned? Then return previously assigned value ... */ if (irqstore[dev->bus->number][slot]) - return(irqstore[dev->bus->number][slot]); - else { - irq_to_bus[lastirq] = dev->bus->number; - irq_to_slot[lastirq] = slot; - irqstore[dev->bus->number][slot] = lastirq; - lastirq++; - return (lastirq - 1); - } + return irqstore[dev->bus->number][slot]; + + irq_to_bus[lastirq] = dev->bus->number; + irq_to_slot[lastirq] = slot; + irqstore[dev->bus->number][slot] = lastirq; + lastirq++; + return lastirq - 1; } void __init @@ -237,10 +238,10 @@ pcibios_fixup_pbus_ranges(struct pci_bus * bus, struct pbus_set_ranges_data * ranges) { - ranges->io_start -= bus->resource[0]->start; - ranges->io_end -= bus->resource[0]->start; + ranges->io_start -= bus->resource[0]->start; + ranges->io_end -= bus->resource[0]->start; ranges->mem_start -= bus->resource[1]->start; - ranges->mem_end -= bus->resource[1]->start; + ranges->mem_end -= bus->resource[1]->start; } int __init @@ -255,6 +256,11 @@ { } +unsigned __init int pcibios_assign_all_busses(void) +{ + return 0; +} + char * __init pcibios_setup(char *str) { @@ -263,19 +269,23 @@ return str; } +/* + * Device might live on a subordinate PCI bus. XXX Walk up the chain of buses + * to find the slot number in sense of the bridge device register. + * XXX This also means multiple devices might rely on conflicting bridge + * settings. + */ + static void __init pci_disable_swapping(struct pci_dev *dev) { unsigned int bus_id = (unsigned) dev->bus->number; bridge_t *bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id], - bus_to_wid[bus_id]); + bus_to_wid[bus_id]); int slot = PCI_SLOT(dev->devfn); - bridgereg_t devreg; - - devreg = bridge->b_device[slot].reg; - devreg &= ~BRIDGE_DEV_SWAP_DIR; /* turn off byte swapping */ - bridge->b_device[slot].reg = devreg; + /* Turn off byte swapping */ + bridge->b_device[slot].reg &= ~BRIDGE_DEV_SWAP_DIR; bridge->b_widget.w_tflush; /* Flush */ } @@ -284,56 +294,25 @@ { unsigned int bus_id = (unsigned) dev->bus->number; bridge_t *bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id], - bus_to_wid[bus_id]); + bus_to_wid[bus_id]); int slot = PCI_SLOT(dev->devfn); - bridgereg_t devreg; - - devreg = bridge->b_device[slot].reg; - devreg |= BRIDGE_DEV_SWAP_DIR; /* turn on byte swapping */ - bridge->b_device[slot].reg = devreg; + /* Turn on byte swapping */ + bridge->b_device[slot].reg |= BRIDGE_DEV_SWAP_DIR; bridge->b_widget.w_tflush; /* Flush */ } static void __init pci_fixup_ioc3(struct pci_dev *d) { - unsigned int bus_id = (unsigned) d->bus->number; - int i; + unsigned long bus_id = (unsigned) d->bus->number; - /* IOC3 only decodes 0x20 bytes of the config space, so we end up - with tons of bogus information in the pci_dev. On Origins the - INTA, INTB and INTC pins are all wired together as if it'd only - use INTA. */ printk("PCI: Fixing base addresses for IOC3 device %s\n", d->slot_name); d->resource[0].start |= NODE_OFFSET(bus_to_nid[bus_id]); - d->resource[0].end |= NODE_OFFSET(bus_to_nid[bus_id]); - - for (i = 1; i <= PCI_ROM_RESOURCE; i++) { - d->resource[i].start = 0UL; - d->resource[i].end = 0UL; - d->resource[i].flags = 0UL; - } + d->resource[0].end |= NODE_OFFSET(bus_to_nid[bus_id]); pci_disable_swapping(d); - - /* - * The serial driver will try to probe for serial ports - * later on. MENET boards dbe out unrecoverably on sio space - * access to the 4th ioc3. (The first 3 iocs work okay, they - * have kbd/ms ports; all have ethernet ports). Catch this - * case now and disable the serial driver from looking at - * these ioc3s. Identify MENET cards by seeing if an ioc3 is - * at slot 3. - */ - d->subsystem_vendor = 0xFF00; - if (PCI_SLOT(d->devfn) == 3) { - struct list_head *p; - list_for_each(p, &d->bus->devices) { - list_entry(p, struct pci_dev, bus_list)->subsystem_vendor = 0; - } - } } static void __init @@ -344,7 +323,8 @@ d->resource[0].start |= ((unsigned long)(bus_to_nid[d->bus->number])<<32); printk("PCI: Fixing isp1020 in [bus:slot.fn] %s\n", d->slot_name); - /* Configure device to allow bus mastering, i/o and memory mapping. + /* + * Configure device to allow bus mastering, i/o and memory mapping. * Older qlogicisp driver expects to have the IO space enable * bit set. Things stop working if we program the controllers as not * having PCI_COMMAND_MEMORY, so we have to fudge the mem_flags. Index: ip27-setup.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip27/ip27-setup.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip27-setup.c 14 Jan 2001 19:54:47 -0000 1.1.1.1 +++ ip27-setup.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -14,6 +14,7 @@ #include <linux/spinlock.h> #include <linux/sched.h> #include <linux/smp.h> +#include <asm/io.h> #include <asm/sn/types.h> #include <asm/sn/sn0/addrs.h> #include <asm/sn/sn0/hubni.h> @@ -39,6 +40,7 @@ #define DBG(x...) #endif +unsigned long mips_io_port_base = IO_BASE; /* * get_nasid() returns the physical node id number of the caller. Index: ip27-timer.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip27/ip27-timer.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip27-timer.c 14 Jan 2001 19:54:48 -0000 1.1.1.1 +++ ip27-timer.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -145,6 +145,9 @@ } write_unlock(&xtime_lock); + + if (softirq_pending(cpu)) + do_softirq(); } unsigned long inline do_gettimeoffset(void) |
From: Andy P. <at...@us...> - 2002-04-10 18:32:32
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip22 In directory usw-pr-cvs1:/tmp/cvs-serv18937/mips64/sgi-ip22 Modified Files: ip22-berr.c ip22-hpc.c ip22-int.c ip22-irq.S ip22-mc.c ip22-reset.c ip22-rtc.c ip22-sc.c ip22-setup.c ip22-timer.c system.c time.c Log Message: synch 2.4.15 commit 38 Index: ip22-berr.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip22/ip22-berr.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip22-berr.c 14 Jan 2001 19:54:29 -0000 1.1.1.1 +++ ip22-berr.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. @@ -9,6 +8,9 @@ */ #include <linux/init.h> #include <linux/kernel.h> +#include <linux/module.h> + +#include <asm/module.h> #include <asm/uaccess.h> #include <asm/paccess.h> #include <asm/addrspace.h> @@ -41,16 +43,43 @@ return 0; } +extern spinlock_t modlist_lock; + static inline unsigned long search_dbe_table(unsigned long addr) { - unsigned long ret; + unsigned long ret = 0; +#ifndef CONFIG_MODULES /* There is only the kernel to search. */ ret = search_one_table(__start___dbe_table, __stop___dbe_table-1, addr); - if (ret) return ret; - - return 0; + return ret; +#else + unsigned long flags; + + /* The kernel is the last "module" -- no need to treat it special. */ + struct module *mp; + struct archdata *ap; + + spin_lock_irqsave(&modlist_lock, flags); + for (mp = module_list; mp != NULL; mp = mp->next) { + if (!mod_member_present(mp, archdata_end) || + !mod_archdata_member_present(mp, struct archdata, + dbe_table_end)) + continue; + ap = (struct archdata *)(mod->archdata_start); + + if (ap->dbe_table_start == NULL || + !(mp->flags & (MOD_RUNNING | MOD_INITIALIZING))) + continue; + ret = search_one_table(ap->dbe_table_start, + ap->dbe_table_end - 1, addr); + if (ret) + break; + } + spin_unlock_irqrestore(&modlist_lock, flags); + return ret; +#endif } void do_ibe(struct pt_regs *regs) Index: ip22-hpc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip22/ip22-hpc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip22-hpc.c 14 Jan 2001 19:54:29 -0000 1.1.1.1 +++ ip22-hpc.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -1,9 +1,8 @@ -/* $Id$ - * +/* * ip22-hpc.c: Routines for generic manipulation of the HPC controllers. * * Copyright (C) 1996 David S. Miller (dm...@en...) - * Copyright (C) 1998, 1999 Ralf Baechle + * Copyright (C) 1998, 1999, 2001 Ralf Baechle */ #include <linux/init.h> #include <linux/types.h> @@ -11,7 +10,6 @@ #include <asm/addrspace.h> #include <asm/sgi/sgihpc.h> #include <asm/sgi/sgint23.h> -#include <asm/sgialib.h> #include <asm/bootinfo.h> #undef DEBUG_SGIHPC Index: ip22-int.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip22/ip22-int.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- ip22-int.c 25 Feb 2001 23:15:22 -0000 1.1.1.2 +++ ip22-int.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -34,7 +34,6 @@ #include <asm/sgi/sgi.h> #include <asm/sgi/sgihpc.h> #include <asm/sgi/sgint23.h> -#include <asm/sgialib.h> /* * Linux has a controller-independent x86 interrupt architecture. @@ -287,9 +286,7 @@ irq_enter(cpu, irq); kstat.irqs[0][irq]++; - printk("Got irq %d, press a key.", irq); - prom_getchar(); - ArcEnterInteractiveMode(); + panic(KERN_DEBUG "Got irq %d, press a key.", irq); /* * mask and ack quickly, we don't want the irq controller Index: ip22-irq.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip22/ip22-irq.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip22-irq.S 14 Jan 2001 19:54:32 -0000 1.1.1.1 +++ ip22-irq.S 10 Apr 2002 14:43:22 -0000 1.2 @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. Index: ip22-mc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip22/ip22-mc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip22-mc.c 14 Jan 2001 19:54:33 -0000 1.1.1.1 +++ ip22-mc.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -1,12 +1,10 @@ -/* $Id$ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * indy_mc.c: Routines for manipulating the INDY memory controller. - * * Copyright (C) 1996 David S. Miller (dm...@en...) + * Copyright (C) 2001 Ralf Baechle (ra...@gn...) */ #include <linux/init.h> #include <linux/kernel.h> @@ -15,7 +13,6 @@ #include <asm/ptrace.h> #include <asm/sgi/sgimc.h> #include <asm/sgi/sgihpc.h> -#include <asm/sgialib.h> /* #define DEBUG_SGIMC */ Index: ip22-reset.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip22/ip22-reset.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip22-reset.c 14 Jan 2001 19:54:33 -0000 1.1.1.1 +++ ip22-reset.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -1,12 +1,11 @@ -/* $Id$ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Reset an IP22. * - * Copyright (C) 1997, 1998, 1999 by Ralf Baechle + * Copyright (C) 1997, 1998, 1999, 2001 by Ralf Baechle */ #include <linux/kernel.h> #include <linux/sched.h> Index: ip22-rtc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip22/ip22-rtc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip22-rtc.c 14 Jan 2001 19:54:34 -0000 1.1.1.1 +++ ip22-rtc.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -1,12 +1,11 @@ -/* $Id$ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * RTC routines for Indy style attached Dallas chip. * - * Copyright (C) 1998 by Ralf Baechle + * Copyright (C) 1998, 2001 by Ralf Baechle */ #include <linux/mc146818rtc.h> #include <asm/sgi/sgihpc.h> Index: ip22-sc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip22/ip22-sc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip22-sc.c 14 Jan 2001 19:54:34 -0000 1.1.1.1 +++ ip22-sc.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -1,6 +1,5 @@ -/* $Id$ - * - * indy_sc.c: Indy cache managment functions. +/* + * indy_sc.c: Indy cache management functions. * * Copyright (C) 1997 Ralf Baechle (ra...@gn...), * derived from r4xx0.c by David S. Miller (dm...@en...). @@ -16,7 +15,6 @@ #include <asm/pgtable.h> #include <asm/system.h> #include <asm/bootinfo.h> -#include <asm/sgialib.h> #include <asm/mmu_context.h> /* Secondary cache size in bytes, if present. */ @@ -31,17 +29,17 @@ static inline void indy_sc_wipe(unsigned long first, unsigned long last) { - __asm__ __volatile__(" - .set noreorder - or %0, %4 # first line to flush - or %1, %4 # last line to flush -1: sw $0, 0(%0) - bne %0, %1, 1b - daddu %0, 32 - .set reorder" - : "=r" (first), "=r" (last) - : "0" (first), "1" (last), "r" (0x9000000080000000) - : "$1"); + __asm__ __volatile__( + ".set\tnoreorder\n\t" + "or\t%0, %4\t\t\t# first line to flush\n\t" + "or\t%1, %4\t\t\t# last line to flush\n" + "1:\tsw $0, 0(%0)\n\t" + "bne\t%0, %1, 1b\n\t" + "daddu\t%0, 32\n\t" + ".set reorder" + : "=r" (first), "=r" (last) + : "0" (first), "1" (last), "r" (0x9000000080000000) + : "$1"); } static void indy_sc_wback_invalidate(unsigned long addr, unsigned long size) Index: ip22-setup.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip22/ip22-setup.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip22-setup.c 14 Jan 2001 19:54:35 -0000 1.1.1.1 +++ ip22-setup.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. @@ -145,7 +144,7 @@ * graphics console, it is set to "d" for the first serial * line and "d2" for the second serial line. */ - ctype = ArcArcGetEnvironmentVariable("console"); + ctype = ArcGetEnvironmentVariable("console"); if(*ctype == 'd') { if(*(ctype+1)=='2') console_setup ("ttyS1"); Index: ip22-timer.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip22/ip22-timer.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ip22-timer.c 14 Jan 2001 19:54:36 -0000 1.1.1.1 +++ ip22-timer.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * indy_timer.c: Setting up the clock on the INDY 8254 controller. * * Copyright (C) 1996 David S. Miller (dm...@en...) @@ -238,9 +237,7 @@ irq_enter(cpu, irq); kstat.irqs[0][irq]++; - printk("indy_8254timer_irq: Whoops, should not have gotten this IRQ\n"); - prom_getchar(); - ArcEnterInteractiveMode(); + panic("indy_8254timer_irq: Whoops, should not have gotten this IRQ\n"); irq_exit(cpu, irq); } Index: system.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip22/system.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- system.c 14 Jan 2001 19:54:36 -0000 1.1.1.1 +++ system.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. @@ -7,6 +6,7 @@ * system.c: Probe the system type using ARCS prom interface library. * * Copyright (C) 1996 David S. Miller (dm...@en...) + * Copyright (C) 2000, 2001 Ralf Baechle (ra...@gn...) */ #include <linux/init.h> #include <linux/kernel.h> @@ -17,8 +17,6 @@ #include <asm/sgialib.h> #include <asm/bootinfo.h> -enum sgi_mach sgimach; - struct smatch { char *name; int type; @@ -46,10 +44,7 @@ if(!strcmp(s, sgi_cputable[i].name)) return sgi_cputable[i].type; } - prom_printf("\nYeee, could not determine MIPS cpu type <%s>\n", s); - prom_printf("press a key to reboot\n"); - prom_getchar(); - ArcEnterInteractiveMode(); + panic("\nYeee, could not determine MIPS cpu type <%s>", s); return 0; } @@ -74,23 +69,16 @@ int ncpus = 0; if(p->type == Cpu) { - if(++ncpus > 1) { - prom_printf("\nYeee, SGI MP not ready yet\n"); - prom_printf("press a key to reboot\n"); - prom_getchar(); - ArcEnterInteractiveMode(); - } + if (++ncpus > 1) + panic("\nYeee, SGI MP not ready yet"); printk("CPU: %s ", p->iname); cpup = p; cputype = string_to_cpu(cpup->iname); } p = ArcGetPeer(p); } - if(cputype == -1) { - prom_printf("\nYeee, could not find cpu ARCS component\n"); - prom_printf("press a key to reboot\n"); - prom_getchar(); - ArcEnterInteractiveMode(); + if (cputype == -1) { + panic("\nYeee, could not find cpu ARCS component"); } p = ArcGetChild(cpup); while(p) { Index: time.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips64/sgi-ip22/time.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- time.c 14 Jan 2001 19:54:36 -0000 1.1.1.1 +++ time.c 10 Apr 2002 14:43:22 -0000 1.2 @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. |
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/common In directory usw-pr-cvs1:/tmp/cvs-serv25860/ppc/boot/common Added Files: Makefile crt0.S misc-common.c misc-simple.c no_initrd.c ns16550.c ofcommon.c string.S Log Message: synch 2.4.15 commit 43 --- NEW FILE --- # # arch/ppc/boot/common/Makefile # # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive # for more details. # # Tom Rini January 2001 # .c.s: $(CC) $(CFLAGS) -S -o $*.s $< .s.o: $(AS) -o $*.o $< .c.o: $(CC) $(CFLAGS) -c -o $*.o $< .S.s: $(CPP) $(AFLAGS) -traditional -o $*.o $< .S.o: $(CC) $(AFLAGS) -traditional -c -o $*.o $< OBJCOPY_ARGS = -O elf32-powerpc coffcrt0.o: $(CC) $(AFLAGS) -DXCOFF -traditional -c -o coffcrt0.o crt0.S include $(TOPDIR)/Rules.make --- NEW FILE --- /* * BK Id: SCCS/s.crt0.S 1.12 08/09/01 17:09:10 paulus */ /* Copyright (c) 1997 Paul Mackerras <pa...@cs...> * Initial Power Macintosh COFF version. * Copyright (c) 1999 Grant Erickson <gr...@lc...> * Modifications for IBM PowerPC 400-class processor evaluation * boards. * * Module name: crt0.S * * Description: * Boot loader execution entry point. Clears out .bss section as per * ANSI C requirements. Invalidates and flushes the caches over the * range covered by the boot loader's .text section. Sets up a stack * below the .text section entry point. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include <linux/config.h> #include "../../kernel/ppc_asm.tmpl" .text .globl _start _start: #ifdef XCOFF .long __start,0,0 .globl __start __start: #endif ## Flush and invalidate the caches for the range in memory covering ## the .text section of the boot loader lis r9,_start@h # r9 = &_start lis r8,_etext@ha # addi r8,r8,_etext@l # r8 = &_etext 3: dcbf r0,r9 # Flush the data cache icbi r0,r9 # Invalidate the instruction cache addi r9,r9,0x10 # Increment by one cache line cmplw cr0,r9,r8 # Are we at the end yet? blt 3b # No, keep flushing and invalidating sync # sync ; isync after flushing the icache isync ## Clear out the BSS as per ANSI C requirements lis r7,_end@ha addi r7,r7,_end@l # r7 = &_end lis r8,__bss_start@ha # addi r8,r8,__bss_start@l # r8 = &_bss_start ## Determine how large an area, in number of words, to clear subf r7,r8,r7 # r7 = &_end - &_bss_start + 1 addi r7,r7,3 # r7 += 3 srwi. r7,r7,2 # r7 = size in words. beq 2f # If the size is zero, do not bother addi r8,r8,-4 # r8 -= 4 mtctr r7 # SPRN_CTR = number of words to clear li r0,0 # r0 = 0 1: stwu r0,4(r8) # Clear out a word bdnz 1b # If we are not done yet, keep clearing 2: #ifdef CONFIG_4xx ## Set up the stack lis r9,_start@h # r9 = &_start (text section entry) addi r9,r9,_start@l subi r1,r9,64 # Start the stack 64 bytes below _start clrrwi r1,r1,4 # Make sure it is aligned on 16 bytes. li r0,0 stwu r0,-16(r1) mtlr r9 #endif b start # All done, start the real work. --- NEW FILE --- /* * arch/ppc/boot/common/misc-common.c * * Misc. bootloader code (almost) all platforms can use * * Author: Johnnie Peters <jp...@mv...> * Editor: Tom Rini <tr...@mv...> * * Derived from arch/ppc/boot/prep/misc.c * * Copyright 2000-2001 MontaVista Software Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <stdarg.h> /* for va_ bits */ #include <linux/config.h> #include "zlib.h" #include "nonstdio.h" /* If we're on a ALL_PPC, assume we have a keyboard controller * Also note, if we're not ALL_PPC, we assume you are a serial * console - Tom */ #if defined(CONFIG_ALL_PPC) && defined(CONFIG_VGA_CONSOLE) extern void cursor(int x, int y); extern void scroll(void); extern char *vidmem; extern int lines, cols; extern int orig_x, orig_y; extern int keyb_present; extern int CRT_tstc(void); extern int CRT_getc(void); #else int cursor(int x, int y) {return 0;} void scroll(void) {} char vidmem[1]; #define lines 0 #define cols 0 int orig_x = 0; int orig_y = 0; #define keyb_present 0 int CRT_tstc(void) {return 0;} int CRT_getc(void) {return 0;} #endif extern char *avail_ram; extern char *end_avail; extern char _end[]; void puts(const char *); void putc(const char c); void puthex(unsigned long val); void _bcopy(char *src, char *dst, int len); void gunzip(void *, int, unsigned char *, int *); static int _cvt(unsigned long val, char *buf, long radix, char *digits); void _vprintk(void(*putc)(const char), const char *fmt0, va_list ap); unsigned char *ISA_io = NULL; #if defined(CONFIG_SERIAL_CONSOLE) extern unsigned long com_port; extern int serial_tstc(unsigned long com_port); extern unsigned char serial_getc(unsigned long com_port); extern void serial_putc(unsigned long com_port, unsigned char c); #endif void pause(void) { puts("pause\n"); } void exit(void) { puts("exit\n"); while(1); } int tstc(void) { #if defined(CONFIG_SERIAL_CONSOLE) if(keyb_present) return (CRT_tstc() || serial_tstc(com_port)); else return (serial_tstc(com_port)); #else return CRT_tstc(); #endif } int getc(void) { while (1) { #if defined(CONFIG_SERIAL_CONSOLE) if (serial_tstc(com_port)) return (serial_getc(com_port)); #endif /* CONFIG_SERIAL_CONSOLE */ if (keyb_present) if(CRT_tstc()) return (CRT_getc()); } } void putc(const char c) { int x,y; #if defined(CONFIG_SERIAL_CONSOLE) serial_putc(com_port, c); if ( c == '\n' ) serial_putc(com_port, '\r'); #endif /* CONFIG_SERIAL_CONSOLE */ x = orig_x; y = orig_y; if ( c == '\n' ) { x = 0; if ( ++y >= lines ) { scroll(); y--; } } else if (c == '\r') { x = 0; } else if (c == '\b') { if (x > 0) { x--; } } else { vidmem [ ( x + cols * y ) * 2 ] = c; if ( ++x >= cols ) { x = 0; if ( ++y >= lines ) { scroll(); y--; } } } cursor(x, y); orig_x = x; orig_y = y; } void puts(const char *s) { int x,y; char c; x = orig_x; y = orig_y; while ( ( c = *s++ ) != '\0' ) { #if defined(CONFIG_SERIAL_CONSOLE) serial_putc(com_port, c); if ( c == '\n' ) serial_putc(com_port, '\r'); #endif /* CONFIG_SERIAL_CONSOLE */ if ( c == '\n' ) { x = 0; if ( ++y >= lines ) { scroll(); y--; } } else if (c == '\b') { if (x > 0) { x--; } } else { vidmem [ ( x + cols * y ) * 2 ] = c; if ( ++x >= cols ) { x = 0; if ( ++y >= lines ) { scroll(); y--; } } } } cursor(x, y); orig_x = x; orig_y = y; } void error(char *x) { puts("\n\n"); puts(x); puts("\n\n -- System halted"); while(1); /* Halt */ } void *zalloc(void *x, unsigned items, unsigned size) { void *p = avail_ram; size *= items; size = (size + 7) & -8; avail_ram += size; if (avail_ram > end_avail) { puts("oops... out of memory\n"); pause(); } return p; } void zfree(void *x, void *addr, unsigned nb) { } #define HEAD_CRC 2 #define EXTRA_FIELD 4 #define ORIG_NAME 8 #define COMMENT 0x10 #define RESERVED 0xe0 #define DEFLATED 8 void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp) { z_stream s; int r, i, flags; /* skip header */ i = 10; flags = src[3]; if (src[2] != DEFLATED || (flags & RESERVED) != 0) { puts("bad gzipped data\n"); exit(); } if ((flags & EXTRA_FIELD) != 0) i = 12 + src[10] + (src[11] << 8); if ((flags & ORIG_NAME) != 0) while (src[i++] != 0) ; if ((flags & COMMENT) != 0) while (src[i++] != 0) ; if ((flags & HEAD_CRC) != 0) i += 2; if (i >= *lenp) { puts("gunzip: ran out of data in header\n"); exit(); } s.zalloc = zalloc; s.zfree = zfree; r = inflateInit2(&s, -MAX_WBITS); if (r != Z_OK) { puts("inflateInit2 returned "); puthex(r); puts("\n"); exit(); } s.next_in = src + i; s.avail_in = *lenp - i; s.next_out = dst; s.avail_out = dstlen; r = inflate(&s, Z_FINISH); if (r != Z_OK && r != Z_STREAM_END) { puts("inflate returned "); puthex(r); puts("\n"); exit(); } *lenp = s.next_out - (unsigned char *) dst; inflateEnd(&s); } void puthex(unsigned long val) { unsigned char buf[10]; int i; for (i = 7; i >= 0; i--) { buf[i] = "0123456789ABCDEF"[val & 0x0F]; val >>= 4; } buf[8] = '\0'; puts(buf); } #define FALSE 0 #define TRUE 1 void _printk(char const *fmt, ...) { va_list ap; va_start(ap, fmt); _vprintk(putc, fmt, ap); va_end(ap); return; } #define is_digit(c) ((c >= '0') && (c <= '9')) void _vprintk(void(*putc)(const char), const char *fmt0, va_list ap) { char c, sign, *cp = 0; int left_prec, right_prec, zero_fill, length = 0, pad, pad_on_right; char buf[32]; long val; while ((c = *fmt0++)) { if (c == '%') { c = *fmt0++; left_prec = right_prec = pad_on_right = 0; if (c == '-') { c = *fmt0++; pad_on_right++; } if (c == '0') { zero_fill = TRUE; c = *fmt0++; } else { zero_fill = FALSE; } while (is_digit(c)) { left_prec = (left_prec * 10) + (c - '0'); c = *fmt0++; } if (c == '.') { c = *fmt0++; zero_fill++; while (is_digit(c)) { right_prec = (right_prec * 10) + (c - '0'); c = *fmt0++; } } else { right_prec = left_prec; } sign = '\0'; switch (c) { case 'd': case 'x': case 'X': val = va_arg(ap, long); switch (c) { case 'd': if (val < 0) { sign = '-'; val = -val; } length = _cvt(val, buf, 10, "0123456789"); break; case 'x': length = _cvt(val, buf, 16, "0123456789abcdef"); break; case 'X': length = _cvt(val, buf, 16, "0123456789ABCDEF"); break; } cp = buf; break; case 's': cp = va_arg(ap, char *); length = strlen(cp); break; case 'c': c = va_arg(ap, long /*char*/); (*putc)(c); continue; default: (*putc)('?'); } pad = left_prec - length; if (sign != '\0') { pad--; } if (zero_fill) { c = '0'; if (sign != '\0') { (*putc)(sign); sign = '\0'; } } else { c = ' '; } if (!pad_on_right) { while (pad-- > 0) { (*putc)(c); } } if (sign != '\0') { (*putc)(sign); } while (length-- > 0) { (*putc)(c = *cp++); if (c == '\n') { (*putc)('\r'); } } if (pad_on_right) { while (pad-- > 0) { (*putc)(c); } } } else { (*putc)(c); if (c == '\n') { (*putc)('\r'); } } } } int _cvt(unsigned long val, char *buf, long radix, char *digits) { char temp[80]; char *cp = temp; int length = 0; if (val == 0) { /* Special case */ *cp++ = '0'; } else while (val) { *cp++ = digits[val % radix]; val /= radix; } while (cp != temp) { *buf++ = *--cp; length++; } *buf = '\0'; return (length); } void _dump_buf_with_offset(unsigned char *p, int s, unsigned char *base) { int i, c; if ((unsigned int)s > (unsigned int)p) { s = (unsigned int)s - (unsigned int)p; } while (s > 0) { if (base) { _printk("%06X: ", (int)p - (int)base); } else { _printk("%06X: ", p); } for (i = 0; i < 16; i++) { if (i < s) { _printk("%02X", p[i] & 0xFF); } else { _printk(" "); } if ((i % 2) == 1) _printk(" "); if ((i % 8) == 7) _printk(" "); } _printk(" |"); for (i = 0; i < 16; i++) { if (i < s) { c = p[i] & 0xFF; if ((c < 0x20) || (c >= 0x7F)) c = '.'; } else { c = ' '; } _printk("%c", c); } _printk("|\n"); s -= 16; p += 16; } } void _dump_buf(unsigned char *p, int s) { _printk("\n"); _dump_buf_with_offset(p, s, 0); } /* Very simple inb/outb routines. We declare ISA_io to be 0 above, and * then modify it on platforms which need to. We do it like this * because on some platforms we give inb/outb an exact location, and * on others it's an offset from a given location. -- Tom */ void outb(int port, unsigned char val) { /* Ensure I/O operations complete */ __asm__ volatile("eieio"); ISA_io[port] = val; } unsigned char inb(int port) { /* Ensure I/O operations complete */ __asm__ volatile("eieio"); return (ISA_io[port]); } /* * Local variables: * c-indent-level: 8 * c-basic-offset: 8 * tab-width: 8 * End: */ --- NEW FILE --- /* * arch/ppc/common/misc-simple.c * * Misc. bootloader code for many machines. This assumes you have are using * a 6xx/7xx/74xx CPU in your machine. This assumes the chunk of memory * below 8MB is free. Finally, it assumes you have a NS16550-style uart for * your serial console. If a machine meets these requirements, it can quite * likely use this code during boot. * * Author: Matt Porter <mp...@mv...> * Derived from arch/ppc/boot/prep/misc.c * * Copyright 2001 MontaVista Software Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ #include <linux/types.h> #include <linux/elf.h> #include <linux/config.h> #include <asm/page.h> #include <asm/processor.h> #include <asm/mmu.h> #include "nonstdio.h" #include "zlib.h" unsigned long com_port; char *avail_ram; char *end_avail; extern char _end[]; #ifdef CONFIG_CMDLINE #define CMDLINE CONFIG_CMDLINE #else #define CMDLINE "" #endif char cmd_preset[] = CMDLINE; char cmd_buf[256]; char *cmd_line = cmd_buf; unsigned long initrd_start = 0, initrd_end = 0; char *zimage_start; int zimage_size; extern void gunzip(void *, int, unsigned char *, int *); extern unsigned long serial_init(int chan); void decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum) { int timer = 0; extern unsigned long start; char *cp, ch; com_port = serial_init(0); /* assume the chunk below 8M is free */ end_avail = (char *)0x00800000; /* * Reveal where we were loaded at and where we * were relocated to. */ puts("loaded at: "); puthex(load_addr); puts(" "); puthex((unsigned long)(load_addr + (4*num_words))); puts("\n"); if ( (unsigned long)load_addr != (unsigned long)&start ) { puts("relocated to: "); puthex((unsigned long)&start); puts(" "); puthex((unsigned long)((unsigned long)&start + (4*num_words))); puts("\n"); } /* we have to subtract 0x10000 here to correct for objdump including the size of the elf header which we strip -- Cort */ zimage_start = (char *)(load_addr - 0x10000 + ZIMAGE_OFFSET); zimage_size = ZIMAGE_SIZE; if ( INITRD_OFFSET ) initrd_start = load_addr - 0x10000 + INITRD_OFFSET; else initrd_start = 0; initrd_end = INITRD_SIZE + initrd_start; /* * Find a place to stick the zimage and initrd and * relocate them if we have to. -- Cort */ avail_ram = (char *)PAGE_ALIGN((unsigned long)_end); puts("zimage at: "); puthex((unsigned long)zimage_start); puts(" "); puthex((unsigned long)(zimage_size+zimage_start)); puts("\n"); if ( (unsigned long)zimage_start <= 0x00800000 ) { memcpy( (void *)avail_ram, (void *)zimage_start, zimage_size ); zimage_start = (char *)avail_ram; puts("relocated to: "); puthex((unsigned long)zimage_start); puts(" "); puthex((unsigned long)zimage_size+(unsigned long)zimage_start); puts("\n"); /* relocate initrd */ if ( initrd_start ) { puts("initrd at: "); puthex(initrd_start); puts(" "); puthex(initrd_end); puts("\n"); avail_ram = (char *)PAGE_ALIGN( (unsigned long)zimage_size+(unsigned long)zimage_start); memcpy ((void *)avail_ram, (void *)initrd_start, INITRD_SIZE ); initrd_start = (unsigned long)avail_ram; initrd_end = initrd_start + INITRD_SIZE; puts("relocated to: "); puthex(initrd_start); puts(" "); puthex(initrd_end); puts("\n"); } } else if ( initrd_start ) { puts("initrd at: "); puthex(initrd_start); puts(" "); puthex(initrd_end); puts("\n"); } avail_ram = (char *)0x00400000; end_avail = (char *)0x00800000; puts("avail ram: "); puthex((unsigned long)avail_ram); puts(" "); puthex((unsigned long)end_avail); puts("\n"); /* Display standard Linux/PPC boot prompt for kernel args */ puts("\nLinux/PPC load: "); cp = cmd_line; memcpy (cmd_line, cmd_preset, sizeof(cmd_preset)); while ( *cp ) putc(*cp++); while (timer++ < 5*1000) { if (tstc()) { while ((ch = getc()) != '\n' && ch != '\r') { /* Test for backspace/delete */ if (ch == '\b' || ch == '\177') { if (cp != cmd_line) { cp--; puts("\b \b"); } /* Test for ^x/^u (and wipe the line) */ } else if (ch == '\030' || ch == '\025') { while (cp != cmd_line) { cp--; puts("\b \b"); } } else { *cp++ = ch; putc(ch); } } break; /* Exit 'timer' loop */ } udelay(1000); /* 1 msec */ } *cp = 0; puts("\n"); /* mappings on early boot can only handle 16M */ if ( (int)(cmd_line[0]) > (16<<20)) puts("cmd_line located > 16M\n"); if ( initrd_start > (16<<20)) puts("initrd_start located > 16M\n"); puts("Uncompressing Linux..."); gunzip(0, 0x400000, zimage_start, &zimage_size); puts("done.\n"); puts("Now booting the kernel\n"); } --- NEW FILE --- /* * BK Id: SCCS/s.no_initrd.c 1.7 05/18/01 15:17:23 cort */ char initrd_data[1]; int initrd_len = 0; --- NEW FILE --- /* * BK Id: SCCS/s.ns16550.c 1.9 07/30/01 17:19:40 trini */ /* * COM1 NS16550 support */ #include <linux/config.h> #include <linux/serialP.h> #include <linux/serial_reg.h> #include <asm/serial.h> extern void outb(int port, unsigned char val); extern unsigned char inb(int port); extern unsigned long ISA_io; static struct serial_state rs_table[RS_TABLE_SIZE] = { SERIAL_PORT_DFNS /* Defined in <asm/serial.h> */ }; static int shift; unsigned long serial_init(int chan) { unsigned long com_port; /* We need to find out which type io we're expecting. If it's * 'SERIAL_IO_PORT', we get an offset from the isa_io_base. * If it's 'SERIAL_IO_MEM', we can the exact location. -- Tom */ switch (rs_table[chan].io_type) { case SERIAL_IO_PORT: com_port = rs_table[chan].port; break; case SERIAL_IO_MEM: com_port = (unsigned long)rs_table[chan].iomem_base; break; default: /* We can't deal with it. */ return -1; } /* How far apart the registers are. */ shift = rs_table[chan].iomem_reg_shift; /* See if port is present */ outb(com_port + (UART_LCR << shift), 0x00); outb(com_port + (UART_IER << shift), 0x00); /* Access baud rate */ outb(com_port + (UART_LCR << shift), 0x80); #ifdef CONFIG_SERIAL_CONSOLE_NONSTD /* Input clock. */ outb(com_port + (UART_DLL << shift), (BASE_BAUD / CONFIG_SERIAL_CONSOLE_BAUD)); outb(com_port + (UART_DLM << shift), (BASE_BAUD / CONFIG_SERIAL_CONSOLE_BAUD) >> 8); #endif /* 8 data, 1 stop, no parity */ outb(com_port + (UART_LCR << shift), 0x03); /* RTS/DTR */ outb(com_port + (UART_MCR << shift), 0x03); /* Clear & enable FIFOs */ outb(com_port + (UART_FCR << shift), 0x07); return (com_port); } void serial_putc(unsigned long com_port, unsigned char c) { while ((inb(com_port + (UART_LSR << shift)) & UART_LSR_THRE) == 0) ; outb(com_port, c); } unsigned char serial_getc(unsigned long com_port) { while ((inb(com_port + (UART_LSR << shift)) & UART_LSR_DR) == 0) ; return inb(com_port); } int serial_tstc(unsigned long com_port) { return ((inb(com_port + (UART_LSR << shift)) & UART_LSR_DR) != 0); } --- NEW FILE --- /* * BK Id: SCCS/s.ofcommon.c 1.1 07/27/01 20:24:18 trini * * Copyright (C) Paul Mackerras 1997. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include "zlib.h" #include "nonstdio.h" #include <asm/bootinfo.h> #include <asm/page.h> extern int strcmp(const char *s1, const char *s2); extern char *avail_ram, *avail_high; extern char *end_avail; extern void claim(unsigned int virt, unsigned int size, unsigned int align); extern void pause(void); unsigned int heap_use, heap_max; struct memchunk { unsigned int size; struct memchunk *next; }; static struct memchunk *freechunks; static void *zalloc(void *x, unsigned items, unsigned size) { void *p; struct memchunk **mpp, *mp; size *= items; size = (size + 7) & -8; heap_use += size; if (heap_use > heap_max) heap_max = heap_use; for (mpp = &freechunks; (mp = *mpp) != 0; mpp = &mp->next) { if (mp->size == size) { *mpp = mp->next; return mp; } } p = avail_ram; avail_ram += size; if (avail_ram > avail_high) avail_high = avail_ram; if (avail_ram > end_avail) { printf("oops... out of memory\n\r"); pause(); } return p; } static void zfree(void *x, void *addr, unsigned nb) { struct memchunk *mp = addr; nb = (nb + 7) & -8; heap_use -= nb; if (avail_ram == addr + nb) { avail_ram = addr; return; } mp->size = nb; mp->next = freechunks; freechunks = mp; } #define HEAD_CRC 2 #define EXTRA_FIELD 4 #define ORIG_NAME 8 #define COMMENT 0x10 #define RESERVED 0xe0 #define DEFLATED 8 void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp) { z_stream s; int r, i, flags; /* skip header */ i = 10; flags = src[3]; if (src[2] != DEFLATED || (flags & RESERVED) != 0) { printf("bad gzipped data\n\r"); exit(); } if ((flags & EXTRA_FIELD) != 0) i = 12 + src[10] + (src[11] << 8); if ((flags & ORIG_NAME) != 0) while (src[i++] != 0) ; if ((flags & COMMENT) != 0) while (src[i++] != 0) ; if ((flags & HEAD_CRC) != 0) i += 2; if (i >= *lenp) { printf("gunzip: ran out of data in header\n\r"); exit(); } s.zalloc = zalloc; s.zfree = zfree; r = inflateInit2(&s, -MAX_WBITS); if (r != Z_OK) { printf("inflateInit2 returned %d\n\r", r); exit(); } s.next_in = src + i; s.avail_in = *lenp - i; s.next_out = dst; s.avail_out = dstlen; r = inflate(&s, Z_FINISH); if (r != Z_OK && r != Z_STREAM_END) { printf("inflate returned %d msg: %s\n\r", r, s.msg); exit(); } *lenp = s.next_out - (unsigned char *) dst; inflateEnd(&s); } /* Make a bi_rec in OF. We need to be passed a name for BI_BOOTLOADER_ID, * a machine type for BI_MACHTYPE, and the location where the end of the * bootloader is (PROG_START + PROG_SIZE) */ void make_bi_recs(unsigned long addr, char *name, unsigned int mach, unsigned long progend) { struct bi_record *rec; /* leave a 1MB gap then align to the next 1MB boundary */ addr = _ALIGN(addr+ (1<<20) - 1, (1<<20)); /* oldworld machine seem very unhappy about this. -- Tom */ if (addr >= progend) claim(addr, 0x1000, 0); rec = (struct bi_record *)addr; rec->tag = BI_FIRST; rec->size = sizeof(struct bi_record); rec = (struct bi_record *)((unsigned long)rec + rec->size); rec->tag = BI_BOOTLOADER_ID; sprintf( (char *)rec->data, name); rec->size = sizeof(struct bi_record) + strlen(name) + 1; rec = (struct bi_record *)((unsigned long)rec + rec->size); rec->tag = BI_MACHTYPE; rec->data[0] = mach; rec->data[1] = 1; rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long); rec = (struct bi_record *)((unsigned long)rec + rec->size); #ifdef SYSMAP_OFFSET rec->tag = BI_SYSMAP; rec->data[0] = SYSMAP_OFFSET; rec->data[1] = SYSMAP_SIZE; rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long); rec = (struct bi_record *)((unsigned long)rec + rec->size); #endif /* SYSMAP_OFFSET */ rec->tag = BI_LAST; rec->size = sizeof(struct bi_record); rec = (struct bi_record *)((unsigned long)rec + rec->size); } --- NEW FILE --- /* * BK Id: SCCS/s.string.S 1.8 05/18/01 06:20:29 patch */ /* * String handling functions for PowerPC. * * Copyright (C) 1996 Paul Mackerras. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #define r0 0 #define r3 3 #define r4 4 #define r5 5 #define r6 6 #define r7 7 #define r8 8 .globl strlen strlen: addi r4,r3,-1 1: lbzu r0,1(r4) cmpwi 0,r0,0 bne 1b subf r3,r3,r4 blr .globl memset memset: rlwimi r4,r4,8,16,23 rlwimi r4,r4,16,0,15 addi r6,r3,-4 cmplwi 0,r5,4 blt 7f stwu r4,4(r6) beqlr andi. r0,r6,3 add r5,r0,r5 subf r6,r0,r6 rlwinm r0,r5,32-2,2,31 mtctr r0 bdz 6f 1: stwu r4,4(r6) bdnz 1b 6: andi. r5,r5,3 7: cmpwi 0,r5,0 beqlr mtctr r5 addi r6,r6,3 8: stbu r4,1(r6) bdnz 8b blr .globl memmove memmove: cmplw 0,r3,r4 bgt backwards_memcpy /* fall through */ .globl memcpy memcpy: rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */ addi r6,r3,-4 addi r4,r4,-4 beq 2f /* if less than 8 bytes to do */ andi. r0,r6,3 /* get dest word aligned */ mtctr r7 bne 5f 1: lwz r7,4(r4) lwzu r8,8(r4) stw r7,4(r6) stwu r8,8(r6) bdnz 1b andi. r5,r5,7 2: cmplwi 0,r5,4 blt 3f lwzu r0,4(r4) addi r5,r5,-4 stwu r0,4(r6) 3: cmpwi 0,r5,0 beqlr mtctr r5 addi r4,r4,3 addi r6,r6,3 4: lbzu r0,1(r4) stbu r0,1(r6) bdnz 4b blr 5: subfic r0,r0,4 mtctr r0 6: lbz r7,4(r4) addi r4,r4,1 stb r7,4(r6) addi r6,r6,1 bdnz 6b subf r5,r0,r5 rlwinm. r7,r5,32-3,3,31 beq 2b mtctr r7 b 1b .globl backwards_memcpy backwards_memcpy: rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */ add r6,r3,r5 add r4,r4,r5 beq 2f andi. r0,r6,3 mtctr r7 bne 5f 1: lwz r7,-4(r4) lwzu r8,-8(r4) stw r7,-4(r6) stwu r8,-8(r6) bdnz 1b andi. r5,r5,7 2: cmplwi 0,r5,4 blt 3f lwzu r0,-4(r4) subi r5,r5,4 stwu r0,-4(r6) 3: cmpwi 0,r5,0 beqlr mtctr r5 4: lbzu r0,-1(r4) stbu r0,-1(r6) bdnz 4b blr 5: mtctr r0 6: lbzu r7,-1(r4) stbu r7,-1(r6) bdnz 6b subf r5,r0,r5 rlwinm. r7,r5,32-3,3,31 beq 2b mtctr r7 b 1b .globl memcmp memcmp: cmpwi 0,r5,0 blelr mtctr r5 addi r6,r3,-1 addi r4,r4,-1 1: lbzu r3,1(r6) lbzu r0,1(r4) subf. r3,r0,r3 bdnzt 2,1b blr |
From: Andy P. <at...@us...> - 2002-04-10 18:32:30
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/include In directory usw-pr-cvs1:/tmp/cvs-serv25860/ppc/boot/include Added Files: nonstdio.h rs6000.h zlib.h Log Message: synch 2.4.15 commit 43 --- NEW FILE --- /* * BK Id: SCCS/s.nonstdio.h 1.9 07/25/01 18:13:07 trini */ /* * Copyright (C) Paul Mackerras 1997. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * * This is sort of a catchall for I/O related functions. Stuff that * wouldn't be in 'stdio.h' normally is here, and it's 'nonstdio.h' * for a reason. -- Tom */ typedef int FILE; extern FILE *stdin, *stdout; #define NULL ((void *)0) #define EOF (-1) #define fopen(n, m) NULL #define fflush(f) 0 #define fclose(f) 0 #define perror(s) printf("%s: no files!\n", (s)) extern int getc(void); extern int printf(const char *format, ...); extern int strlen(const char *s); extern int sprintf(char *str, const char *format, ...); extern int tstc(void); extern void exit(void); extern void *memcpy(void *dest, const void *src, int n); extern void *memmove(void *dest, const void *src, int n); extern void outb(int port, unsigned char val); extern void putc(const char c); extern void puthex(unsigned long val); extern void puts(const char *); extern void udelay(long delay); extern unsigned char inb(int port); --- NEW FILE --- /* * BK Id: SCCS/s.rs6000.h 1.7 05/18/01 15:17:23 cort */ /* IBM RS/6000 "XCOFF" file definitions for BFD. Copyright (C) 1990, 1991 Free Software Foundation, Inc. FIXME: Can someone provide a transliteration of this name into ASCII? Using the following chars caused a compiler warning on HIUX (so I replaced them with octal escapes), and isn't useful without an understanding of what character set it is. Written by Mimi Ph\373\364ng-Th\345o V\365 of IBM and John Gilmore of Cygnus Support. */ /********************** FILE HEADER **********************/ struct external_filehdr { char f_magic[2]; /* magic number */ char f_nscns[2]; /* number of sections */ char f_timdat[4]; /* time & date stamp */ char f_symptr[4]; /* file pointer to symtab */ char f_nsyms[4]; /* number of symtab entries */ char f_opthdr[2]; /* sizeof(optional hdr) */ char f_flags[2]; /* flags */ }; /* IBM RS/6000 */ #define U802WRMAGIC 0730 /* writeable text segments **chh** */ #define U802ROMAGIC 0735 /* readonly sharable text segments */ #define U802TOCMAGIC 0737 /* readonly text segments and TOC */ #define BADMAG(x) \ ((x).f_magic != U802ROMAGIC && (x).f_magic != U802WRMAGIC && \ (x).f_magic != U802TOCMAGIC) #define FILHDR struct external_filehdr #define FILHSZ 20 /********************** AOUT "OPTIONAL HEADER" **********************/ typedef struct { unsigned char magic[2]; /* type of file */ unsigned char vstamp[2]; /* version stamp */ unsigned char tsize[4]; /* text size in bytes, padded to FW bdry */ unsigned char dsize[4]; /* initialized data " " */ unsigned char bsize[4]; /* uninitialized data " " */ unsigned char entry[4]; /* entry pt. */ unsigned char text_start[4]; /* base of text used for this file */ unsigned char data_start[4]; /* base of data used for this file */ unsigned char o_toc[4]; /* address of TOC */ unsigned char o_snentry[2]; /* section number of entry point */ unsigned char o_sntext[2]; /* section number of .text section */ unsigned char o_sndata[2]; /* section number of .data section */ unsigned char o_sntoc[2]; /* section number of TOC */ unsigned char o_snloader[2]; /* section number of .loader section */ unsigned char o_snbss[2]; /* section number of .bss section */ unsigned char o_algntext[2]; /* .text alignment */ unsigned char o_algndata[2]; /* .data alignment */ unsigned char o_modtype[2]; /* module type (??) */ unsigned char o_cputype[2]; /* cpu type */ unsigned char o_maxstack[4]; /* max stack size (??) */ unsigned char o_maxdata[4]; /* max data size (??) */ unsigned char o_resv2[12]; /* reserved */ } AOUTHDR; #define AOUTSZ 72 #define SMALL_AOUTSZ (28) #define AOUTHDRSZ 72 #define RS6K_AOUTHDR_OMAGIC 0x0107 /* old: text & data writeable */ #define RS6K_AOUTHDR_NMAGIC 0x0108 /* new: text r/o, data r/w */ #define RS6K_AOUTHDR_ZMAGIC 0x010B /* paged: text r/o, both page-aligned */ /********************** SECTION HEADER **********************/ struct external_scnhdr { char s_name[8]; /* section name */ char s_paddr[4]; /* physical address, aliased s_nlib */ char s_vaddr[4]; /* virtual address */ char s_size[4]; /* section size */ char s_scnptr[4]; /* file ptr to raw data for section */ char s_relptr[4]; /* file ptr to relocation */ char s_lnnoptr[4]; /* file ptr to line numbers */ char s_nreloc[2]; /* number of relocation entries */ char s_nlnno[2]; /* number of line number entries*/ char s_flags[4]; /* flags */ }; /* * names of "special" sections */ #define _TEXT ".text" #define _DATA ".data" #define _BSS ".bss" #define _PAD ".pad" #define _LOADER ".loader" #define SCNHDR struct external_scnhdr #define SCNHSZ 40 /* XCOFF uses a special .loader section with type STYP_LOADER. */ #define STYP_LOADER 0x1000 /* XCOFF uses a special .debug section with type STYP_DEBUG. */ #define STYP_DEBUG 0x2000 /* XCOFF handles line number or relocation overflow by creating another section header with STYP_OVRFLO set. */ #define STYP_OVRFLO 0x8000 /********************** LINE NUMBERS **********************/ /* 1 line number entry for every "breakpointable" source line in a section. * Line numbers are grouped on a per function basis; first entry in a function * grouping will have l_lnno = 0 and in place of physical address will be the * symbol table index of the function name. */ struct external_lineno { union { char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/ char l_paddr[4]; /* (physical) address of line number */ } l_addr; char l_lnno[2]; /* line number */ }; #define LINENO struct external_lineno #define LINESZ 6 /********************** SYMBOLS **********************/ #define E_SYMNMLEN 8 /* # characters in a symbol name */ #define E_FILNMLEN 14 /* # characters in a file name */ #define E_DIMNUM 4 /* # array dimensions in auxiliary entry */ struct external_syment { union { char e_name[E_SYMNMLEN]; struct { char e_zeroes[4]; char e_offset[4]; } e; } e; char e_value[4]; char e_scnum[2]; char e_type[2]; char e_sclass[1]; char e_numaux[1]; }; #define N_BTMASK (017) #define N_TMASK (060) #define N_BTSHFT (4) #define N_TSHIFT (2) union external_auxent { struct { char x_tagndx[4]; /* str, un, or enum tag indx */ union { struct { char x_lnno[2]; /* declaration line number */ char x_size[2]; /* str/union/array size */ } x_lnsz; char x_fsize[4]; /* size of function */ } x_misc; union { struct { /* if ISFCN, tag, or .bb */ char x_lnnoptr[4]; /* ptr to fcn line # */ char x_endndx[4]; /* entry ndx past block end */ } x_fcn; struct { /* if ISARY, up to 4 dimen. */ char x_dimen[E_DIMNUM][2]; } x_ary; } x_fcnary; char x_tvndx[2]; /* tv index */ } x_sym; union { char x_fname[E_FILNMLEN]; struct { char x_zeroes[4]; char x_offset[4]; } x_n; } x_file; struct { char x_scnlen[4]; /* section length */ char x_nreloc[2]; /* # relocation entries */ char x_nlinno[2]; /* # line numbers */ } x_scn; struct { char x_tvfill[4]; /* tv fill value */ char x_tvlen[2]; /* length of .tv */ char x_tvran[2][2]; /* tv range */ } x_tv; /* info about .tv section (in auxent of symbol .tv)) */ struct { unsigned char x_scnlen[4]; unsigned char x_parmhash[4]; unsigned char x_snhash[2]; unsigned char x_smtyp[1]; unsigned char x_smclas[1]; unsigned char x_stab[4]; unsigned char x_snstab[2]; } x_csect; }; #define SYMENT struct external_syment #define SYMESZ 18 #define AUXENT union external_auxent #define AUXESZ 18 #define DBXMASK 0x80 /* for dbx storage mask */ #define SYMNAME_IN_DEBUG(symptr) ((symptr)->n_sclass & DBXMASK) /********************** RELOCATION DIRECTIVES **********************/ struct external_reloc { char r_vaddr[4]; char r_symndx[4]; char r_size[1]; char r_type[1]; }; #define RELOC struct external_reloc #define RELSZ 10 #define DEFAULT_DATA_SECTION_ALIGNMENT 4 #define DEFAULT_BSS_SECTION_ALIGNMENT 4 #define DEFAULT_TEXT_SECTION_ALIGNMENT 4 /* For new sections we havn't heard of before */ #define DEFAULT_SECTION_ALIGNMENT 4 --- NEW FILE --- /* * BK Id: SCCS/s.zlib.h 1.8 05/18/01 15:17:23 cort */ /* * This file is derived from zlib.h and zconf.h from the zlib-0.95 * distribution by Jean-loup Gailly and Mark Adler, with some additions * by Paul Mackerras to aid in implementing Deflate compression and * decompression for PPP packets. */ /* * ==FILEVERSION 960122== * * This marker is used by the Linux installation script to determine * whether an up-to-date version of this file is already installed. */ /* zlib.h -- interface of the 'zlib' general purpose compression library version 0.95, Aug 16th, 1995. Copyright (C) 1995 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Jean-loup Gailly Mark Adler gz...@pr... ma...@al... */ #ifndef _ZLIB_H #define _ZLIB_H /* #include "zconf.h" */ /* included directly here */ /* zconf.h -- configuration of the zlib compression library * Copyright (C) 1995 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* From: zconf.h,v 1.12 1995/05/03 17:27:12 jloup Exp */ /* The library does not install any signal handler. It is recommended to add at least a handler for SIGSEGV when decompressing; the library checks the consistency of the input data whenever possible but may go nuts for some forms of corrupted input. */ /* * Compile with -DMAXSEG_64K if the alloc function cannot allocate more * than 64k bytes at a time (needed on systems with 16-bit int). * Compile with -DUNALIGNED_OK if it is OK to access shorts or ints * at addresses which are not a multiple of their size. * Under DOS, -DFAR=far or -DFAR=__far may be needed. */ #ifndef STDC # if defined(MSDOS) || defined(__STDC__) || defined(__cplusplus) # define STDC # endif #endif #ifdef __MWERKS__ /* Metrowerks CodeWarrior declares fileno() in unix.h */ # include <unix.h> #endif /* Maximum value for memLevel in deflateInit2 */ #ifndef MAX_MEM_LEVEL # ifdef MAXSEG_64K # define MAX_MEM_LEVEL 8 # else # define MAX_MEM_LEVEL 9 # endif #endif #ifndef FAR # define FAR #endif /* Maximum value for windowBits in deflateInit2 and inflateInit2 */ #ifndef MAX_WBITS # define MAX_WBITS 15 /* 32K LZ77 window */ #endif /* The memory requirements for deflate are (in bytes): 1 << (windowBits+2) + 1 << (memLevel+9) that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) plus a few kilobytes for small objects. For example, if you want to reduce the default memory requirements from 256K to 128K, compile with make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" Of course this will generally degrade compression (there's no free lunch). The memory requirements for inflate are (in bytes) 1 << windowBits that is, 32K for windowBits=15 (default value) plus a few kilobytes for small objects. */ /* Type declarations */ #ifndef OF /* function prototypes */ # ifdef STDC # define OF(args) args # else # define OF(args) () # endif #endif typedef unsigned char Byte; /* 8 bits */ typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned long uLong; /* 32 bits or more */ typedef Byte FAR Bytef; typedef char FAR charf; typedef int FAR intf; typedef uInt FAR uIntf; typedef uLong FAR uLongf; #ifdef STDC typedef void FAR *voidpf; typedef void *voidp; #else typedef Byte FAR *voidpf; typedef Byte *voidp; #endif /* end of original zconf.h */ #define ZLIB_VERSION "0.95P" /* The 'zlib' compression library provides in-memory compression and decompression functions, including integrity checks of the uncompressed data. This version of the library supports only one compression method (deflation) but other algorithms may be added later and will have the same stream interface. For compression the application must provide the output buffer and may optionally provide the input buffer for optimization. For decompression, the application must provide the input buffer and may optionally provide the output buffer for optimization. Compression can be done in a single step if the buffers are large enough (for example if an input file is mmap'ed), or can be done by repeated calls of the compression function. In the latter case, the application must provide more input and/or consume the output (providing more output space) before each call. */ typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); typedef void (*free_func) OF((voidpf opaque, voidpf address, uInt nbytes)); struct internal_state; typedef struct z_stream_s { Bytef *next_in; /* next input byte */ uInt avail_in; /* number of bytes available at next_in */ uLong total_in; /* total nb of input bytes read so far */ Bytef *next_out; /* next output byte should be put there */ uInt avail_out; /* remaining free space at next_out */ uLong total_out; /* total nb of bytes output so far */ char *msg; /* last error message, NULL if no error */ struct internal_state FAR *state; /* not visible by applications */ alloc_func zalloc; /* used to allocate the internal state */ free_func zfree; /* used to free the internal state */ voidp opaque; /* private data object passed to zalloc and zfree */ Byte data_type; /* best guess about the data type: ascii or binary */ } z_stream; /* The application must update next_in and avail_in when avail_in has dropped to zero. It must update next_out and avail_out when avail_out has dropped to zero. The application must initialize zalloc, zfree and opaque before calling the init function. All other fields are set by the compression library and must not be updated by the application. The opaque value provided by the application will be passed as the first parameter for calls of zalloc and zfree. This can be useful for custom memory management. The compression library attaches no meaning to the opaque value. zalloc must return Z_NULL if there is not enough memory for the object. On 16-bit systems, the functions zalloc and zfree must be able to allocate exactly 65536 bytes, but will not be required to allocate more than this if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers returned by zalloc for objects of exactly 65536 bytes *must* have their offset normalized to zero. The default allocation function provided by this library ensures this (see zutil.c). To reduce memory requirements and avoid any allocation of 64K objects, at the expense of compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). The fields total_in and total_out can be used for statistics or progress reports. After compression, total_in holds the total size of the uncompressed data and may be saved for use in the decompressor (particularly if the decompressor wants to decompress everything in a single step). */ /* constants */ #define Z_NO_FLUSH 0 #define Z_PARTIAL_FLUSH 1 #define Z_FULL_FLUSH 2 #define Z_SYNC_FLUSH 3 /* experimental: partial_flush + byte align */ #define Z_FINISH 4 #define Z_PACKET_FLUSH 5 /* See deflate() below for the usage of these constants */ #define Z_OK 0 #define Z_STREAM_END 1 #define Z_ERRNO (-1) #define Z_STREAM_ERROR (-2) #define Z_DATA_ERROR (-3) #define Z_MEM_ERROR (-4) #define Z_BUF_ERROR (-5) /* error codes for the compression/decompression functions */ #define Z_BEST_SPEED 1 #define Z_BEST_COMPRESSION 9 #define Z_DEFAULT_COMPRESSION (-1) /* compression levels */ #define Z_FILTERED 1 #define Z_HUFFMAN_ONLY 2 #define Z_DEFAULT_STRATEGY 0 #define Z_BINARY 0 #define Z_ASCII 1 #define Z_UNKNOWN 2 /* Used to set the data_type field */ #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ extern char *zlib_version; /* The application can compare zlib_version and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. */ /* basic functions */ extern int inflateInit OF((z_stream *strm)); /* Initializes the internal stream state for decompression. The fields zalloc and zfree must be initialized before by the caller. If zalloc and zfree are set to Z_NULL, inflateInit updates them to use default allocation functions. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory. msg is set to null if there is no error message. inflateInit does not perform any decompression: this will be done by inflate(). */ extern int inflate OF((z_stream *strm, int flush)); /* Performs one or both of the following actions: - Decompress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in is updated and processing will resume at this point for the next call of inflate(). - Provide more output starting at next_out and update next_out and avail_out accordingly. inflate() always provides as much output as possible (until there is no more input data or no more space in the output buffer). Before the call of inflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating the next_* and avail_* values accordingly. The application can consume the uncompressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of inflate(). If the parameter flush is set to Z_PARTIAL_FLUSH or Z_PACKET_FLUSH, inflate flushes as much output as possible to the output buffer. The flushing behavior of inflate is not specified for values of the flush parameter other than Z_PARTIAL_FLUSH, Z_PACKET_FLUSH or Z_FINISH, but the current implementation actually flushes as much output as possible anyway. For Z_PACKET_FLUSH, inflate checks that once all the input data has been consumed, it is expecting to see the length field of a stored block; if not, it returns Z_DATA_ERROR. inflate() should normally be called until it returns Z_STREAM_END or an error. However if all decompression is to be performed in a single step (a single call of inflate), the parameter flush should be set to Z_FINISH. In this case all pending input is processed and all pending output is flushed; avail_out must be large enough to hold all the uncompressed data. (The size of the uncompressed data may have been saved by the compressor for this purpose.) The next operation on this stream must be inflateEnd to deallocate the decompression state. The use of Z_FINISH is never required, but can be used to inform inflate that a faster routine may be used for the single inflate() call. inflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if the end of the compressed data has been reached and all uncompressed output has been produced, Z_DATA_ERROR if the input data was corrupted, Z_STREAM_ERROR if the stream structure was inconsistent (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if no progress is possible or if there was not enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR case, the application may then call inflateSync to look for a good compression block. */ extern int inflateEnd OF((z_stream *strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state was inconsistent. In the error case, msg may be set but then points to a static string (which must not be deallocated). */ /* advanced functions */ extern int inflateInit2 OF((z_stream *strm, int windowBits)); /* This is another version of inflateInit with more compression options. The fields next_out, zalloc and zfree must be initialized before by the caller. The windowBits parameter is the base two logarithm of the maximum window size (the size of the history buffer). It should be in the range 8..15 for this version of the library (the value 16 will be allowed soon). The default value is 15 if inflateInit is used instead. If a compressed stream with a larger window size is given as input, inflate() will return with the error code Z_DATA_ERROR instead of trying to allocate a larger window. If next_out is not null, the library will use this buffer for the history buffer; the buffer must either be large enough to hold the entire output data, or have at least 1<<windowBits bytes. If next_out is null, the library will allocate its own buffer (and leave next_out null). next_in need not be provided here but must be provided by the application for the next call of inflate(). If the history buffer is provided by the application, next_out must never be changed by the application since the decompressor maintains history information inside this buffer from call to call; the application can only reset next_out to the beginning of the history buffer when avail_out is zero and all output has been consumed. inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if a parameter is invalid (such as windowBits < 8). msg is set to null if there is no error message. inflateInit2 does not perform any decompression: this will be done by inflate(). */ extern int inflateSync OF((z_stream *strm)); /* Skips invalid compressed data until the special marker (see deflate() above) can be found, or until all available input is skipped. No output is provided. inflateSync returns Z_OK if the special marker has been found, Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no marker has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the success case, the application may save the current current value of total_in which indicates where valid compressed data was found. In the error case, the application may repeatedly call inflateSync, providing more input each time, until success or end of the input data. */ extern int inflateReset OF((z_stream *strm)); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate all the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being NULL). */ extern int inflateIncomp OF((z_stream *strm)); /* This function adds the data at next_in (avail_in bytes) to the output history without performing any output. There must be no pending output, and the decompressor must be expecting to see the start of a block. Calling this function is equivalent to decompressing a stored block containing the data at next_in (except that the data is not output). */ /* checksum functions */ /* This function is not related to compression but is exported anyway because it might be useful in applications using the compression library. */ extern uLong adler32 OF((uLong adler, Bytef *buf, uInt len)); /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum. If buf is NULL, this function returns the required initial value for the checksum. An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much faster. Usage example: uLong adler = adler32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { adler = adler32(adler, buffer, length); } if (adler != original_adler) error(); */ #ifndef _Z_UTIL_H struct internal_state {int dummy;}; /* hack for buggy compilers */ #endif #endif /* _ZLIB_H */ |
From: Andy P. <at...@us...> - 2002-04-10 18:32:29
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/lib In directory usw-pr-cvs1:/tmp/cvs-serv25860/ppc/boot/lib Added Files: Makefile zlib.c Log Message: synch 2.4.15 commit 43 --- NEW FILE --- # # Makefile for some libs needed by zImage. # L_TARGET := zlib.a obj-y := zlib.o include $(TOPDIR)/Rules.make --- NEW FILE --- /* * BK Id: SCCS/s.zlib.c 1.8 05/18/01 15:17:24 cort */ /* * This file is derived from various .h and .c files from the zlib-0.95 * distribution by Jean-loup Gailly and Mark Adler, with some additions * by Paul Mackerras to aid in implementing Deflate compression and * decompression for PPP packets. See zlib.h for conditions of * distribution and use. * * Changes that have been made include: * - changed functions not used outside this file to "local" * - added minCompression parameter to deflateInit2 * - added Z_PACKET_FLUSH (see zlib.h for details) * - added inflateIncomp * */ /*+++++*/ [...2111 lines suppressed...] unsigned long s2 = (adler >> 16) & 0xffff; int k; if (buf == Z_NULL) return 1L; while (len > 0) { k = len < NMAX ? len : NMAX; len -= k; while (k >= 16) { DO16(buf); k -= 16; } if (k != 0) do { DO1(buf); } while (--k); s1 %= BASE; s2 %= BASE; } return (s2 << 16) | s1; } |
From: Andy P. <at...@us...> - 2002-04-10 18:32:28
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips/tools In directory usw-pr-cvs1:/tmp/cvs-serv16972/mips/tools Modified Files: Makefile offset.c Log Message: synch 2.4.15 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/tools/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: offset.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/mips/tools/offset.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- offset.c 14 Jan 2001 19:28:33 -0000 1.1.1.1 +++ offset.c 10 Apr 2002 14:38:10 -0000 1.2 @@ -1,12 +1,13 @@ -/* $Id$ - * +/* * offset.c: Calculate pt_regs and task_struct offsets. * * Copyright (C) 1996 David S. Miller * Copyright (C) 1997, 1998, 1999 Ralf Baechle * Copyright (C) 1999 Silicon Graphics, Inc. + * + * Kevin Kissell, ke...@mi... and Carsten Langgaard, car...@mi... + * Copyright (C) 2000 MIPS Technologies, Inc. */ - #include <linux/types.h> #include <linux/sched.h> @@ -84,6 +85,7 @@ offset("#define TASK_COUNTER ", struct task_struct, counter); offset("#define TASK_NICE ", struct task_struct, nice); offset("#define TASK_MM ", struct task_struct, mm); + offset("#define TASK_PID ", struct task_struct, pid); size("#define TASK_STRUCT_SIZE ", struct task_struct); linefeed; } @@ -119,6 +121,10 @@ thread.irix_trampoline); offset("#define THREAD_OLDCTX ", struct task_struct, \ thread.irix_oldctx); + offset("#define THREAD_DSEEPC ", struct task_struct, \ + thread.dsemul_epc); + offset("#define THREAD_DSEAERPC ", struct task_struct, \ + thread.dsemul_aerpc); linefeed; } |
From: Andy P. <at...@us...> - 2002-04-10 18:32:28
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips/orion In directory usw-pr-cvs1:/tmp/cvs-serv16972/mips/orion Removed Files: Makefile int-handler.S irq.c ld.script.orion misc.c no_initrd.c piggyback.c promcon.c setup.c Log Message: synch 2.4.15 --- Makefile DELETED --- --- int-handler.S DELETED --- --- irq.c DELETED --- --- ld.script.orion DELETED --- --- misc.c DELETED --- --- no_initrd.c DELETED --- --- piggyback.c DELETED --- --- promcon.c DELETED --- --- setup.c DELETED --- |
From: Andy P. <at...@us...> - 2002-04-10 18:32:26
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/m68k/amiga In directory usw-pr-cvs1:/tmp/cvs-serv13561/m68k/amiga Modified Files: amisound.c cia.c config.c pcmcia.c Log Message: synch 2.4.15 commit 37 Index: amisound.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/amiga/amisound.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- amisound.c 14 Jan 2001 19:34:08 -0000 1.1.1.1 +++ amisound.c 10 Apr 2002 14:34:33 -0000 1.2 @@ -16,7 +16,7 @@ #include <asm/system.h> #include <asm/amigahw.h> -static u_short *snd_data = NULL; +static unsigned short *snd_data = NULL; static const signed char sine_data[] = { 0, 39, 75, 103, 121, 127, 121, 103, 75, 39, 0, -39, -75, -103, -121, -127, -121, -103, -75, -39 @@ -28,7 +28,7 @@ * device since it depends on htotal (for OCS/ECS/AGA) */ -volatile u_short amiga_audio_min_period = 124; /* Default for pre-OCS */ +volatile unsigned short amiga_audio_min_period = 124; /* Default for pre-OCS */ #define MAX_PERIOD (65535) @@ -37,9 +37,9 @@ * Current period (set by dmasound.c) */ -u_short amiga_audio_period = MAX_PERIOD; +unsigned short amiga_audio_period = MAX_PERIOD; -static u_long clock_constant; +static unsigned long clock_constant; void __init amiga_init_sound(void) { @@ -76,7 +76,7 @@ del_timer( &sound_timer ); if (hz > 20 && hz < 32767) { - u_long period = (clock_constant / hz); + unsigned long period = (clock_constant / hz); if (period < amiga_audio_min_period) period = amiga_audio_min_period; @@ -86,7 +86,7 @@ /* setup pointer to data, period, length and volume */ custom.aud[2].audlc = snd_data; custom.aud[2].audlen = sizeof(sine_data)/2; - custom.aud[2].audper = (u_short)period; + custom.aud[2].audper = (unsigned short)period; custom.aud[2].audvol = 32; /* 50% of maxvol */ if (ticks) { Index: cia.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/amiga/cia.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- cia.c 14 Jan 2001 19:34:04 -0000 1.1.1.1 +++ cia.c 10 Apr 2002 14:34:33 -0000 1.2 @@ -23,8 +23,8 @@ struct ciabase { volatile struct CIA *cia; - u_char icr_mask, icr_data; - u_short int_mask; + unsigned char icr_mask, icr_data; + unsigned short int_mask; int handler_irq, cia_irq, server_irq; char *name; irq_handler_t irq_list[CIA_IRQS]; @@ -46,7 +46,7 @@ unsigned char cia_set_irq(struct ciabase *base, unsigned char mask) { - u_char old; + unsigned char old; old = (base->icr_data |= base->cia->icr); if (mask & CIA_ICR_SETCLR) @@ -65,7 +65,7 @@ unsigned char cia_able_irq(struct ciabase *base, unsigned char mask) { - u_char old, tmp; + unsigned char old, tmp; int i; old = base->icr_mask; @@ -91,7 +91,7 @@ void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id) { - u_char mask; + unsigned char mask; base->irq_list[irq].handler = handler; base->irq_list[irq].flags = flags; Index: config.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/amiga/config.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- config.c 14 Jan 2001 19:34:08 -0000 1.1.1.1 +++ config.c 10 Apr 2002 14:34:33 -0000 1.2 @@ -16,7 +16,6 @@ #include <linux/types.h> #include <linux/kernel.h> #include <linux/mm.h> -#include <linux/kd.h> #include <linux/tty.h> #include <linux/console.h> #include <linux/init.h> @@ -31,6 +30,7 @@ #include <asm/amigahw.h> #include <asm/amigaints.h> #include <asm/irq.h> +#include <asm/rtc.h> #include <asm/keyboard.h> #include <asm/machdep.h> #include <asm/io.h> @@ -44,22 +44,22 @@ unsigned char amiga_psfreq; struct amiga_hw_present amiga_hw_present; -static const char s_a500[] __initdata = "A500"; -static const char s_a500p[] __initdata = "A500+"; -static const char s_a600[] __initdata = "A600"; -static const char s_a1000[] __initdata = "A1000"; -static const char s_a1200[] __initdata = "A1200"; -static const char s_a2000[] __initdata = "A2000"; -static const char s_a2500[] __initdata = "A2500"; -static const char s_a3000[] __initdata = "A3000"; -static const char s_a3000t[] __initdata = "A3000T"; -static const char s_a3000p[] __initdata = "A3000+"; -static const char s_a4000[] __initdata = "A4000"; -static const char s_a4000t[] __initdata = "A4000T"; -static const char s_cdtv[] __initdata = "CDTV"; -static const char s_cd32[] __initdata = "CD32"; -static const char s_draco[] __initdata = "Draco"; -static const char *amiga_models[] __initdata = { +static char s_a500[] __initdata = "A500"; +static char s_a500p[] __initdata = "A500+"; +static char s_a600[] __initdata = "A600"; +static char s_a1000[] __initdata = "A1000"; +static char s_a1200[] __initdata = "A1200"; +static char s_a2000[] __initdata = "A2000"; +static char s_a2500[] __initdata = "A2500"; +static char s_a3000[] __initdata = "A3000"; +static char s_a3000t[] __initdata = "A3000T"; +static char s_a3000p[] __initdata = "A3000+"; +static char s_a4000[] __initdata = "A4000"; +static char s_a4000t[] __initdata = "A4000T"; +static char s_cdtv[] __initdata = "CDTV"; +static char s_cd32[] __initdata = "CD32"; +static char s_draco[] __initdata = "Draco"; +static char *amiga_models[] __initdata = { s_a500, s_a500p, s_a600, s_a1000, s_a1200, s_a2000, s_a2500, s_a3000, s_a3000t, s_a3000p, s_a4000, s_a4000t, s_cdtv, s_cd32, s_draco, }; @@ -767,20 +767,6 @@ break; } return 0; -} - -void dbprintf(const char *fmt , ...) -{ - static char buf[1024]; - va_list args; - extern void console_print (const char *str); - extern int vsprintf(char * buf, const char * fmt, va_list args); - - va_start(args, fmt); - vsprintf(buf, fmt, args); - va_end(args); - - console_print (buf); } static NORET_TYPE void amiga_reset( void ) Index: pcmcia.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/amiga/pcmcia.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- pcmcia.c 14 Jan 2001 19:34:09 -0000 1.1.1.1 +++ pcmcia.c 10 Apr 2002 14:34:33 -0000 1.2 @@ -19,7 +19,7 @@ #include <asm/amipcmcia.h> /* gayle config byte for program voltage and access speed */ -static u_char cfg_byte = GAYLE_CFG_0V|GAYLE_CFG_150NS; +static unsigned char cfg_byte = GAYLE_CFG_0V|GAYLE_CFG_150NS; void pcmcia_reset(void) { @@ -64,7 +64,7 @@ void pcmcia_program_voltage(int voltage) { - u_char v; + unsigned char v; switch (voltage) { case PCMCIA_0V: @@ -87,7 +87,7 @@ void pcmcia_access_speed(int speed) { - u_char s; + unsigned char s; if (speed <= PCMCIA_SPEED_100NS) s = GAYLE_CFG_100NS; |
From: Andy P. <at...@us...> - 2002-04-10 18:32:26
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/m68k/atari In directory usw-pr-cvs1:/tmp/cvs-serv13561/m68k/atari Modified Files: time.c Log Message: synch 2.4.15 commit 37 Index: time.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/m68k/atari/time.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- time.c 14 Jan 2001 19:34:26 -0000 1.1.1.1 +++ time.c 10 Apr 2002 14:34:33 -0000 1.2 @@ -12,10 +12,10 @@ #include <linux/types.h> #include <linux/mc146818rtc.h> -#include <linux/kd.h> #include <linux/interrupt.h> #include <linux/init.h> +#include <asm/rtc.h> void __init atari_sched_init(void (*timer_routine)(int, void *, struct pt_regs *)) |
From: Andy P. <at...@us...> - 2002-04-10 18:32:24
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ia64/boot In directory usw-pr-cvs1:/tmp/cvs-serv12040/ia64/boot Modified Files: bootloader.c bootloader.lds Log Message: synch 2.4.15 commit 36 Index: bootloader.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ia64/boot/bootloader.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bootloader.c 14 Jan 2001 19:48:58 -0000 1.1.1.1 +++ bootloader.c 10 Apr 2002 14:27:19 -0000 1.2 @@ -3,8 +3,8 @@ * * Loads an ELF kernel. * - * Copyright (C) 1998, 1999 Hewlett-Packard Co - * Copyright (C) 1998, 1999 David Mosberger-Tang <da...@hp...> + * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co + * Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <da...@hp...> * Copyright (C) 1998, 1999 Stephane Eranian <er...@hp...> * * 01/07/99 S.Eranian modified to pass command line arguments to kernel @@ -65,57 +65,39 @@ } } -void -enter_virtual_mode (unsigned long new_psr) -{ - long tmp; - - asm volatile ("movl %0=1f" : "=r"(tmp)); - asm volatile ("mov cr.ipsr=%0" :: "r"(new_psr)); - asm volatile ("mov cr.iip=%0" :: "r"(tmp)); - asm volatile ("mov cr.ifs=r0"); - asm volatile ("rfi;;"); - asm volatile ("1:"); -} - #define MAX_ARGS 32 void _start (void) { - register long sp asm ("sp"); static char stack[16384] __attribute__ ((aligned (16))); static char mem[4096]; static char buffer[1024]; - unsigned long flags, off; + unsigned long off; int fd, i; struct disk_req req; struct disk_stat stat; struct elfhdr *elf; struct elf_phdr *elf_phdr; /* program header */ unsigned long e_entry, e_phoff, e_phnum; + register struct ia64_boot_param *bp; char *kpath, *args; long arglen = 0; asm volatile ("movl gp=__gp;;" ::: "memory"); asm volatile ("mov sp=%0" :: "r"(stack) : "memory"); asm volatile ("bsw.1;;"); -#ifdef CONFIG_ITANIUM_ASTEP_SPECIFIC - asm volative ("nop 0;; nop 0;; nop 0;;"); -#endif /* CONFIG_ITANIUM_ASTEP_SPECIFIC */ ssc(0, 0, 0, 0, SSC_CONSOLE_INIT); /* - * S.Eranian: extract the commandline argument from the - * simulator + * S.Eranian: extract the commandline argument from the simulator * * The expected format is as follows: * * kernelname args... * - * Both are optional but you can't have the second one without the - * first. + * Both are optional but you can't have the second one without the first. */ arglen = ssc((long) buffer, 0, 0, 0, SSC_GET_ARGS); @@ -183,6 +165,10 @@ e_phoff += sizeof(*elf_phdr); elf_phdr = (struct elf_phdr *) mem; + + if (elf_phdr->p_type != PT_LOAD) + continue; + req.len = elf_phdr->p_filesz; req.addr = __pa(elf_phdr->p_vaddr); ssc(fd, 1, (long) &req, elf_phdr->p_offset, SSC_READ); @@ -197,38 +183,12 @@ /* fake an I/O base address: */ asm volatile ("mov ar.k0=%0" :: "r"(0xffffc000000UL)); - /* - * Install a translation register that identity maps the - * kernel's 256MB page. - */ - ia64_clear_ic(flags); - ia64_set_rr( 0, (0x1000 << 8) | (_PAGE_SIZE_1M << 2)); - ia64_set_rr(PAGE_OFFSET, (ia64_rid(0, PAGE_OFFSET) << 8) | (_PAGE_SIZE_256M << 2)); - ia64_srlz_d(); - ia64_itr(0x3, 0, 1024*1024, - pte_val(mk_pte_phys(1024*1024, __pgprot(__DIRTY_BITS|_PAGE_PL_0|_PAGE_AR_RWX))), - _PAGE_SIZE_1M); - ia64_itr(0x3, 1, PAGE_OFFSET, - pte_val(mk_pte_phys(0, __pgprot(__DIRTY_BITS|_PAGE_PL_0|_PAGE_AR_RWX))), - _PAGE_SIZE_256M); - ia64_srlz_i(); - - enter_virtual_mode(flags | IA64_PSR_IT | IA64_PSR_IC | IA64_PSR_DT | IA64_PSR_RT - | IA64_PSR_DFH | IA64_PSR_BN); - - sys_fw_init(args, arglen); + bp = sys_fw_init(args, arglen); ssc(0, (long) kpath, 0, 0, SSC_LOAD_SYMBOLS); - /* - * Install the kernel's command line argument on ZERO_PAGE - * just after the botoparam structure. - * In case we don't have any argument just put \0 - */ - memcpy(((struct ia64_boot_param *)ZERO_PAGE_ADDR) + 1, args, arglen); - sp = __pa(&stack); - - asm volatile ("br.sptk.few %0" :: "b"(e_entry)); + asm volatile ("mov sp=%2; mov r28=%1; br.sptk.few %0" + :: "b"(e_entry), "r"(bp), "r"(__pa(&stack))); cons_write("kernel returned!\n"); ssc(-1, 0, 0, 0, SSC_EXIT); Index: bootloader.lds =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ia64/boot/bootloader.lds,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bootloader.lds 14 Jan 2001 19:48:59 -0000 1.1.1.1 +++ bootloader.lds 10 Apr 2002 14:27:19 -0000 1.2 @@ -12,7 +12,7 @@ /* Global data */ _data = .; - .rodata : { *(.rodata) } + .rodata : { *(.rodata) *(.rodata.*) } .data : { *(.data) *(.gnu.linkonce.d*) CONSTRUCTORS } __gp = ALIGN (8) + 0x200000; .got : { *(.got.plt) *(.got) } |
From: Andy P. <at...@us...> - 2002-04-10 18:32:24
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips/mips-boards/generic In directory usw-pr-cvs1:/tmp/cvs-serv15904/arch/mips/mips-boards/generic Log Message: Directory /cvsroot/linux-vax/kernel-2.4/arch/mips/mips-boards/generic added to the repository |
From: Andy P. <at...@us...> - 2002-04-10 18:32:23
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips/mips-boards/malta In directory usw-pr-cvs1:/tmp/cvs-serv15904/arch/mips/mips-boards/malta Log Message: Directory /cvsroot/linux-vax/kernel-2.4/arch/mips/mips-boards/malta added to the repository |
From: Andy P. <at...@us...> - 2002-04-10 18:32:22
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ia64/dig In directory usw-pr-cvs1:/tmp/cvs-serv12040/ia64/dig Modified Files: setup.c Log Message: synch 2.4.15 commit 36 Index: setup.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ia64/dig/setup.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- setup.c 14 Jan 2001 19:48:59 -0000 1.1.1.1 +++ setup.c 10 Apr 2002 14:27:19 -0000 1.2 @@ -1,9 +1,9 @@ /* - * Platform dependent support for Intel SoftSDV simulator. + * Platform dependent support for DIG64 platforms. * * Copyright (C) 1999 Intel Corp. - * Copyright (C) 1999 Hewlett-Packard Co - * Copyright (C) 1999 David Mosberger-Tang <da...@hp...> + * Copyright (C) 1999, 2001 Hewlett-Packard Co + * Copyright (C) 1999, 2001 David Mosberger-Tang <da...@hp...> * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond <dru...@va...> * Copyright (C) 1999 Vijay Chander <vi...@en...> @@ -48,18 +48,14 @@ */ ROOT_DEV = to_kdev_t(0x0802); /* default to second partition on first drive */ -#ifdef CONFIG_IA64_SOFTSDV_HACKS - ROOT_DEV = to_kdev_t(0x0302); /* 2nd partion on 1st IDE */ -#endif /* CONFIG_IA64_SOFTSDV_HACKS */ - #ifdef CONFIG_SMP init_smp_config(); #endif memset(&screen_info, 0, sizeof(screen_info)); - if (!ia64_boot_param.console_info.num_rows - || !ia64_boot_param.console_info.num_cols) + if (!ia64_boot_param->console_info.num_rows + || !ia64_boot_param->console_info.num_cols) { printk("dig_setup: warning: invalid screen-info, guessing 80x25\n"); orig_x = 0; @@ -68,10 +64,10 @@ num_rows = 25; font_height = 16; } else { - orig_x = ia64_boot_param.console_info.orig_x; - orig_y = ia64_boot_param.console_info.orig_y; - num_cols = ia64_boot_param.console_info.num_cols; - num_rows = ia64_boot_param.console_info.num_rows; + orig_x = ia64_boot_param->console_info.orig_x; + orig_y = ia64_boot_param->console_info.orig_y; + num_cols = ia64_boot_param->console_info.num_cols; + num_rows = ia64_boot_param->console_info.num_rows; font_height = 400 / num_rows; } |