Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6: (24 commits)
[SPARC]: Add solaris/sunos binary support to feature removal schedule.
[SPARC]: Merge asm-sparc{,64}/a.out.h
[SPARC]: Merge asm-sparc{,64}/fb.h
[SPARC]: Merge asm-sparc{,64}/errno.h
[SPARC]: Merge asm-sparc{,64}/emergency-restart.h
[SPARC]: Merge asm-sparc{,64}/div64.h
[SPARC]: Merge asm-sparc{,64}/device.h
[SPARC]: Merge asm-sparc{,64}/current.h
[SPARC]: Merge asm-sparc{,64}/cputime.h
[SPARC]: Merge asm-sparc{,64}/cache.h
[SPARC]: Merge asm-sparc{,64}/byteorder.h
[SPARC]: Merge asm-sparc{,64}/bugs.h
[SPARC]: Merge asm-sparc{,64}/bug.h
[SPARC]: Kill BSD errno translation table and header files.
[SPARC]: Merge asm-sparc{,64}/bpp.h
[SPARC]: Merge include/asm-sparc{,64}/auxvec.h
[SPARC]: Merge include/asm-sparc{,64}/of_device.h
[SPARC]: Merge include/asm-sparc{,64}/prom.h
[SPARC]: Remove of_platform_device_create
[SPARC64]: Add kretprobe support.
...

+692 -1327
+11
Documentation/feature-removal-schedule.txt
··· 304 304 and slightly hurts runtime performance. Bugfixes for the old firmware 305 305 are not provided by Broadcom anymore. 306 306 Who: Michael Buesch <mb@bu3sch.de> 307 + 308 + --------------------------- 309 + 310 + What: Solaris/SunOS syscall and binary support on Sparc 311 + When: 2.6.26 312 + Why: Largely unmaintained and almost entirely unused. File system 313 + layering used to divert library and dynamic linker searches to 314 + /usr/gnemul is extremely buggy and unfixable. Making it work 315 + is largely pointless as without a lot of work only the most 316 + trivial of Solaris binaries can work with the emulation code. 317 + Who: David S. Miller <davem@davemloft.net>
+6 -138
arch/sparc/kernel/errtbls.c
··· 1 - /* $Id: errtbls.c,v 1.2 1995/11/25 00:57:55 davem Exp $ 2 - * errtbls.c: Error number conversion tables between various syscall 3 - * OS semantics. 1 + /* errtbls.c: Error number conversion tables. 4 2 * 5 - * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 3 + * Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net) 6 4 * 7 5 * Based upon preliminary work which is: 8 6 * 9 7 * Copyright (C) 1995 Adrian M. Rodriguez (adrian@remus.rutgers.edu) 10 8 */ 11 9 12 - #include <asm/bsderrno.h> /* NetBSD (bsd4.4) errnos */ 13 10 #include <asm/solerrno.h> /* Solaris errnos */ 14 11 15 - /* Here are tables which convert between Linux/SunOS error number 16 - * values to the equivalent in other OSs. Note that since the Linux 17 - * ones have been set up to match exactly those of SunOS, no 18 - * translation table is needed for that OS. 12 + /* Here is the table which converts between Linux error number values 13 + * to the equivalent under Solaris. Note that since the Linux ones 14 + * have been set up to match exactly those of SunOS, no translation 15 + * table is needed for that OS. 19 16 */ 20 17 21 18 int solaris_errno[] = { ··· 142 145 SOL_ELIBMAX, 143 146 SOL_ELIBSCN, 144 147 }; 145 - 146 - int netbsd_errno[] = { 147 - 0, 148 - BSD_EPERM, 149 - BSD_ENOENT, 150 - BSD_ESRCH, 151 - BSD_EINTR, 152 - BSD_EIO, 153 - BSD_ENXIO, 154 - BSD_E2BIG, 155 - BSD_ENOEXEC, 156 - BSD_EBADF, 157 - BSD_ECHILD, 158 - BSD_EAGAIN, 159 - BSD_ENOMEM, 160 - BSD_EACCES, 161 - BSD_EFAULT, 162 - BSD_NOTBLK, 163 - BSD_EBUSY, 164 - BSD_EEXIST, 165 - BSD_EXDEV, 166 - BSD_ENODEV, 167 - BSD_ENOTDIR, 168 - BSD_EISDIR, 169 - BSD_EINVAL, 170 - BSD_ENFILE, 171 - BSD_EMFILE, 172 - BSD_ENOTTY, 173 - BSD_ETXTBSY, 174 - BSD_EFBIG, 175 - BSD_ENOSPC, 176 - BSD_ESPIPE, 177 - BSD_EROFS, 178 - BSD_EMLINK, 179 - BSD_EPIPE, 180 - BSD_EDOM, 181 - BSD_ERANGE, 182 - BSD_EWOULDBLOCK, 183 - BSD_EINPROGRESS, 184 - BSD_EALREADY, 185 - BSD_ENOTSOCK, 186 - BSD_EDESTADDRREQ, 187 - BSD_EMSGSIZE, 188 - BSD_EPROTOTYPE, 189 - BSD_ENOPROTOOPT, 190 - BSD_EPROTONOSUPPORT, 191 - BSD_ESOCKTNOSUPPORT, 192 - BSD_EOPNOTSUPP, 193 - BSD_EPFNOSUPPORT, 194 - BSD_EAFNOSUPPORT, 195 - BSD_EADDRINUSE, 196 - BSD_EADDRNOTAVAIL, 197 - BSD_ENETDOWN, 198 - BSD_ENETUNREACH, 199 - BSD_ENETRESET, 200 - BSD_ECONNABORTED, 201 - BSD_ECONNRESET, 202 - BSD_ENOBUFS, 203 - BSD_EISCONN, 204 - BSD_ENOTONN, 205 - BSD_ESHUTDOWN, 206 - BSD_ETOOMANYREFS, 207 - BSD_ETIMEDOUT, 208 - BSD_ECONNREFUSED, 209 - BSD_ELOOP, 210 - BSD_ENAMETOOLONG, 211 - BSD_EHOSTDOWN, 212 - BSD_EHOSTUNREACH, 213 - BSD_ENOTEMPTY, 214 - BSD_EPROCLIM, 215 - BSD_EUSERS, 216 - BSD_EDQUOT, 217 - BSD_ESTALE, 218 - BSD_EREMOTE, 219 - BSD_ENOSTR, 220 - BSD_ETIME, 221 - BSD_ENOSR, 222 - BSD_ENOMSG, 223 - BSD_EBADMSG, 224 - BSD_IDRM, 225 - BSD_EDEADLK, 226 - BSD_ENOLCK, 227 - BSD_ENONET, 228 - BSD_ERREMOTE, 229 - BSD_ENOLINK, 230 - BSD_EADV, 231 - BSD_ESRMNT, 232 - BSD_ECOMM, 233 - BSD_EPROTO, 234 - BSD_EMULTIHOP, 235 - BSD_EINVAL, /* EDOTDOT XXX??? */ 236 - BSD_REMCHG, 237 - BSD_NOSYS, 238 - BSD_STRPIPE, 239 - BSD_EOVERFLOW, 240 - BSD_EBADFD, 241 - BSD_ECHRNG, 242 - BSD_EL2NSYNC, 243 - BSD_EL3HLT, 244 - BSD_EL3RST, 245 - BSD_NRNG, 246 - BSD_EUNATCH, 247 - BSD_ENOCSI, 248 - BSD_EL2HLT, 249 - BSD_EBADE, 250 - BSD_EBADR, 251 - BSD_EXFULL, 252 - BSD_ENOANO, 253 - BSD_EBADRQC, 254 - BSD_EBADSLT, 255 - BSD_EDEADLOCK, 256 - BSD_EBFONT, 257 - BSD_ELIBEXEC, 258 - BSD_ENODATA, 259 - BSD_ELIBBAD, 260 - BSD_ENOPKG, 261 - BSD_ELIBACC, 262 - BSD_ENOTUNIQ, 263 - BSD_ERESTART, 264 - BSD_EUCLEAN, 265 - BSD_ENOTNAM, 266 - BSD_ENAVAIL, 267 - BSD_EISNAM, 268 - BSD_EREMOTEIO, 269 - BSD_EILSEQ, 270 - BSD_ELIBMAX, 271 - BSD_ELIBSCN, 272 - }; 273 -
-27
arch/sparc/kernel/of_device.c
··· 584 584 } 585 585 586 586 __setup("of_debug=", of_debug); 587 - 588 - struct of_device* of_platform_device_create(struct device_node *np, 589 - const char *bus_id, 590 - struct device *parent, 591 - struct bus_type *bus) 592 - { 593 - struct of_device *dev; 594 - 595 - dev = kzalloc(sizeof(*dev), GFP_KERNEL); 596 - if (!dev) 597 - return NULL; 598 - 599 - dev->dev.parent = parent; 600 - dev->dev.bus = bus; 601 - dev->dev.release = of_release_dev; 602 - 603 - strlcpy(dev->dev.bus_id, bus_id, BUS_ID_SIZE); 604 - 605 - if (of_device_register(dev) != 0) { 606 - kfree(dev); 607 - return NULL; 608 - } 609 - 610 - return dev; 611 - } 612 - 613 - EXPORT_SYMBOL(of_platform_device_create);
+4
arch/sparc/kernel/vmlinux.lds.S
··· 89 89 .data.cacheline_aligned : { 90 90 *(.data.cacheline_aligned) 91 91 } 92 + . = ALIGN(32); 93 + .data.read_mostly : { 94 + *(.data.read_mostly) 95 + } 92 96 93 97 __bss_start = .; 94 98 .sbss : {
+4
arch/sparc64/Kconfig
··· 41 41 bool 42 42 default y 43 43 44 + config IOMMU_HELPER 45 + bool 46 + default y 47 + 44 48 config QUICKLIST 45 49 bool 46 50 default y
+236 -114
arch/sparc64/kernel/iommu.c
··· 1 1 /* iommu.c: Generic sparc64 IOMMU support. 2 2 * 3 - * Copyright (C) 1999, 2007 David S. Miller (davem@davemloft.net) 3 + * Copyright (C) 1999, 2007, 2008 David S. Miller (davem@davemloft.net) 4 4 * Copyright (C) 1999, 2000 Jakub Jelinek (jakub@redhat.com) 5 5 */ 6 6 ··· 10 10 #include <linux/device.h> 11 11 #include <linux/dma-mapping.h> 12 12 #include <linux/errno.h> 13 + #include <linux/iommu-helper.h> 13 14 14 15 #ifdef CONFIG_PCI 15 16 #include <linux/pci.h> ··· 42 41 "i" (ASI_PHYS_BYPASS_EC_E)) 43 42 44 43 /* Must be invoked under the IOMMU lock. */ 45 - static void __iommu_flushall(struct iommu *iommu) 44 + static void iommu_flushall(struct iommu *iommu) 46 45 { 47 46 if (iommu->iommu_flushinv) { 48 47 iommu_write(iommu->iommu_flushinv, ~(u64)0); ··· 84 83 iopte_val(*iopte) = val; 85 84 } 86 85 87 - /* Based largely upon the ppc64 iommu allocator. */ 88 - static long arena_alloc(struct iommu *iommu, unsigned long npages) 86 + /* Based almost entirely upon the ppc64 iommu allocator. If you use the 'handle' 87 + * facility it must all be done in one pass while under the iommu lock. 88 + * 89 + * On sun4u platforms, we only flush the IOMMU once every time we've passed 90 + * over the entire page table doing allocations. Therefore we only ever advance 91 + * the hint and cannot backtrack it. 92 + */ 93 + unsigned long iommu_range_alloc(struct device *dev, 94 + struct iommu *iommu, 95 + unsigned long npages, 96 + unsigned long *handle) 89 97 { 98 + unsigned long n, end, start, limit, boundary_size; 90 99 struct iommu_arena *arena = &iommu->arena; 91 - unsigned long n, i, start, end, limit; 92 - int pass; 100 + int pass = 0; 101 + 102 + /* This allocator was derived from x86_64's bit string search */ 103 + 104 + /* Sanity check */ 105 + if (unlikely(npages == 0)) { 106 + if (printk_ratelimit()) 107 + WARN_ON(1); 108 + return DMA_ERROR_CODE; 109 + } 110 + 111 + if (handle && *handle) 112 + start = *handle; 113 + else 114 + start = arena->hint; 93 115 94 116 limit = arena->limit; 95 - start = arena->hint; 96 - pass = 0; 97 117 98 - again: 99 - n = find_next_zero_bit(arena->map, limit, start); 100 - end = n + npages; 101 - if (unlikely(end >= limit)) { 118 + /* The case below can happen if we have a small segment appended 119 + * to a large, or when the previous alloc was at the very end of 120 + * the available space. If so, go back to the beginning and flush. 121 + */ 122 + if (start >= limit) { 123 + start = 0; 124 + if (iommu->flush_all) 125 + iommu->flush_all(iommu); 126 + } 127 + 128 + again: 129 + 130 + if (dev) 131 + boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1, 132 + 1 << IO_PAGE_SHIFT); 133 + else 134 + boundary_size = ALIGN(1UL << 32, 1 << IO_PAGE_SHIFT); 135 + 136 + n = iommu_area_alloc(arena->map, limit, start, npages, 0, 137 + boundary_size >> IO_PAGE_SHIFT, 0); 138 + if (n == -1) { 102 139 if (likely(pass < 1)) { 103 - limit = start; 140 + /* First failure, rescan from the beginning. */ 104 141 start = 0; 105 - __iommu_flushall(iommu); 142 + if (iommu->flush_all) 143 + iommu->flush_all(iommu); 106 144 pass++; 107 145 goto again; 108 146 } else { 109 - /* Scanned the whole thing, give up. */ 110 - return -1; 147 + /* Second failure, give up */ 148 + return DMA_ERROR_CODE; 111 149 } 112 150 } 113 151 114 - for (i = n; i < end; i++) { 115 - if (test_bit(i, arena->map)) { 116 - start = i + 1; 117 - goto again; 118 - } 119 - } 120 - 121 - for (i = n; i < end; i++) 122 - __set_bit(i, arena->map); 152 + end = n + npages; 123 153 124 154 arena->hint = end; 155 + 156 + /* Update handle for SG allocations */ 157 + if (handle) 158 + *handle = end; 125 159 126 160 return n; 127 161 } 128 162 129 - static void arena_free(struct iommu_arena *arena, unsigned long base, unsigned long npages) 163 + void iommu_range_free(struct iommu *iommu, dma_addr_t dma_addr, unsigned long npages) 130 164 { 131 - unsigned long i; 165 + struct iommu_arena *arena = &iommu->arena; 166 + unsigned long entry; 132 167 133 - for (i = base; i < (base + npages); i++) 134 - __clear_bit(i, arena->map); 168 + entry = (dma_addr - iommu->page_table_map_base) >> IO_PAGE_SHIFT; 169 + 170 + iommu_area_free(arena->map, entry, npages); 135 171 } 136 172 137 173 int iommu_table_init(struct iommu *iommu, int tsbsize, ··· 193 155 return -ENOMEM; 194 156 } 195 157 iommu->arena.limit = num_tsb_entries; 158 + 159 + if (tlb_type != hypervisor) 160 + iommu->flush_all = iommu_flushall; 196 161 197 162 /* Allocate and initialize the dummy page which we 198 163 * set inactive IO PTEs to point to. ··· 233 192 return -ENOMEM; 234 193 } 235 194 236 - static inline iopte_t *alloc_npages(struct iommu *iommu, unsigned long npages) 195 + static inline iopte_t *alloc_npages(struct device *dev, struct iommu *iommu, 196 + unsigned long npages) 237 197 { 238 - long entry; 198 + unsigned long entry; 239 199 240 - entry = arena_alloc(iommu, npages); 241 - if (unlikely(entry < 0)) 200 + entry = iommu_range_alloc(dev, iommu, npages, NULL); 201 + if (unlikely(entry == DMA_ERROR_CODE)) 242 202 return NULL; 243 203 244 204 return iommu->page_table + entry; 245 - } 246 - 247 - static inline void free_npages(struct iommu *iommu, dma_addr_t base, unsigned long npages) 248 - { 249 - arena_free(&iommu->arena, base >> IO_PAGE_SHIFT, npages); 250 205 } 251 206 252 207 static int iommu_alloc_ctx(struct iommu *iommu) ··· 295 258 iommu = dev->archdata.iommu; 296 259 297 260 spin_lock_irqsave(&iommu->lock, flags); 298 - iopte = alloc_npages(iommu, size >> IO_PAGE_SHIFT); 261 + iopte = alloc_npages(dev, iommu, size >> IO_PAGE_SHIFT); 299 262 spin_unlock_irqrestore(&iommu->lock, flags); 300 263 301 264 if (unlikely(iopte == NULL)) { ··· 333 296 334 297 spin_lock_irqsave(&iommu->lock, flags); 335 298 336 - free_npages(iommu, dvma - iommu->page_table_map_base, npages); 299 + iommu_range_free(iommu, dvma, npages); 337 300 338 301 spin_unlock_irqrestore(&iommu->lock, flags); 339 302 ··· 364 327 npages >>= IO_PAGE_SHIFT; 365 328 366 329 spin_lock_irqsave(&iommu->lock, flags); 367 - base = alloc_npages(iommu, npages); 330 + base = alloc_npages(dev, iommu, npages); 368 331 ctx = 0; 369 332 if (iommu->iommu_ctxflush) 370 333 ctx = iommu_alloc_ctx(iommu); ··· 502 465 for (i = 0; i < npages; i++) 503 466 iopte_make_dummy(iommu, base + i); 504 467 505 - free_npages(iommu, bus_addr - iommu->page_table_map_base, npages); 468 + iommu_range_free(iommu, bus_addr, npages); 506 469 507 470 iommu_free_ctx(iommu, ctx); 508 471 ··· 512 475 static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist, 513 476 int nelems, enum dma_data_direction direction) 514 477 { 515 - unsigned long flags, ctx, i, npages, iopte_protection; 516 - struct scatterlist *sg; 478 + struct scatterlist *s, *outs, *segstart; 479 + unsigned long flags, handle, prot, ctx; 480 + dma_addr_t dma_next = 0, dma_addr; 481 + unsigned int max_seg_size; 482 + int outcount, incount, i; 517 483 struct strbuf *strbuf; 518 484 struct iommu *iommu; 519 - iopte_t *base; 520 - u32 dma_base; 521 485 522 - /* Fast path single entry scatterlists. */ 523 - if (nelems == 1) { 524 - sglist->dma_address = 525 - dma_4u_map_single(dev, sg_virt(sglist), 526 - sglist->length, direction); 527 - if (unlikely(sglist->dma_address == DMA_ERROR_CODE)) 528 - return 0; 529 - sglist->dma_length = sglist->length; 530 - return 1; 531 - } 486 + BUG_ON(direction == DMA_NONE); 532 487 533 488 iommu = dev->archdata.iommu; 534 489 strbuf = dev->archdata.stc; 535 - 536 - if (unlikely(direction == DMA_NONE)) 537 - goto bad_no_ctx; 538 - 539 - npages = calc_npages(sglist, nelems); 490 + if (nelems == 0 || !iommu) 491 + return 0; 540 492 541 493 spin_lock_irqsave(&iommu->lock, flags); 542 494 543 - base = alloc_npages(iommu, npages); 544 495 ctx = 0; 545 496 if (iommu->iommu_ctxflush) 546 497 ctx = iommu_alloc_ctx(iommu); 547 498 548 - spin_unlock_irqrestore(&iommu->lock, flags); 549 - 550 - if (base == NULL) 551 - goto bad; 552 - 553 - dma_base = iommu->page_table_map_base + 554 - ((base - iommu->page_table) << IO_PAGE_SHIFT); 555 - 556 499 if (strbuf->strbuf_enabled) 557 - iopte_protection = IOPTE_STREAMING(ctx); 500 + prot = IOPTE_STREAMING(ctx); 558 501 else 559 - iopte_protection = IOPTE_CONSISTENT(ctx); 502 + prot = IOPTE_CONSISTENT(ctx); 560 503 if (direction != DMA_TO_DEVICE) 561 - iopte_protection |= IOPTE_WRITE; 504 + prot |= IOPTE_WRITE; 562 505 563 - for_each_sg(sglist, sg, nelems, i) { 564 - unsigned long paddr = SG_ENT_PHYS_ADDRESS(sg); 565 - unsigned long slen = sg->length; 566 - unsigned long this_npages; 506 + outs = s = segstart = &sglist[0]; 507 + outcount = 1; 508 + incount = nelems; 509 + handle = 0; 567 510 568 - this_npages = iommu_num_pages(paddr, slen); 511 + /* Init first segment length for backout at failure */ 512 + outs->dma_length = 0; 569 513 570 - sg->dma_address = dma_base | (paddr & ~IO_PAGE_MASK); 571 - sg->dma_length = slen; 514 + max_seg_size = dma_get_max_seg_size(dev); 515 + for_each_sg(sglist, s, nelems, i) { 516 + unsigned long paddr, npages, entry, slen; 517 + iopte_t *base; 572 518 519 + slen = s->length; 520 + /* Sanity check */ 521 + if (slen == 0) { 522 + dma_next = 0; 523 + continue; 524 + } 525 + /* Allocate iommu entries for that segment */ 526 + paddr = (unsigned long) SG_ENT_PHYS_ADDRESS(s); 527 + npages = iommu_num_pages(paddr, slen); 528 + entry = iommu_range_alloc(dev, iommu, npages, &handle); 529 + 530 + /* Handle failure */ 531 + if (unlikely(entry == DMA_ERROR_CODE)) { 532 + if (printk_ratelimit()) 533 + printk(KERN_INFO "iommu_alloc failed, iommu %p paddr %lx" 534 + " npages %lx\n", iommu, paddr, npages); 535 + goto iommu_map_failed; 536 + } 537 + 538 + base = iommu->page_table + entry; 539 + 540 + /* Convert entry to a dma_addr_t */ 541 + dma_addr = iommu->page_table_map_base + 542 + (entry << IO_PAGE_SHIFT); 543 + dma_addr |= (s->offset & ~IO_PAGE_MASK); 544 + 545 + /* Insert into HW table */ 573 546 paddr &= IO_PAGE_MASK; 574 - while (this_npages--) { 575 - iopte_val(*base) = iopte_protection | paddr; 576 - 547 + while (npages--) { 548 + iopte_val(*base) = prot | paddr; 577 549 base++; 578 550 paddr += IO_PAGE_SIZE; 579 - dma_base += IO_PAGE_SIZE; 580 551 } 552 + 553 + /* If we are in an open segment, try merging */ 554 + if (segstart != s) { 555 + /* We cannot merge if: 556 + * - allocated dma_addr isn't contiguous to previous allocation 557 + */ 558 + if ((dma_addr != dma_next) || 559 + (outs->dma_length + s->length > max_seg_size)) { 560 + /* Can't merge: create a new segment */ 561 + segstart = s; 562 + outcount++; 563 + outs = sg_next(outs); 564 + } else { 565 + outs->dma_length += s->length; 566 + } 567 + } 568 + 569 + if (segstart == s) { 570 + /* This is a new segment, fill entries */ 571 + outs->dma_address = dma_addr; 572 + outs->dma_length = slen; 573 + } 574 + 575 + /* Calculate next page pointer for contiguous check */ 576 + dma_next = dma_addr + slen; 581 577 } 582 578 583 - return nelems; 579 + spin_unlock_irqrestore(&iommu->lock, flags); 584 580 585 - bad: 586 - iommu_free_ctx(iommu, ctx); 587 - bad_no_ctx: 588 - if (printk_ratelimit()) 589 - WARN_ON(1); 581 + if (outcount < incount) { 582 + outs = sg_next(outs); 583 + outs->dma_address = DMA_ERROR_CODE; 584 + outs->dma_length = 0; 585 + } 586 + 587 + return outcount; 588 + 589 + iommu_map_failed: 590 + for_each_sg(sglist, s, nelems, i) { 591 + if (s->dma_length != 0) { 592 + unsigned long vaddr, npages, entry, i; 593 + iopte_t *base; 594 + 595 + vaddr = s->dma_address & IO_PAGE_MASK; 596 + npages = iommu_num_pages(s->dma_address, s->dma_length); 597 + iommu_range_free(iommu, vaddr, npages); 598 + 599 + entry = (vaddr - iommu->page_table_map_base) 600 + >> IO_PAGE_SHIFT; 601 + base = iommu->page_table + entry; 602 + 603 + for (i = 0; i < npages; i++) 604 + iopte_make_dummy(iommu, base + i); 605 + 606 + s->dma_address = DMA_ERROR_CODE; 607 + s->dma_length = 0; 608 + } 609 + if (s == outs) 610 + break; 611 + } 612 + spin_unlock_irqrestore(&iommu->lock, flags); 613 + 590 614 return 0; 615 + } 616 + 617 + /* If contexts are being used, they are the same in all of the mappings 618 + * we make for a particular SG. 619 + */ 620 + static unsigned long fetch_sg_ctx(struct iommu *iommu, struct scatterlist *sg) 621 + { 622 + unsigned long ctx = 0; 623 + 624 + if (iommu->iommu_ctxflush) { 625 + iopte_t *base; 626 + u32 bus_addr; 627 + 628 + bus_addr = sg->dma_address & IO_PAGE_MASK; 629 + base = iommu->page_table + 630 + ((bus_addr - iommu->page_table_map_base) >> IO_PAGE_SHIFT); 631 + 632 + ctx = (iopte_val(*base) & IOPTE_CONTEXT) >> 47UL; 633 + } 634 + return ctx; 591 635 } 592 636 593 637 static void dma_4u_unmap_sg(struct device *dev, struct scatterlist *sglist, 594 638 int nelems, enum dma_data_direction direction) 595 639 { 596 - unsigned long flags, ctx, i, npages; 640 + unsigned long flags, ctx; 641 + struct scatterlist *sg; 597 642 struct strbuf *strbuf; 598 643 struct iommu *iommu; 599 - iopte_t *base; 600 - u32 bus_addr; 601 644 602 - if (unlikely(direction == DMA_NONE)) { 603 - if (printk_ratelimit()) 604 - WARN_ON(1); 605 - } 645 + BUG_ON(direction == DMA_NONE); 606 646 607 647 iommu = dev->archdata.iommu; 608 648 strbuf = dev->archdata.stc; 609 649 610 - bus_addr = sglist->dma_address & IO_PAGE_MASK; 611 - 612 - npages = calc_npages(sglist, nelems); 613 - 614 - base = iommu->page_table + 615 - ((bus_addr - iommu->page_table_map_base) >> IO_PAGE_SHIFT); 650 + ctx = fetch_sg_ctx(iommu, sglist); 616 651 617 652 spin_lock_irqsave(&iommu->lock, flags); 618 653 619 - /* Record the context, if any. */ 620 - ctx = 0; 621 - if (iommu->iommu_ctxflush) 622 - ctx = (iopte_val(*base) & IOPTE_CONTEXT) >> 47UL; 654 + sg = sglist; 655 + while (nelems--) { 656 + dma_addr_t dma_handle = sg->dma_address; 657 + unsigned int len = sg->dma_length; 658 + unsigned long npages, entry; 659 + iopte_t *base; 660 + int i; 623 661 624 - /* Step 1: Kick data out of streaming buffers if necessary. */ 625 - if (strbuf->strbuf_enabled) 626 - strbuf_flush(strbuf, iommu, bus_addr, ctx, npages, direction); 662 + if (!len) 663 + break; 664 + npages = iommu_num_pages(dma_handle, len); 665 + iommu_range_free(iommu, dma_handle, npages); 627 666 628 - /* Step 2: Clear out the TSB entries. */ 629 - for (i = 0; i < npages; i++) 630 - iopte_make_dummy(iommu, base + i); 667 + entry = ((dma_handle - iommu->page_table_map_base) 668 + >> IO_PAGE_SHIFT); 669 + base = iommu->page_table + entry; 631 670 632 - free_npages(iommu, bus_addr - iommu->page_table_map_base, npages); 671 + dma_handle &= IO_PAGE_MASK; 672 + if (strbuf->strbuf_enabled) 673 + strbuf_flush(strbuf, iommu, dma_handle, ctx, 674 + npages, direction); 675 + 676 + for (i = 0; i < npages; i++) 677 + iopte_make_dummy(iommu, base + i); 678 + 679 + sg = sg_next(sg); 680 + } 633 681 634 682 iommu_free_ctx(iommu, ctx); 635 683
+13 -20
arch/sparc64/kernel/iommu_common.h
··· 1 - /* $Id: iommu_common.h,v 1.5 2001/12/11 09:41:01 davem Exp $ 2 - * iommu_common.h: UltraSparc SBUS/PCI common iommu declarations. 1 + /* iommu_common.h: UltraSparc SBUS/PCI common iommu declarations. 3 2 * 4 - * Copyright (C) 1999 David S. Miller (davem@redhat.com) 3 + * Copyright (C) 1999, 2008 David S. Miller (davem@davemloft.net) 5 4 */ 5 + 6 + #ifndef _IOMMU_COMMON_H 7 + #define _IOMMU_COMMON_H 6 8 7 9 #include <linux/kernel.h> 8 10 #include <linux/types.h> ··· 58 56 return npages; 59 57 } 60 58 61 - /* You are _strongly_ advised to enable the following debugging code 62 - * any time you make changes to the sg code below, run it for a while 63 - * with filesystems mounted read-only before buying the farm... -DaveM 64 - */ 65 - #undef VERIFY_SG 59 + extern unsigned long iommu_range_alloc(struct device *dev, 60 + struct iommu *iommu, 61 + unsigned long npages, 62 + unsigned long *handle); 63 + extern void iommu_range_free(struct iommu *iommu, 64 + dma_addr_t dma_addr, 65 + unsigned long npages); 66 66 67 - #ifdef VERIFY_SG 68 - extern void verify_sglist(struct scatterlist *sg, int nents, iopte_t *iopte, int npages); 69 - #endif 70 - 71 - /* Two addresses are "virtually contiguous" if and only if: 72 - * 1) They are equal, or... 73 - * 2) They are both on a page boundary 74 - */ 75 - #define VCONTIG(__X, __Y) (((__X) == (__Y)) || \ 76 - (((__X) | (__Y)) << (64UL - PAGE_SHIFT)) == 0UL) 77 - 78 - extern unsigned long prepare_sg(struct device *dev, struct scatterlist *sg, int nents); 67 + #endif /* _IOMMU_COMMON_H */
+111 -2
arch/sparc64/kernel/kprobes.c
··· 480 480 return 0; 481 481 } 482 482 483 - /* architecture specific initialization */ 484 - int arch_init_kprobes(void) 483 + /* Called with kretprobe_lock held. The value stored in the return 484 + * address register is actually 2 instructions before where the 485 + * callee will return to. Sequences usually look something like this 486 + * 487 + * call some_function <--- return register points here 488 + * nop <--- call delay slot 489 + * whatever <--- where callee returns to 490 + * 491 + * To keep trampoline_probe_handler logic simpler, we normalize the 492 + * value kept in ri->ret_addr so we don't need to keep adjusting it 493 + * back and forth. 494 + */ 495 + void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri, 496 + struct pt_regs *regs) 485 497 { 498 + ri->ret_addr = (kprobe_opcode_t *)(regs->u_regs[UREG_RETPC] + 8); 499 + 500 + /* Replace the return addr with trampoline addr */ 501 + regs->u_regs[UREG_RETPC] = 502 + ((unsigned long)kretprobe_trampoline) - 8; 503 + } 504 + 505 + /* 506 + * Called when the probe at kretprobe trampoline is hit 507 + */ 508 + int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) 509 + { 510 + struct kretprobe_instance *ri = NULL; 511 + struct hlist_head *head, empty_rp; 512 + struct hlist_node *node, *tmp; 513 + unsigned long flags, orig_ret_address = 0; 514 + unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline; 515 + 516 + INIT_HLIST_HEAD(&empty_rp); 517 + spin_lock_irqsave(&kretprobe_lock, flags); 518 + head = kretprobe_inst_table_head(current); 519 + 520 + /* 521 + * It is possible to have multiple instances associated with a given 522 + * task either because an multiple functions in the call path 523 + * have a return probe installed on them, and/or more then one return 524 + * return probe was registered for a target function. 525 + * 526 + * We can handle this because: 527 + * - instances are always inserted at the head of the list 528 + * - when multiple return probes are registered for the same 529 + * function, the first instance's ret_addr will point to the 530 + * real return address, and all the rest will point to 531 + * kretprobe_trampoline 532 + */ 533 + hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { 534 + if (ri->task != current) 535 + /* another task is sharing our hash bucket */ 536 + continue; 537 + 538 + if (ri->rp && ri->rp->handler) 539 + ri->rp->handler(ri, regs); 540 + 541 + orig_ret_address = (unsigned long)ri->ret_addr; 542 + recycle_rp_inst(ri, &empty_rp); 543 + 544 + if (orig_ret_address != trampoline_address) 545 + /* 546 + * This is the real return address. Any other 547 + * instances associated with this task are for 548 + * other calls deeper on the call stack 549 + */ 550 + break; 551 + } 552 + 553 + kretprobe_assert(ri, orig_ret_address, trampoline_address); 554 + regs->tpc = orig_ret_address; 555 + regs->tnpc = orig_ret_address + 4; 556 + 557 + reset_current_kprobe(); 558 + spin_unlock_irqrestore(&kretprobe_lock, flags); 559 + preempt_enable_no_resched(); 560 + 561 + hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) { 562 + hlist_del(&ri->hlist); 563 + kfree(ri); 564 + } 565 + /* 566 + * By returning a non-zero value, we are telling 567 + * kprobe_handler() that we don't want the post_handler 568 + * to run (and have re-enabled preemption) 569 + */ 570 + return 1; 571 + } 572 + 573 + void kretprobe_trampoline_holder(void) 574 + { 575 + asm volatile(".global kretprobe_trampoline\n" 576 + "kretprobe_trampoline:\n" 577 + "\tnop\n" 578 + "\tnop\n"); 579 + } 580 + static struct kprobe trampoline_p = { 581 + .addr = (kprobe_opcode_t *) &kretprobe_trampoline, 582 + .pre_handler = trampoline_probe_handler 583 + }; 584 + 585 + int __init arch_init_kprobes(void) 586 + { 587 + return register_kprobe(&trampoline_p); 588 + } 589 + 590 + int __kprobes arch_trampoline_kprobe(struct kprobe *p) 591 + { 592 + if (p->addr == (kprobe_opcode_t *)&kretprobe_trampoline) 593 + return 1; 594 + 486 595 return 0; 487 596 }
-26
arch/sparc64/kernel/of_device.c
··· 868 868 } 869 869 870 870 __setup("of_debug=", of_debug); 871 - 872 - struct of_device* of_platform_device_create(struct device_node *np, 873 - const char *bus_id, 874 - struct device *parent, 875 - struct bus_type *bus) 876 - { 877 - struct of_device *dev; 878 - 879 - dev = kzalloc(sizeof(*dev), GFP_KERNEL); 880 - if (!dev) 881 - return NULL; 882 - 883 - dev->dev.parent = parent; 884 - dev->dev.bus = bus; 885 - dev->dev.release = of_release_dev; 886 - 887 - strlcpy(dev->dev.bus_id, bus_id, BUS_ID_SIZE); 888 - 889 - if (of_device_register(dev) != 0) { 890 - kfree(dev); 891 - return NULL; 892 - } 893 - 894 - return dev; 895 - } 896 - EXPORT_SYMBOL(of_platform_device_create);
+148 -138
arch/sparc64/kernel/pci_sun4v.c
··· 1 1 /* pci_sun4v.c: SUN4V specific PCI controller support. 2 2 * 3 - * Copyright (C) 2006, 2007 David S. Miller (davem@davemloft.net) 3 + * Copyright (C) 2006, 2007, 2008 David S. Miller (davem@davemloft.net) 4 4 */ 5 5 6 6 #include <linux/kernel.h> ··· 89 89 return 0; 90 90 } 91 91 92 + static inline void iommu_batch_new_entry(unsigned long entry) 93 + { 94 + struct iommu_batch *p = &__get_cpu_var(iommu_batch); 95 + 96 + if (p->entry + p->npages == entry) 97 + return; 98 + if (p->entry != ~0UL) 99 + iommu_batch_flush(p); 100 + p->entry = entry; 101 + } 102 + 92 103 /* Interrupts must be disabled. */ 93 104 static inline long iommu_batch_add(u64 phys_page) 94 105 { ··· 122 111 BUG_ON(p->npages >= PGLIST_NENTS); 123 112 124 113 return iommu_batch_flush(p); 125 - } 126 - 127 - static long arena_alloc(struct iommu_arena *arena, unsigned long npages) 128 - { 129 - unsigned long n, i, start, end, limit; 130 - int pass; 131 - 132 - limit = arena->limit; 133 - start = arena->hint; 134 - pass = 0; 135 - 136 - again: 137 - n = find_next_zero_bit(arena->map, limit, start); 138 - end = n + npages; 139 - if (unlikely(end >= limit)) { 140 - if (likely(pass < 1)) { 141 - limit = start; 142 - start = 0; 143 - pass++; 144 - goto again; 145 - } else { 146 - /* Scanned the whole thing, give up. */ 147 - return -1; 148 - } 149 - } 150 - 151 - for (i = n; i < end; i++) { 152 - if (test_bit(i, arena->map)) { 153 - start = i + 1; 154 - goto again; 155 - } 156 - } 157 - 158 - for (i = n; i < end; i++) 159 - __set_bit(i, arena->map); 160 - 161 - arena->hint = end; 162 - 163 - return n; 164 - } 165 - 166 - static void arena_free(struct iommu_arena *arena, unsigned long base, 167 - unsigned long npages) 168 - { 169 - unsigned long i; 170 - 171 - for (i = base; i < (base + npages); i++) 172 - __clear_bit(i, arena->map); 173 114 } 174 115 175 116 static void *dma_4v_alloc_coherent(struct device *dev, size_t size, ··· 148 185 iommu = dev->archdata.iommu; 149 186 150 187 spin_lock_irqsave(&iommu->lock, flags); 151 - entry = arena_alloc(&iommu->arena, npages); 188 + entry = iommu_range_alloc(dev, iommu, npages, NULL); 152 189 spin_unlock_irqrestore(&iommu->lock, flags); 153 190 154 - if (unlikely(entry < 0L)) 155 - goto arena_alloc_fail; 191 + if (unlikely(entry == DMA_ERROR_CODE)) 192 + goto range_alloc_fail; 156 193 157 194 *dma_addrp = (iommu->page_table_map_base + 158 195 (entry << IO_PAGE_SHIFT)); ··· 182 219 iommu_map_fail: 183 220 /* Interrupts are disabled. */ 184 221 spin_lock(&iommu->lock); 185 - arena_free(&iommu->arena, entry, npages); 222 + iommu_range_free(iommu, *dma_addrp, npages); 186 223 spin_unlock_irqrestore(&iommu->lock, flags); 187 224 188 - arena_alloc_fail: 225 + range_alloc_fail: 189 226 free_pages(first_page, order); 190 227 return NULL; 191 228 } ··· 206 243 207 244 spin_lock_irqsave(&iommu->lock, flags); 208 245 209 - arena_free(&iommu->arena, entry, npages); 246 + iommu_range_free(iommu, dvma, npages); 210 247 211 248 do { 212 249 unsigned long num; ··· 244 281 npages >>= IO_PAGE_SHIFT; 245 282 246 283 spin_lock_irqsave(&iommu->lock, flags); 247 - entry = arena_alloc(&iommu->arena, npages); 284 + entry = iommu_range_alloc(dev, iommu, npages, NULL); 248 285 spin_unlock_irqrestore(&iommu->lock, flags); 249 286 250 - if (unlikely(entry < 0L)) 287 + if (unlikely(entry == DMA_ERROR_CODE)) 251 288 goto bad; 252 289 253 290 bus_addr = (iommu->page_table_map_base + ··· 282 319 iommu_map_fail: 283 320 /* Interrupts are disabled. */ 284 321 spin_lock(&iommu->lock); 285 - arena_free(&iommu->arena, entry, npages); 322 + iommu_range_free(iommu, bus_addr, npages); 286 323 spin_unlock_irqrestore(&iommu->lock, flags); 287 324 288 325 return DMA_ERROR_CODE; ··· 313 350 314 351 spin_lock_irqsave(&iommu->lock, flags); 315 352 316 - entry = (bus_addr - iommu->page_table_map_base) >> IO_PAGE_SHIFT; 317 - arena_free(&iommu->arena, entry, npages); 353 + iommu_range_free(iommu, bus_addr, npages); 318 354 355 + entry = (bus_addr - iommu->page_table_map_base) >> IO_PAGE_SHIFT; 319 356 do { 320 357 unsigned long num; 321 358 ··· 331 368 static int dma_4v_map_sg(struct device *dev, struct scatterlist *sglist, 332 369 int nelems, enum dma_data_direction direction) 333 370 { 334 - unsigned long flags, npages, i, prot; 335 - struct scatterlist *sg; 371 + struct scatterlist *s, *outs, *segstart; 372 + unsigned long flags, handle, prot; 373 + dma_addr_t dma_next = 0, dma_addr; 374 + unsigned int max_seg_size; 375 + int outcount, incount, i; 336 376 struct iommu *iommu; 337 - long entry, err; 338 - u32 dma_base; 377 + long err; 339 378 340 - /* Fast path single entry scatterlists. */ 341 - if (nelems == 1) { 342 - sglist->dma_address = 343 - dma_4v_map_single(dev, sg_virt(sglist), 344 - sglist->length, direction); 345 - if (unlikely(sglist->dma_address == DMA_ERROR_CODE)) 346 - return 0; 347 - sglist->dma_length = sglist->length; 348 - return 1; 349 - } 379 + BUG_ON(direction == DMA_NONE); 350 380 351 381 iommu = dev->archdata.iommu; 382 + if (nelems == 0 || !iommu) 383 + return 0; 352 384 353 - if (unlikely(direction == DMA_NONE)) 354 - goto bad; 355 - 356 - npages = calc_npages(sglist, nelems); 357 - 358 - spin_lock_irqsave(&iommu->lock, flags); 359 - entry = arena_alloc(&iommu->arena, npages); 360 - spin_unlock_irqrestore(&iommu->lock, flags); 361 - 362 - if (unlikely(entry < 0L)) 363 - goto bad; 364 - 365 - dma_base = iommu->page_table_map_base + 366 - (entry << IO_PAGE_SHIFT); 367 - 368 385 prot = HV_PCI_MAP_ATTR_READ; 369 386 if (direction != DMA_TO_DEVICE) 370 387 prot |= HV_PCI_MAP_ATTR_WRITE; 371 388 372 - local_irq_save(flags); 389 + outs = s = segstart = &sglist[0]; 390 + outcount = 1; 391 + incount = nelems; 392 + handle = 0; 373 393 374 - iommu_batch_start(dev, prot, entry); 394 + /* Init first segment length for backout at failure */ 395 + outs->dma_length = 0; 375 396 376 - for_each_sg(sglist, sg, nelems, i) { 377 - unsigned long paddr = SG_ENT_PHYS_ADDRESS(sg); 378 - unsigned long slen = sg->length; 379 - unsigned long this_npages; 397 + spin_lock_irqsave(&iommu->lock, flags); 380 398 381 - this_npages = iommu_num_pages(paddr, slen); 399 + iommu_batch_start(dev, prot, ~0UL); 382 400 383 - sg->dma_address = dma_base | (paddr & ~IO_PAGE_MASK); 384 - sg->dma_length = slen; 401 + max_seg_size = dma_get_max_seg_size(dev); 402 + for_each_sg(sglist, s, nelems, i) { 403 + unsigned long paddr, npages, entry, slen; 385 404 386 - paddr &= IO_PAGE_MASK; 387 - while (this_npages--) { 388 - err = iommu_batch_add(paddr); 389 - if (unlikely(err < 0L)) { 390 - local_irq_restore(flags); 391 - goto iommu_map_failed; 392 - } 393 - 394 - paddr += IO_PAGE_SIZE; 395 - dma_base += IO_PAGE_SIZE; 405 + slen = s->length; 406 + /* Sanity check */ 407 + if (slen == 0) { 408 + dma_next = 0; 409 + continue; 396 410 } 411 + /* Allocate iommu entries for that segment */ 412 + paddr = (unsigned long) SG_ENT_PHYS_ADDRESS(s); 413 + npages = iommu_num_pages(paddr, slen); 414 + entry = iommu_range_alloc(dev, iommu, npages, &handle); 415 + 416 + /* Handle failure */ 417 + if (unlikely(entry == DMA_ERROR_CODE)) { 418 + if (printk_ratelimit()) 419 + printk(KERN_INFO "iommu_alloc failed, iommu %p paddr %lx" 420 + " npages %lx\n", iommu, paddr, npages); 421 + goto iommu_map_failed; 422 + } 423 + 424 + iommu_batch_new_entry(entry); 425 + 426 + /* Convert entry to a dma_addr_t */ 427 + dma_addr = iommu->page_table_map_base + 428 + (entry << IO_PAGE_SHIFT); 429 + dma_addr |= (s->offset & ~IO_PAGE_MASK); 430 + 431 + /* Insert into HW table */ 432 + paddr &= IO_PAGE_MASK; 433 + while (npages--) { 434 + err = iommu_batch_add(paddr); 435 + if (unlikely(err < 0L)) 436 + goto iommu_map_failed; 437 + paddr += IO_PAGE_SIZE; 438 + } 439 + 440 + /* If we are in an open segment, try merging */ 441 + if (segstart != s) { 442 + /* We cannot merge if: 443 + * - allocated dma_addr isn't contiguous to previous allocation 444 + */ 445 + if ((dma_addr != dma_next) || 446 + (outs->dma_length + s->length > max_seg_size)) { 447 + /* Can't merge: create a new segment */ 448 + segstart = s; 449 + outcount++; 450 + outs = sg_next(outs); 451 + } else { 452 + outs->dma_length += s->length; 453 + } 454 + } 455 + 456 + if (segstart == s) { 457 + /* This is a new segment, fill entries */ 458 + outs->dma_address = dma_addr; 459 + outs->dma_length = slen; 460 + } 461 + 462 + /* Calculate next page pointer for contiguous check */ 463 + dma_next = dma_addr + slen; 397 464 } 398 465 399 466 err = iommu_batch_end(); 400 467 401 - local_irq_restore(flags); 402 - 403 468 if (unlikely(err < 0L)) 404 469 goto iommu_map_failed; 405 470 406 - return nelems; 471 + spin_unlock_irqrestore(&iommu->lock, flags); 407 472 408 - bad: 409 - if (printk_ratelimit()) 410 - WARN_ON(1); 411 - return 0; 473 + if (outcount < incount) { 474 + outs = sg_next(outs); 475 + outs->dma_address = DMA_ERROR_CODE; 476 + outs->dma_length = 0; 477 + } 478 + 479 + return outcount; 412 480 413 481 iommu_map_failed: 414 - spin_lock_irqsave(&iommu->lock, flags); 415 - arena_free(&iommu->arena, entry, npages); 482 + for_each_sg(sglist, s, nelems, i) { 483 + if (s->dma_length != 0) { 484 + unsigned long vaddr, npages; 485 + 486 + vaddr = s->dma_address & IO_PAGE_MASK; 487 + npages = iommu_num_pages(s->dma_address, s->dma_length); 488 + iommu_range_free(iommu, vaddr, npages); 489 + /* XXX demap? XXX */ 490 + s->dma_address = DMA_ERROR_CODE; 491 + s->dma_length = 0; 492 + } 493 + if (s == outs) 494 + break; 495 + } 416 496 spin_unlock_irqrestore(&iommu->lock, flags); 417 497 418 498 return 0; ··· 464 458 static void dma_4v_unmap_sg(struct device *dev, struct scatterlist *sglist, 465 459 int nelems, enum dma_data_direction direction) 466 460 { 467 - unsigned long flags, npages; 468 461 struct pci_pbm_info *pbm; 469 - u32 devhandle, bus_addr; 462 + struct scatterlist *sg; 470 463 struct iommu *iommu; 471 - long entry; 464 + unsigned long flags; 465 + u32 devhandle; 472 466 473 - if (unlikely(direction == DMA_NONE)) { 474 - if (printk_ratelimit()) 475 - WARN_ON(1); 476 - } 467 + BUG_ON(direction == DMA_NONE); 477 468 478 469 iommu = dev->archdata.iommu; 479 470 pbm = dev->archdata.host_controller; 480 471 devhandle = pbm->devhandle; 481 472 482 - bus_addr = sglist->dma_address & IO_PAGE_MASK; 483 - 484 - npages = calc_npages(sglist, nelems); 485 - 486 - entry = ((bus_addr - iommu->page_table_map_base) >> IO_PAGE_SHIFT); 487 - 488 473 spin_lock_irqsave(&iommu->lock, flags); 489 474 490 - arena_free(&iommu->arena, entry, npages); 475 + sg = sglist; 476 + while (nelems--) { 477 + dma_addr_t dma_handle = sg->dma_address; 478 + unsigned int len = sg->dma_length; 479 + unsigned long npages, entry; 491 480 492 - do { 493 - unsigned long num; 481 + if (!len) 482 + break; 483 + npages = iommu_num_pages(dma_handle, len); 484 + iommu_range_free(iommu, dma_handle, npages); 494 485 495 - num = pci_sun4v_iommu_demap(devhandle, HV_PCI_TSBID(0, entry), 496 - npages); 497 - entry += num; 498 - npages -= num; 499 - } while (npages != 0); 486 + entry = ((dma_handle - iommu->page_table_map_base) >> IO_PAGE_SHIFT); 487 + while (npages) { 488 + unsigned long num; 489 + 490 + num = pci_sun4v_iommu_demap(devhandle, HV_PCI_TSBID(0, entry), 491 + npages); 492 + entry += num; 493 + npages -= num; 494 + } 495 + 496 + sg = sg_next(sg); 497 + } 500 498 501 499 spin_unlock_irqrestore(&iommu->lock, flags); 502 500 }
+19 -12
include/asm-sparc/a.out.h
··· 1 - /* $Id: a.out.h,v 1.13 2000/01/09 10:46:53 anton Exp $ */ 2 1 #ifndef __SPARC_A_OUT_H__ 3 2 #define __SPARC_A_OUT_H__ 4 3 5 4 #define SPARC_PGSIZE 0x2000 /* Thanks to the sun4 architecture... */ 6 5 #define SEGMENT_SIZE SPARC_PGSIZE /* whee... */ 7 6 7 + #ifndef __ASSEMBLY__ 8 + 8 9 struct exec { 9 10 unsigned char a_dynamic:1; /* A __DYNAMIC is in this image */ 10 11 unsigned char a_toolversion:7; 11 12 unsigned char a_machtype; 12 13 unsigned short a_info; 13 - unsigned long a_text; /* length of text, in bytes */ 14 - unsigned long a_data; /* length of data, in bytes */ 15 - unsigned long a_bss; /* length of bss, in bytes */ 16 - unsigned long a_syms; /* length of symbol table, in bytes */ 17 - unsigned long a_entry; /* where program begins */ 18 - unsigned long a_trsize; 19 - unsigned long a_drsize; 14 + unsigned int a_text; /* length of text, in bytes */ 15 + unsigned int a_data; /* length of data, in bytes */ 16 + unsigned int a_bss; /* length of bss, in bytes */ 17 + unsigned int a_syms; /* length of symbol table, in bytes */ 18 + unsigned int a_entry; /* where program begins */ 19 + unsigned int a_trsize; 20 + unsigned int a_drsize; 20 21 }; 22 + 23 + #endif /* !__ASSEMBLY__ */ 21 24 22 25 /* Where in the file does the text information begin? */ 23 26 #define N_TXTOFF(x) (N_MAGIC(x) == ZMAGIC ? 0 : sizeof (struct exec)) ··· 31 28 (x).a_drsize) 32 29 33 30 /* Where does text segment go in memory after being loaded? */ 34 - #define N_TXTADDR(x) (((N_MAGIC(x) == ZMAGIC) && \ 31 + #define N_TXTADDR(x) (unsigned long)(((N_MAGIC(x) == ZMAGIC) && \ 35 32 ((x).a_entry < SPARC_PGSIZE)) ? \ 36 33 0 : SPARC_PGSIZE) 37 34 38 35 /* And same for the data segment.. */ 39 36 #define N_DATADDR(x) (N_MAGIC(x)==OMAGIC ? \ 40 37 (N_TXTADDR(x) + (x).a_text) \ 41 - : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x)))) 38 + : (unsigned long) (_N_SEGMENT_ROUND (_N_TXTENDADDR(x)))) 42 39 43 40 #define N_TRSIZE(a) ((a).a_trsize) 44 41 #define N_DRSIZE(a) ((a).a_drsize) 45 42 #define N_SYMSIZE(a) ((a).a_syms) 43 + 44 + #ifndef __ASSEMBLY__ 46 45 47 46 /* 48 47 * Sparc relocation types ··· 82 77 */ 83 78 struct relocation_info /* used when header.a_machtype == M_SPARC */ 84 79 { 85 - unsigned long r_address; /* relocation addr */ 80 + unsigned int r_address; /* relocation addr */ 86 81 unsigned int r_index:24; /* segment index or symbol index */ 87 82 unsigned int r_extern:1; /* if F, r_index==SEG#; if T, SYM idx */ 88 83 unsigned int r_pad:2; /* <unused> */ 89 84 enum reloc_type r_type:5; /* type of relocation to perform */ 90 - long r_addend; /* addend for relocation value */ 85 + int r_addend; /* addend for relocation value */ 91 86 }; 92 87 93 88 #define N_RELOCATION_INFO_DECLARED 1 89 + 90 + #endif /* !(__ASSEMBLY__) */ 94 91 95 92 #endif /* __SPARC_A_OUT_H__ */
+1 -1
include/asm-sparc/bpp.h
··· 17 17 * with compliant or compatible devices. It will use whatever features 18 18 * the device supports, prefering those that are typically faster. 19 19 * 20 - * When the device is opened, it is left in COMPATABILITY mode, and 20 + * When the device is opened, it is left in COMPATIBILITY mode, and 21 21 * writes work like any printer device. The driver only attempt to 22 22 * negotiate 1284 modes when needed so that plugs can be pulled, 23 23 * switch boxes switched, etc., without disrupting things. It will
-94
include/asm-sparc/bsderrno.h
··· 1 - /* $Id: bsderrno.h,v 1.3 1996/04/25 06:12:47 davem Exp $ 2 - * bsderrno.h: Error numbers for NetBSD binary compatibility 3 - * 4 - * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 5 - */ 6 - 7 - #ifndef _SPARC_BSDERRNO_H 8 - #define _SPARC_BSDERRNO_H 9 - 10 - #define BSD_EPERM 1 /* Operation not permitted */ 11 - #define BSD_ENOENT 2 /* No such file or directory */ 12 - #define BSD_ESRCH 3 /* No such process */ 13 - #define BSD_EINTR 4 /* Interrupted system call */ 14 - #define BSD_EIO 5 /* Input/output error */ 15 - #define BSD_ENXIO 6 /* Device not configured */ 16 - #define BSD_E2BIG 7 /* Argument list too long */ 17 - #define BSD_ENOEXEC 8 /* Exec format error */ 18 - #define BSD_EBADF 9 /* Bad file descriptor */ 19 - #define BSD_ECHILD 10 /* No child processes */ 20 - #define BSD_EDEADLK 11 /* Resource deadlock avoided */ 21 - #define BSD_ENOMEM 12 /* Cannot allocate memory */ 22 - #define BSD_EACCES 13 /* Permission denied */ 23 - #define BSD_EFAULT 14 /* Bad address */ 24 - #define BSD_ENOTBLK 15 /* Block device required */ 25 - #define BSD_EBUSY 16 /* Device busy */ 26 - #define BSD_EEXIST 17 /* File exists */ 27 - #define BSD_EXDEV 18 /* Cross-device link */ 28 - #define BSD_ENODEV 19 /* Operation not supported by device */ 29 - #define BSD_ENOTDIR 20 /* Not a directory */ 30 - #define BSD_EISDIR 21 /* Is a directory */ 31 - #define BSD_EINVAL 22 /* Invalid argument */ 32 - #define BSD_ENFILE 23 /* Too many open files in system */ 33 - #define BSD_EMFILE 24 /* Too many open files */ 34 - #define BSD_ENOTTY 25 /* Inappropriate ioctl for device */ 35 - #define BSD_ETXTBSY 26 /* Text file busy */ 36 - #define BSD_EFBIG 27 /* File too large */ 37 - #define BSD_ENOSPC 28 /* No space left on device */ 38 - #define BSD_ESPIPE 29 /* Illegal seek */ 39 - #define BSD_EROFS 30 /* Read-only file system */ 40 - #define BSD_EMLINK 31 /* Too many links */ 41 - #define BSD_EPIPE 32 /* Broken pipe */ 42 - #define BSD_EDOM 33 /* Numerical argument out of domain */ 43 - #define BSD_ERANGE 34 /* Result too large */ 44 - #define BSD_EAGAIN 35 /* Resource temporarily unavailable */ 45 - #define BSD_EWOULDBLOCK EAGAIN /* Operation would block */ 46 - #define BSD_EINPROGRESS 36 /* Operation now in progress */ 47 - #define BSD_EALREADY 37 /* Operation already in progress */ 48 - #define BSD_ENOTSOCK 38 /* Socket operation on non-socket */ 49 - #define BSD_EDESTADDRREQ 39 /* Destination address required */ 50 - #define BSD_EMSGSIZE 40 /* Message too long */ 51 - #define BSD_EPROTOTYPE 41 /* Protocol wrong type for socket */ 52 - #define BSD_ENOPROTOOPT 42 /* Protocol not available */ 53 - #define BSD_EPROTONOSUPPORT 43 /* Protocol not supported */ 54 - #define BSD_ESOCKTNOSUPPORT 44 /* Socket type not supported */ 55 - #define BSD_EOPNOTSUPP 45 /* Operation not supported */ 56 - #define BSD_EPFNOSUPPORT 46 /* Protocol family not supported */ 57 - #define BSD_EAFNOSUPPORT 47 /* Address family not supported by protocol family */ 58 - #define BSD_EADDRINUSE 48 /* Address already in use */ 59 - #define BSD_EADDRNOTAVAIL 49 /* Can't assign requested address */ 60 - #define BSD_ENETDOWN 50 /* Network is down */ 61 - #define BSD_ENETUNREACH 51 /* Network is unreachable */ 62 - #define BSD_ENETRESET 52 /* Network dropped connection on reset */ 63 - #define BSD_ECONNABORTED 53 /* Software caused connection abort */ 64 - #define BSD_ECONNRESET 54 /* Connection reset by peer */ 65 - #define BSD_ENOBUFS 55 /* No buffer space available */ 66 - #define BSD_EISCONN 56 /* Socket is already connected */ 67 - #define BSD_ENOTCONN 57 /* Socket is not connected */ 68 - #define BSD_ESHUTDOWN 58 /* Can't send after socket shutdown */ 69 - #define BSD_ETOOMANYREFS 59 /* Too many references: can't splice */ 70 - #define BSD_ETIMEDOUT 60 /* Operation timed out */ 71 - #define BSD_ECONNREFUSED 61 /* Connection refused */ 72 - #define BSD_ELOOP 62 /* Too many levels of symbolic links */ 73 - #define BSD_ENAMETOOLONG 63 /* File name too long */ 74 - #define BSD_EHOSTDOWN 64 /* Host is down */ 75 - #define BSD_EHOSTUNREACH 65 /* No route to host */ 76 - #define BSD_ENOTEMPTY 66 /* Directory not empty */ 77 - #define BSD_EPROCLIM 67 /* Too many processes */ 78 - #define BSD_EUSERS 68 /* Too many users */ 79 - #define BSD_EDQUOT 69 /* Disc quota exceeded */ 80 - #define BSD_ESTALE 70 /* Stale NFS file handle */ 81 - #define BSD_EREMOTE 71 /* Too many levels of remote in path */ 82 - #define BSD_EBADRPC 72 /* RPC struct is bad */ 83 - #define BSD_ERPCMISMATCH 73 /* RPC version wrong */ 84 - #define BSD_EPROGUNAVAIL 74 /* RPC prog. not avail */ 85 - #define BSD_EPROGMISMATCH 75 /* Program version wrong */ 86 - #define BSD_EPROCUNAVAIL 76 /* Bad procedure for program */ 87 - #define BSD_ENOLCK 77 /* No locks available */ 88 - #define BSD_ENOSYS 78 /* Function not implemented */ 89 - #define BSD_EFTYPE 79 /* Inappropriate file type or format */ 90 - #define BSD_EAUTH 80 /* Authentication error */ 91 - #define BSD_ENEEDAUTH 81 /* Need authenticator */ 92 - #define BSD_ELAST 81 /* Must be equal largest errno */ 93 - 94 - #endif /* !(_SPARC_BSDERRNO_H) */
+3 -15
include/asm-sparc/bug.h
··· 2 2 #define _SPARC_BUG_H 3 3 4 4 #ifdef CONFIG_BUG 5 - /* Only use the inline asm until a gcc release that can handle __builtin_trap 6 - * -rob 2003-06-25 7 - * 8 - * gcc-3.3.1 and later will be OK -DaveM 9 - */ 10 - #if (__GNUC__ > 3) || \ 11 - (__GNUC__ == 3 && __GNUC_MINOR__ > 3) || \ 12 - (__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 4) 13 - #define __bug_trap() __builtin_trap() 14 - #else 15 - #define __bug_trap() \ 16 - __asm__ __volatile__ ("t 0x5\n\t" : : ) 17 - #endif 5 + #include <linux/compiler.h> 18 6 19 7 #ifdef CONFIG_DEBUG_BUGVERBOSE 20 8 extern void do_BUG(const char *file, int line); 21 9 #define BUG() do { \ 22 10 do_BUG(__FILE__, __LINE__); \ 23 - __bug_trap(); \ 11 + __builtin_trap(); \ 24 12 } while (0) 25 13 #else 26 - #define BUG() __bug_trap() 14 + #define BUG() __builtin_trap() 27 15 #endif 28 16 29 17 #define HAVE_ARCH_BUG
+13 -5
include/asm-sparc/bugs.h
··· 1 - /* $Id: bugs.h,v 1.1 1996/12/26 13:25:20 davem Exp $ 2 - * include/asm-sparc/bugs.h: Sparc probes for various bugs. 1 + /* include/asm-sparc/bugs.h: Sparc probes for various bugs. 3 2 * 4 - * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) 3 + * Copyright (C) 1996, 2007 David S. Miller (davem@davemloft.net) 5 4 */ 6 5 6 + #ifdef CONFIG_SPARC32 7 7 #include <asm/cpudata.h> 8 + #endif 9 + 10 + #ifdef CONFIG_SPARC64 11 + #include <asm/sstate.h> 12 + #endif 8 13 9 14 extern unsigned long loops_per_jiffy; 10 15 11 - static void check_bugs(void) 16 + static void __init check_bugs(void) 12 17 { 13 - #ifndef CONFIG_SMP 18 + #if defined(CONFIG_SPARC32) && !defined(CONFIG_SMP) 14 19 cpu_data(0).udelay_val = loops_per_jiffy; 20 + #endif 21 + #ifdef CONFIG_SPARC64 22 + sstate_running(); 15 23 #endif 16 24 }
+47 -4
include/asm-sparc/byteorder.h
··· 1 - /* $Id: byteorder.h,v 1.15 1997/12/16 19:20:44 davem Exp $ */ 2 1 #ifndef _SPARC_BYTEORDER_H 3 2 #define _SPARC_BYTEORDER_H 4 3 5 4 #include <asm/types.h> 5 + #include <asm/asi.h> 6 6 7 - #if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__) 8 - # define __BYTEORDER_HAS_U64__ 9 - # define __SWAB_64_THRU_32__ 7 + #ifdef __GNUC__ 8 + 9 + #ifdef CONFIG_SPARC32 10 + #define __SWAB_64_THRU_32__ 11 + #endif 12 + 13 + #ifdef CONFIG_SPARC64 14 + 15 + static inline __u16 ___arch__swab16p(const __u16 *addr) 16 + { 17 + __u16 ret; 18 + 19 + __asm__ __volatile__ ("lduha [%1] %2, %0" 20 + : "=r" (ret) 21 + : "r" (addr), "i" (ASI_PL)); 22 + return ret; 23 + } 24 + 25 + static inline __u32 ___arch__swab32p(const __u32 *addr) 26 + { 27 + __u32 ret; 28 + 29 + __asm__ __volatile__ ("lduwa [%1] %2, %0" 30 + : "=r" (ret) 31 + : "r" (addr), "i" (ASI_PL)); 32 + return ret; 33 + } 34 + 35 + static inline __u64 ___arch__swab64p(const __u64 *addr) 36 + { 37 + __u64 ret; 38 + 39 + __asm__ __volatile__ ("ldxa [%1] %2, %0" 40 + : "=r" (ret) 41 + : "r" (addr), "i" (ASI_PL)); 42 + return ret; 43 + } 44 + 45 + #define __arch__swab16p(x) ___arch__swab16p(x) 46 + #define __arch__swab32p(x) ___arch__swab32p(x) 47 + #define __arch__swab64p(x) ___arch__swab64p(x) 48 + 49 + #endif /* CONFIG_SPARC64 */ 50 + 51 + #define __BYTEORDER_HAS_U64__ 52 + 10 53 #endif 11 54 12 55 #include <linux/byteorder/big_endian.h>
+15 -6
include/asm-sparc/cache.h
··· 1 - /* $Id: cache.h,v 1.9 1999/08/14 03:51:58 anton Exp $ 2 - * cache.h: Cache specific code for the Sparc. These include flushing 1 + /* cache.h: Cache specific code for the Sparc. These include flushing 3 2 * and direct tag/data line access. 4 3 * 5 - * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 4 + * Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net) 6 5 */ 7 6 8 7 #ifndef _SPARC_CACHE_H 9 8 #define _SPARC_CACHE_H 10 9 11 - #include <asm/asi.h> 12 - 13 10 #define L1_CACHE_SHIFT 5 14 11 #define L1_CACHE_BYTES 32 15 12 #define L1_CACHE_ALIGN(x) ((((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))) 16 13 17 - #define SMP_CACHE_BYTES 32 14 + #ifdef CONFIG_SPARC32 15 + #define SMP_CACHE_BYTES_SHIFT 5 16 + #else 17 + #define SMP_CACHE_BYTES_SHIFT 6 18 + #endif 19 + 20 + #define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT) 21 + 22 + #define __read_mostly __attribute__((__section__(".data.read_mostly"))) 23 + 24 + #ifdef CONFIG_SPARC32 25 + #include <asm/asi.h> 18 26 19 27 /* Direct access to the instruction cache is provided through and 20 28 * alternate address space. The IDC bit must be off in the ICCR on ··· 133 125 "r" (addr), "i" (ASI_M_FLUSH_USER) : 134 126 "memory"); 135 127 } 128 + #endif /* CONFIG_SPARC32 */ 136 129 137 130 #endif /* !(_SPARC_CACHE_H) */
+17 -14
include/asm-sparc/current.h
··· 1 - /* 2 - * include/asm-sparc/current.h 1 + /* include/asm-sparc/current.h 3 2 * 4 3 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation 5 4 * Copyright (C) 2002 Pete Zaitcev (zaitcev@yahoo.com) 5 + * Copyright (C) 2007 David S. Miller (davem@davemloft.net) 6 6 * 7 7 * Derived from "include/asm-s390/current.h" by 8 8 * Martin Schwidefsky (schwidefsky@de.ibm.com) 9 9 * Derived from "include/asm-i386/current.h" 10 - */ 11 - #ifndef _ASM_CURRENT_H 12 - #define _ASM_CURRENT_H 13 - 14 - /* 15 - * At the sparc64 DaveM keeps current_thread_info in %g4. 16 - * We might want to consider doing the same to shave a few cycles. 17 - */ 10 + */ 11 + #ifndef _SPARC_CURRENT_H 12 + #define _SPARC_CURRENT_H 18 13 19 14 #include <linux/thread_info.h> 20 15 21 - struct task_struct; 16 + #ifdef CONFIG_SPARC64 17 + register struct task_struct *current asm("g4"); 18 + #endif 22 19 23 - /* Two stage process (inline + #define) for type-checking. */ 24 - /* We also obfuscate get_current() to check if anyone used that by mistake. */ 20 + #ifdef CONFIG_SPARC32 21 + /* We might want to consider using %g4 like sparc64 to shave a few cycles. 22 + * 23 + * Two stage process (inline + #define) for type-checking. 24 + * We also obfuscate get_current() to check if anyone used that by mistake. 25 + */ 26 + struct task_struct; 25 27 static inline struct task_struct *__get_current(void) 26 28 { 27 29 return current_thread_info()->task; 28 30 } 29 31 #define current __get_current() 32 + #endif 30 33 31 - #endif /* !(_ASM_CURRENT_H) */ 34 + #endif /* !(_SPARC_CURRENT_H) */
-2
include/asm-sparc/device.h
··· 19 19 }; 20 20 21 21 #endif /* _ASM_SPARC_DEVICE_H */ 22 - 23 -
-1
include/asm-sparc/errno.h
··· 1 - /* $Id: errno.h,v 1.6 1997/04/15 09:03:38 davem Exp $ */ 2 1 #ifndef _SPARC_ERRNO_H 3 2 #define _SPARC_ERRNO_H 4 3
+12 -4
include/asm-sparc/fb.h
··· 1 - #ifndef _ASM_FB_H_ 2 - #define _ASM_FB_H_ 1 + #ifndef _SPARC_FB_H_ 2 + #define _SPARC_FB_H_ 3 3 #include <linux/fb.h> 4 + #include <linux/fs.h> 5 + #include <asm/page.h> 4 6 #include <asm/prom.h> 5 7 6 - #define fb_pgprotect(...) do {} while (0) 8 + static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, 9 + unsigned long off) 10 + { 11 + #ifdef CONFIG_SPARC64 12 + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); 13 + #endif 14 + } 7 15 8 16 static inline int fb_is_primary_device(struct fb_info *info) 9 17 { ··· 26 18 return 0; 27 19 } 28 20 29 - #endif /* _ASM_FB_H_ */ 21 + #endif /* _SPARC_FB_H_ */
-5
include/asm-sparc/of_platform.h
··· 21 21 22 22 #define of_bus_type of_platform_bus_type /* for compatibility */ 23 23 24 - extern struct of_device *of_platform_device_create(struct device_node *np, 25 - const char *bus_id, 26 - struct device *parent, 27 - struct bus_type *bus); 28 - 29 24 #endif /* _ASM_SPARC_OF_PLATFORM_H */
+10 -1
include/asm-sparc/prom.h
··· 9 9 * Copyright (C) 1996-2005 Paul Mackerras. 10 10 * 11 11 * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp. 12 - * Updates for SPARC32 by David S. Miller 12 + * Updates for SPARC by David S. Miller 13 13 * 14 14 * This program is free software; you can redistribute it and/or 15 15 * modify it under the terms of the GNU General Public License ··· 39 39 unsigned int unique_id; 40 40 }; 41 41 42 + struct of_irq_controller; 42 43 struct device_node { 43 44 const char *name; 44 45 const char *type; ··· 59 58 unsigned long _flags; 60 59 void *data; 61 60 unsigned int unique_id; 61 + 62 + struct of_irq_controller *irq_trans; 63 + }; 64 + 65 + struct of_irq_controller { 66 + unsigned int (*irq_build)(struct device_node *, unsigned int, void *); 67 + void *data; 62 68 }; 63 69 64 70 #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) 65 71 #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) 66 72 73 + extern struct device_node *of_find_node_by_cpuid(int cpuid); 67 74 extern int of_set_property(struct device_node *node, const char *name, void *val, int len); 68 75 extern int of_getintprop_default(struct device_node *np, 69 76 const char *name,
+1 -98
include/asm-sparc64/a.out.h
··· 1 - /* $Id: a.out.h,v 1.8 2002/02/09 19:49:31 davem Exp $ */ 2 - #ifndef __SPARC64_A_OUT_H__ 3 - #define __SPARC64_A_OUT_H__ 4 - 5 - #define SPARC_PGSIZE 0x2000 /* Thanks to the sun4 architecture... */ 6 - #define SEGMENT_SIZE SPARC_PGSIZE /* whee... */ 7 - 8 - #ifndef __ASSEMBLY__ 9 - 10 - struct exec { 11 - unsigned char a_dynamic:1; /* A __DYNAMIC is in this image */ 12 - unsigned char a_toolversion:7; 13 - unsigned char a_machtype; 14 - unsigned short a_info; 15 - unsigned int a_text; /* length of text, in bytes */ 16 - unsigned int a_data; /* length of data, in bytes */ 17 - unsigned int a_bss; /* length of bss, in bytes */ 18 - unsigned int a_syms; /* length of symbol table, in bytes */ 19 - unsigned int a_entry; /* where program begins */ 20 - unsigned int a_trsize; 21 - unsigned int a_drsize; 22 - }; 23 - 24 - #endif /* !__ASSEMBLY__ */ 25 - 26 - /* Where in the file does the text information begin? */ 27 - #define N_TXTOFF(x) (N_MAGIC(x) == ZMAGIC ? 0 : sizeof (struct exec)) 28 - 29 - /* Where do the Symbols start? */ 30 - #define N_SYMOFF(x) (N_TXTOFF(x) + (x).a_text + \ 31 - (x).a_data + (x).a_trsize + \ 32 - (x).a_drsize) 33 - 34 - /* Where does text segment go in memory after being loaded? */ 35 - #define N_TXTADDR(x) (unsigned long)(((N_MAGIC(x) == ZMAGIC) && \ 36 - ((x).a_entry < SPARC_PGSIZE)) ? \ 37 - 0 : SPARC_PGSIZE) 38 - 39 - /* And same for the data segment.. */ 40 - #define N_DATADDR(x) (N_MAGIC(x)==OMAGIC ? \ 41 - (N_TXTADDR(x) + (x).a_text) \ 42 - : (unsigned long)(_N_SEGMENT_ROUND (_N_TXTENDADDR(x)))) 43 - 44 - #define N_TRSIZE(a) ((a).a_trsize) 45 - #define N_DRSIZE(a) ((a).a_drsize) 46 - #define N_SYMSIZE(a) ((a).a_syms) 47 - 48 - #ifndef __ASSEMBLY__ 49 - 50 - /* 51 - * Sparc relocation types 52 - */ 53 - enum reloc_type 54 - { 55 - RELOC_8, 56 - RELOC_16, 57 - RELOC_32, /* simplest relocs */ 58 - RELOC_DISP8, 59 - RELOC_DISP16, 60 - RELOC_DISP32, /* Disp's (pc-rel) */ 61 - RELOC_WDISP30, 62 - RELOC_WDISP22, /* SR word disp's */ 63 - RELOC_HI22, 64 - RELOC_22, /* SR 22-bit relocs */ 65 - RELOC_13, 66 - RELOC_LO10, /* SR 13&10-bit relocs */ 67 - RELOC_SFA_BASE, 68 - RELOC_SFA_OFF13, /* SR S.F.A. relocs */ 69 - RELOC_BASE10, 70 - RELOC_BASE13, 71 - RELOC_BASE22, /* base_relative pic */ 72 - RELOC_PC10, 73 - RELOC_PC22, /* special pc-rel pic */ 74 - RELOC_JMP_TBL, /* jmp_tbl_rel in pic */ 75 - RELOC_SEGOFF16, /* ShLib offset-in-seg */ 76 - RELOC_GLOB_DAT, 77 - RELOC_JMP_SLOT, 78 - RELOC_RELATIVE /* rtld relocs */ 79 - }; 80 - 81 - /* 82 - * Format of a relocation datum. 83 - */ 84 - struct relocation_info /* used when header.a_machtype == M_SPARC */ 85 - { 86 - unsigned int r_address; /* relocation addr */ 87 - unsigned int r_index:24; /* segment index or symbol index */ 88 - unsigned int r_extern:1; /* if F, r_index==SEG#; if T, SYM idx */ 89 - unsigned int r_pad:2; /* <unused> */ 90 - enum reloc_type r_type:5; /* type of relocation to perform */ 91 - int r_addend; /* addend for relocation value */ 92 - }; 93 - 94 - #define N_RELOCATION_INFO_DECLARED 1 95 - 96 - #endif /* !(__ASSEMBLY__) */ 97 - 98 - #endif /* !(__SPARC64_A_OUT_H__) */ 1 + #include <asm-sparc/a.out.h>
+1 -4
include/asm-sparc64/auxvec.h
··· 1 - #ifndef __ASM_SPARC64_AUXVEC_H 2 - #define __ASM_SPARC64_AUXVEC_H 3 - 4 - #endif /* !(__ASM_SPARC64_AUXVEC_H) */ 1 + #include <asm-sparc/auxvec.h>
+1 -73
include/asm-sparc64/bpp.h
··· 1 - #ifndef _SPARC64_BPP_H 2 - #define _SPARC64_BPP_H 3 - 4 - /* 5 - * Copyright (c) 1995 Picture Elements 6 - * Stephen Williams 7 - * Gus Baldauf 8 - * 9 - * Linux/SPARC port by Peter Zaitcev. 10 - * Integration into SPARC tree by Tom Dyas. 11 - */ 12 - 13 - #include <linux/ioctl.h> 14 - 15 - /* 16 - * This is a driver that supports IEEE Std 1284-1994 communications 17 - * with compliant or compatible devices. It will use whatever features 18 - * the device supports, prefering those that are typically faster. 19 - * 20 - * When the device is opened, it is left in COMPATIBILITY mode, and 21 - * writes work like any printer device. The driver only attempt to 22 - * negotiate 1284 modes when needed so that plugs can be pulled, 23 - * switch boxes switched, etc., without disrupting things. It will 24 - * also leave the device in compatibility mode when closed. 25 - */ 26 - 27 - 28 - 29 - /* 30 - * This driver also supplies ioctls to manually manipulate the 31 - * pins. This is great for testing devices, or writing code to deal 32 - * with bizzarro-mode of the ACME Special TurboThingy Plus. 33 - * 34 - * NOTE: These ioctl currently do not interact well with 35 - * read/write. Caveat emptor. 36 - * 37 - * PUT_PINS allows us to assign the sense of all the pins, including 38 - * the data pins if being driven by the host. The GET_PINS returns the 39 - * pins that the peripheral drives, including data if appropriate. 40 - */ 41 - 42 - # define BPP_PUT_PINS _IOW('B', 1, int) 43 - # define BPP_GET_PINS _IOR('B', 2, char) /* that's bogus - should've been _IO */ 44 - # define BPP_PUT_DATA _IOW('B', 3, int) 45 - # define BPP_GET_DATA _IOR('B', 4, char) /* ditto */ 46 - 47 - /* 48 - * Set the data bus to input mode. Disengage the data bin driver and 49 - * be prepared to read values from the peripheral. If the arg is 0, 50 - * then revert the bus to output mode. 51 - */ 52 - # define BPP_SET_INPUT _IOW('B', 5, int) 53 - 54 - /* 55 - * These bits apply to the PUT operation... 56 - */ 57 - # define BPP_PP_nStrobe 0x0001 58 - # define BPP_PP_nAutoFd 0x0002 59 - # define BPP_PP_nInit 0x0004 60 - # define BPP_PP_nSelectIn 0x0008 61 - 62 - /* 63 - * These apply to the GET operation, which also reads the current value 64 - * of the previously put values. A bit mask of these will be returned 65 - * as a bit mask in the return code of the ioctl(). 66 - */ 67 - # define BPP_GP_nAck 0x0100 68 - # define BPP_GP_Busy 0x0200 69 - # define BPP_GP_PError 0x0400 70 - # define BPP_GP_Select 0x0800 71 - # define BPP_GP_nFault 0x1000 72 - 73 - #endif 1 + #include <asm-sparc/bpp.h>
-94
include/asm-sparc64/bsderrno.h
··· 1 - /* $Id: bsderrno.h,v 1.1 1996/12/26 13:25:21 davem Exp $ 2 - * bsderrno.h: Error numbers for NetBSD binary compatibility 3 - * 4 - * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) 5 - */ 6 - 7 - #ifndef _SPARC64_BSDERRNO_H 8 - #define _SPARC64_BSDERRNO_H 9 - 10 - #define BSD_EPERM 1 /* Operation not permitted */ 11 - #define BSD_ENOENT 2 /* No such file or directory */ 12 - #define BSD_ESRCH 3 /* No such process */ 13 - #define BSD_EINTR 4 /* Interrupted system call */ 14 - #define BSD_EIO 5 /* Input/output error */ 15 - #define BSD_ENXIO 6 /* Device not configured */ 16 - #define BSD_E2BIG 7 /* Argument list too long */ 17 - #define BSD_ENOEXEC 8 /* Exec format error */ 18 - #define BSD_EBADF 9 /* Bad file descriptor */ 19 - #define BSD_ECHILD 10 /* No child processes */ 20 - #define BSD_EDEADLK 11 /* Resource deadlock avoided */ 21 - #define BSD_ENOMEM 12 /* Cannot allocate memory */ 22 - #define BSD_EACCES 13 /* Permission denied */ 23 - #define BSD_EFAULT 14 /* Bad address */ 24 - #define BSD_ENOTBLK 15 /* Block device required */ 25 - #define BSD_EBUSY 16 /* Device busy */ 26 - #define BSD_EEXIST 17 /* File exists */ 27 - #define BSD_EXDEV 18 /* Cross-device link */ 28 - #define BSD_ENODEV 19 /* Operation not supported by device */ 29 - #define BSD_ENOTDIR 20 /* Not a directory */ 30 - #define BSD_EISDIR 21 /* Is a directory */ 31 - #define BSD_EINVAL 22 /* Invalid argument */ 32 - #define BSD_ENFILE 23 /* Too many open files in system */ 33 - #define BSD_EMFILE 24 /* Too many open files */ 34 - #define BSD_ENOTTY 25 /* Inappropriate ioctl for device */ 35 - #define BSD_ETXTBSY 26 /* Text file busy */ 36 - #define BSD_EFBIG 27 /* File too large */ 37 - #define BSD_ENOSPC 28 /* No space left on device */ 38 - #define BSD_ESPIPE 29 /* Illegal seek */ 39 - #define BSD_EROFS 30 /* Read-only file system */ 40 - #define BSD_EMLINK 31 /* Too many links */ 41 - #define BSD_EPIPE 32 /* Broken pipe */ 42 - #define BSD_EDOM 33 /* Numerical argument out of domain */ 43 - #define BSD_ERANGE 34 /* Result too large */ 44 - #define BSD_EAGAIN 35 /* Resource temporarily unavailable */ 45 - #define BSD_EWOULDBLOCK EAGAIN /* Operation would block */ 46 - #define BSD_EINPROGRESS 36 /* Operation now in progress */ 47 - #define BSD_EALREADY 37 /* Operation already in progress */ 48 - #define BSD_ENOTSOCK 38 /* Socket operation on non-socket */ 49 - #define BSD_EDESTADDRREQ 39 /* Destination address required */ 50 - #define BSD_EMSGSIZE 40 /* Message too long */ 51 - #define BSD_EPROTOTYPE 41 /* Protocol wrong type for socket */ 52 - #define BSD_ENOPROTOOPT 42 /* Protocol not available */ 53 - #define BSD_EPROTONOSUPPORT 43 /* Protocol not supported */ 54 - #define BSD_ESOCKTNOSUPPORT 44 /* Socket type not supported */ 55 - #define BSD_EOPNOTSUPP 45 /* Operation not supported */ 56 - #define BSD_EPFNOSUPPORT 46 /* Protocol family not supported */ 57 - #define BSD_EAFNOSUPPORT 47 /* Address family not supported by protocol family */ 58 - #define BSD_EADDRINUSE 48 /* Address already in use */ 59 - #define BSD_EADDRNOTAVAIL 49 /* Can't assign requested address */ 60 - #define BSD_ENETDOWN 50 /* Network is down */ 61 - #define BSD_ENETUNREACH 51 /* Network is unreachable */ 62 - #define BSD_ENETRESET 52 /* Network dropped connection on reset */ 63 - #define BSD_ECONNABORTED 53 /* Software caused connection abort */ 64 - #define BSD_ECONNRESET 54 /* Connection reset by peer */ 65 - #define BSD_ENOBUFS 55 /* No buffer space available */ 66 - #define BSD_EISCONN 56 /* Socket is already connected */ 67 - #define BSD_ENOTCONN 57 /* Socket is not connected */ 68 - #define BSD_ESHUTDOWN 58 /* Can't send after socket shutdown */ 69 - #define BSD_ETOOMANYREFS 59 /* Too many references: can't splice */ 70 - #define BSD_ETIMEDOUT 60 /* Operation timed out */ 71 - #define BSD_ECONNREFUSED 61 /* Connection refused */ 72 - #define BSD_ELOOP 62 /* Too many levels of symbolic links */ 73 - #define BSD_ENAMETOOLONG 63 /* File name too long */ 74 - #define BSD_EHOSTDOWN 64 /* Host is down */ 75 - #define BSD_EHOSTUNREACH 65 /* No route to host */ 76 - #define BSD_ENOTEMPTY 66 /* Directory not empty */ 77 - #define BSD_EPROCLIM 67 /* Too many processes */ 78 - #define BSD_EUSERS 68 /* Too many users */ 79 - #define BSD_EDQUOT 69 /* Disc quota exceeded */ 80 - #define BSD_ESTALE 70 /* Stale NFS file handle */ 81 - #define BSD_EREMOTE 71 /* Too many levels of remote in path */ 82 - #define BSD_EBADRPC 72 /* RPC struct is bad */ 83 - #define BSD_ERPCMISMATCH 73 /* RPC version wrong */ 84 - #define BSD_EPROGUNAVAIL 74 /* RPC prog. not avail */ 85 - #define BSD_EPROGMISMATCH 75 /* Program version wrong */ 86 - #define BSD_EPROCUNAVAIL 76 /* Bad procedure for program */ 87 - #define BSD_ENOLCK 77 /* No locks available */ 88 - #define BSD_ENOSYS 78 /* Function not implemented */ 89 - #define BSD_EFTYPE 79 /* Inappropriate file type or format */ 90 - #define BSD_EAUTH 80 /* Authentication error */ 91 - #define BSD_ENEEDAUTH 81 /* Need authenticator */ 92 - #define BSD_ELAST 81 /* Must be equal largest errno */ 93 - 94 - #endif /* !(_SPARC64_BSDERRNO_H) */
+1 -22
include/asm-sparc64/bug.h
··· 1 - #ifndef _SPARC64_BUG_H 2 - #define _SPARC64_BUG_H 3 - 4 - #ifdef CONFIG_BUG 5 - #include <linux/compiler.h> 6 - 7 - #ifdef CONFIG_DEBUG_BUGVERBOSE 8 - extern void do_BUG(const char *file, int line); 9 - #define BUG() do { \ 10 - do_BUG(__FILE__, __LINE__); \ 11 - __builtin_trap(); \ 12 - } while (0) 13 - #else 14 - #define BUG() __builtin_trap() 15 - #endif 16 - 17 - #define HAVE_ARCH_BUG 18 - #endif 19 - 20 - #include <asm-generic/bug.h> 21 - 22 - #endif 1 + #include <asm-sparc/bug.h>
+1 -10
include/asm-sparc64/bugs.h
··· 1 - /* bugs.h: Sparc64 probes for various bugs. 2 - * 3 - * Copyright (C) 1996, 2007 David S. Miller (davem@davemloft.net) 4 - */ 5 - #include <asm/sstate.h> 6 - 7 - static void __init check_bugs(void) 8 - { 9 - sstate_running(); 10 - } 1 + #include <asm-sparc/bugs.h>
+1 -49
include/asm-sparc64/byteorder.h
··· 1 - #ifndef _SPARC64_BYTEORDER_H 2 - #define _SPARC64_BYTEORDER_H 3 - 4 - #include <asm/types.h> 5 - #include <asm/asi.h> 6 - 7 - #ifdef __GNUC__ 8 - 9 - static inline __u16 ___arch__swab16p(const __u16 *addr) 10 - { 11 - __u16 ret; 12 - 13 - __asm__ __volatile__ ("lduha [%1] %2, %0" 14 - : "=r" (ret) 15 - : "r" (addr), "i" (ASI_PL)); 16 - return ret; 17 - } 18 - 19 - static inline __u32 ___arch__swab32p(const __u32 *addr) 20 - { 21 - __u32 ret; 22 - 23 - __asm__ __volatile__ ("lduwa [%1] %2, %0" 24 - : "=r" (ret) 25 - : "r" (addr), "i" (ASI_PL)); 26 - return ret; 27 - } 28 - 29 - static inline __u64 ___arch__swab64p(const __u64 *addr) 30 - { 31 - __u64 ret; 32 - 33 - __asm__ __volatile__ ("ldxa [%1] %2, %0" 34 - : "=r" (ret) 35 - : "r" (addr), "i" (ASI_PL)); 36 - return ret; 37 - } 38 - 39 - #define __arch__swab16p(x) ___arch__swab16p(x) 40 - #define __arch__swab32p(x) ___arch__swab32p(x) 41 - #define __arch__swab64p(x) ___arch__swab64p(x) 42 - 43 - #define __BYTEORDER_HAS_U64__ 44 - 45 - #endif /* __GNUC__ */ 46 - 47 - #include <linux/byteorder/big_endian.h> 48 - 49 - #endif /* _SPARC64_BYTEORDER_H */ 1 + #include <asm-sparc/byteorder.h>
+1 -18
include/asm-sparc64/cache.h
··· 1 - /* 2 - * include/asm-sparc64/cache.h 3 - */ 4 - #ifndef __ARCH_SPARC64_CACHE_H 5 - #define __ARCH_SPARC64_CACHE_H 6 - 7 - /* bytes per L1 cache line */ 8 - #define L1_CACHE_SHIFT 5 9 - #define L1_CACHE_BYTES 32 /* Two 16-byte sub-blocks per line. */ 10 - 11 - #define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)) 12 - 13 - #define SMP_CACHE_BYTES_SHIFT 6 14 - #define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT) /* L2 cache line size. */ 15 - 16 - #define __read_mostly __attribute__((__section__(".data.read_mostly"))) 17 - 18 - #endif 1 + #include <asm-sparc/cache.h>
+1 -6
include/asm-sparc64/cputime.h
··· 1 - #ifndef __SPARC64_CPUTIME_H 2 - #define __SPARC64_CPUTIME_H 3 - 4 - #include <asm-generic/cputime.h> 5 - 6 - #endif /* __SPARC64_CPUTIME_H */ 1 + #include <asm-sparc/cputime.h>
+1 -8
include/asm-sparc64/current.h
··· 1 - #ifndef _SPARC64_CURRENT_H 2 - #define _SPARC64_CURRENT_H 3 - 4 - #include <linux/thread_info.h> 5 - 6 - register struct task_struct *current asm("g4"); 7 - 8 - #endif /* !(_SPARC64_CURRENT_H) */ 1 + #include <asm-sparc/current.h>
+1 -21
include/asm-sparc64/device.h
··· 1 - /* 2 - * Arch specific extensions to struct device 3 - * 4 - * This file is released under the GPLv2 5 - */ 6 - #ifndef _ASM_SPARC64_DEVICE_H 7 - #define _ASM_SPARC64_DEVICE_H 8 - 9 - struct device_node; 10 - struct of_device; 11 - 12 - struct dev_archdata { 13 - void *iommu; 14 - void *stc; 15 - void *host_controller; 16 - 17 - struct device_node *prom_node; 18 - struct of_device *op; 19 - }; 20 - 21 - #endif /* _ASM_SPARC64_DEVICE_H */ 1 + #include <asm-sparc/device.h>
+1 -1
include/asm-sparc64/div64.h
··· 1 - #include <asm-generic/div64.h> 1 + #include <asm-sparc/div64.h>
+1 -6
include/asm-sparc64/emergency-restart.h
··· 1 - #ifndef _ASM_EMERGENCY_RESTART_H 2 - #define _ASM_EMERGENCY_RESTART_H 3 - 4 - #include <asm-generic/emergency-restart.h> 5 - 6 - #endif /* _ASM_EMERGENCY_RESTART_H */ 1 + #include <asm-sparc/emergency-restart.h>
+1 -114
include/asm-sparc64/errno.h
··· 1 - /* $Id: errno.h,v 1.2 1997/04/15 12:46:11 jj Exp $ */ 2 - #ifndef _SPARC64_ERRNO_H 3 - #define _SPARC64_ERRNO_H 4 - 5 - /* These match the SunOS error numbering scheme. */ 6 - 7 - #include <asm-generic/errno-base.h> 8 - 9 - #define EWOULDBLOCK EAGAIN /* Operation would block */ 10 - #define EINPROGRESS 36 /* Operation now in progress */ 11 - #define EALREADY 37 /* Operation already in progress */ 12 - #define ENOTSOCK 38 /* Socket operation on non-socket */ 13 - #define EDESTADDRREQ 39 /* Destination address required */ 14 - #define EMSGSIZE 40 /* Message too long */ 15 - #define EPROTOTYPE 41 /* Protocol wrong type for socket */ 16 - #define ENOPROTOOPT 42 /* Protocol not available */ 17 - #define EPROTONOSUPPORT 43 /* Protocol not supported */ 18 - #define ESOCKTNOSUPPORT 44 /* Socket type not supported */ 19 - #define EOPNOTSUPP 45 /* Op not supported on transport endpoint */ 20 - #define EPFNOSUPPORT 46 /* Protocol family not supported */ 21 - #define EAFNOSUPPORT 47 /* Address family not supported by protocol */ 22 - #define EADDRINUSE 48 /* Address already in use */ 23 - #define EADDRNOTAVAIL 49 /* Cannot assign requested address */ 24 - #define ENETDOWN 50 /* Network is down */ 25 - #define ENETUNREACH 51 /* Network is unreachable */ 26 - #define ENETRESET 52 /* Net dropped connection because of reset */ 27 - #define ECONNABORTED 53 /* Software caused connection abort */ 28 - #define ECONNRESET 54 /* Connection reset by peer */ 29 - #define ENOBUFS 55 /* No buffer space available */ 30 - #define EISCONN 56 /* Transport endpoint is already connected */ 31 - #define ENOTCONN 57 /* Transport endpoint is not connected */ 32 - #define ESHUTDOWN 58 /* No send after transport endpoint shutdown */ 33 - #define ETOOMANYREFS 59 /* Too many references: cannot splice */ 34 - #define ETIMEDOUT 60 /* Connection timed out */ 35 - #define ECONNREFUSED 61 /* Connection refused */ 36 - #define ELOOP 62 /* Too many symbolic links encountered */ 37 - #define ENAMETOOLONG 63 /* File name too long */ 38 - #define EHOSTDOWN 64 /* Host is down */ 39 - #define EHOSTUNREACH 65 /* No route to host */ 40 - #define ENOTEMPTY 66 /* Directory not empty */ 41 - #define EPROCLIM 67 /* SUNOS: Too many processes */ 42 - #define EUSERS 68 /* Too many users */ 43 - #define EDQUOT 69 /* Quota exceeded */ 44 - #define ESTALE 70 /* Stale NFS file handle */ 45 - #define EREMOTE 71 /* Object is remote */ 46 - #define ENOSTR 72 /* Device not a stream */ 47 - #define ETIME 73 /* Timer expired */ 48 - #define ENOSR 74 /* Out of streams resources */ 49 - #define ENOMSG 75 /* No message of desired type */ 50 - #define EBADMSG 76 /* Not a data message */ 51 - #define EIDRM 77 /* Identifier removed */ 52 - #define EDEADLK 78 /* Resource deadlock would occur */ 53 - #define ENOLCK 79 /* No record locks available */ 54 - #define ENONET 80 /* Machine is not on the network */ 55 - #define ERREMOTE 81 /* SunOS: Too many lvls of remote in path */ 56 - #define ENOLINK 82 /* Link has been severed */ 57 - #define EADV 83 /* Advertise error */ 58 - #define ESRMNT 84 /* Srmount error */ 59 - #define ECOMM 85 /* Communication error on send */ 60 - #define EPROTO 86 /* Protocol error */ 61 - #define EMULTIHOP 87 /* Multihop attempted */ 62 - #define EDOTDOT 88 /* RFS specific error */ 63 - #define EREMCHG 89 /* Remote address changed */ 64 - #define ENOSYS 90 /* Function not implemented */ 65 - 66 - /* The rest have no SunOS equivalent. */ 67 - #define ESTRPIPE 91 /* Streams pipe error */ 68 - #define EOVERFLOW 92 /* Value too large for defined data type */ 69 - #define EBADFD 93 /* File descriptor in bad state */ 70 - #define ECHRNG 94 /* Channel number out of range */ 71 - #define EL2NSYNC 95 /* Level 2 not synchronized */ 72 - #define EL3HLT 96 /* Level 3 halted */ 73 - #define EL3RST 97 /* Level 3 reset */ 74 - #define ELNRNG 98 /* Link number out of range */ 75 - #define EUNATCH 99 /* Protocol driver not attached */ 76 - #define ENOCSI 100 /* No CSI structure available */ 77 - #define EL2HLT 101 /* Level 2 halted */ 78 - #define EBADE 102 /* Invalid exchange */ 79 - #define EBADR 103 /* Invalid request descriptor */ 80 - #define EXFULL 104 /* Exchange full */ 81 - #define ENOANO 105 /* No anode */ 82 - #define EBADRQC 106 /* Invalid request code */ 83 - #define EBADSLT 107 /* Invalid slot */ 84 - #define EDEADLOCK 108 /* File locking deadlock error */ 85 - #define EBFONT 109 /* Bad font file format */ 86 - #define ELIBEXEC 110 /* Cannot exec a shared library directly */ 87 - #define ENODATA 111 /* No data available */ 88 - #define ELIBBAD 112 /* Accessing a corrupted shared library */ 89 - #define ENOPKG 113 /* Package not installed */ 90 - #define ELIBACC 114 /* Can not access a needed shared library */ 91 - #define ENOTUNIQ 115 /* Name not unique on network */ 92 - #define ERESTART 116 /* Interrupted syscall should be restarted */ 93 - #define EUCLEAN 117 /* Structure needs cleaning */ 94 - #define ENOTNAM 118 /* Not a XENIX named type file */ 95 - #define ENAVAIL 119 /* No XENIX semaphores available */ 96 - #define EISNAM 120 /* Is a named type file */ 97 - #define EREMOTEIO 121 /* Remote I/O error */ 98 - #define EILSEQ 122 /* Illegal byte sequence */ 99 - #define ELIBMAX 123 /* Atmpt to link in too many shared libs */ 100 - #define ELIBSCN 124 /* .lib section in a.out corrupted */ 101 - 102 - #define ENOMEDIUM 125 /* No medium found */ 103 - #define EMEDIUMTYPE 126 /* Wrong medium type */ 104 - #define ECANCELED 127 /* Operation Cancelled */ 105 - #define ENOKEY 128 /* Required key not available */ 106 - #define EKEYEXPIRED 129 /* Key has expired */ 107 - #define EKEYREVOKED 130 /* Key has been revoked */ 108 - #define EKEYREJECTED 131 /* Key was rejected by service */ 109 - 110 - /* for robust mutexes */ 111 - #define EOWNERDEAD 132 /* Owner died */ 112 - #define ENOTRECOVERABLE 133 /* State not recoverable */ 113 - 114 - #endif /* !(_SPARC64_ERRNO_H) */ 1 + #include <asm-sparc/errno.h>
+1 -27
include/asm-sparc64/fb.h
··· 1 - #ifndef _ASM_FB_H_ 2 - #define _ASM_FB_H_ 3 - #include <linux/fb.h> 4 - #include <linux/fs.h> 5 - #include <asm/page.h> 6 - #include <asm/prom.h> 7 - 8 - static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, 9 - unsigned long off) 10 - { 11 - vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); 12 - } 13 - 14 - static inline int fb_is_primary_device(struct fb_info *info) 15 - { 16 - struct device *dev = info->device; 17 - struct device_node *node; 18 - 19 - node = dev->archdata.prom_node; 20 - if (node && 21 - node == of_console_device) 22 - return 1; 23 - 24 - return 0; 25 - } 26 - 27 - #endif /* _ASM_FB_H_ */ 1 + #include <asm-sparc/fb.h>
+1 -1
include/asm-sparc64/io.h
··· 16 16 /* BIO layer definitions. */ 17 17 extern unsigned long kern_base, kern_size; 18 18 #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) 19 - #define BIO_VMERGE_BOUNDARY 0 19 + #define BIO_VMERGE_BOUNDARY 8192 20 20 21 21 static inline u8 _inb(unsigned long addr) 22 22 {
+1
include/asm-sparc64/iommu.h
··· 26 26 struct iommu { 27 27 spinlock_t lock; 28 28 struct iommu_arena arena; 29 + void (*flush_all)(struct iommu *); 29 30 iopte_t *page_table; 30 31 u32 page_table_map_base; 31 32 unsigned long iommu_control;
+4
include/asm-sparc64/kprobes.h
··· 14 14 15 15 #define arch_remove_kprobe(p) do {} while (0) 16 16 17 + #define ARCH_SUPPORTS_KRETPROBES 18 + 17 19 #define flush_insn_slot(p) \ 18 20 do { flushi(&(p)->ainsn.insn[0]); \ 19 21 flushi(&(p)->ainsn.insn[1]); \ 20 22 } while (0) 23 + 24 + void kretprobe_trampoline(void); 21 25 22 26 /* Architecture specific copy of original instruction*/ 23 27 struct arch_specific_insn {
+1 -38
include/asm-sparc64/of_device.h
··· 1 - #ifndef _ASM_SPARC64_OF_DEVICE_H 2 - #define _ASM_SPARC64_OF_DEVICE_H 3 - #ifdef __KERNEL__ 4 - 5 - #include <linux/device.h> 6 - #include <linux/of.h> 7 - #include <linux/mod_devicetable.h> 8 - #include <asm/openprom.h> 9 - 10 - /* 11 - * The of_device is a kind of "base class" that is a superset of 12 - * struct device for use by devices attached to an OF node and 13 - * probed using OF properties. 14 - */ 15 - struct of_device 16 - { 17 - struct device_node *node; 18 - struct device dev; 19 - struct resource resource[PROMREG_MAX]; 20 - unsigned int irqs[PROMINTR_MAX]; 21 - int num_irqs; 22 - 23 - void *sysdata; 24 - 25 - int slot; 26 - int portid; 27 - int clock_freq; 28 - }; 29 - 30 - extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 31 - extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 32 - 33 - /* These are just here during the transition */ 34 - #include <linux/of_device.h> 35 - #include <linux/of_platform.h> 36 - 37 - #endif /* __KERNEL__ */ 38 - #endif /* _ASM_SPARC64_OF_DEVICE_H */ 1 + #include <asm-sparc/of_device.h>
-5
include/asm-sparc64/of_platform.h
··· 22 22 23 23 #define of_bus_type of_platform_bus_type /* for compatibility */ 24 24 25 - extern struct of_device *of_platform_device_create(struct device_node *np, 26 - const char *bus_id, 27 - struct device *parent, 28 - struct bus_type *bus); 29 - 30 25 #endif /* _ASM_SPARC64_OF_PLATFORM_H */
+1 -103
include/asm-sparc64/prom.h
··· 1 - #ifndef _SPARC64_PROM_H 2 - #define _SPARC64_PROM_H 3 - #ifdef __KERNEL__ 4 - 5 - /* 6 - * Definitions for talking to the Open Firmware PROM on 7 - * Power Macintosh computers. 8 - * 9 - * Copyright (C) 1996-2005 Paul Mackerras. 10 - * 11 - * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp. 12 - * Updates for SPARC64 by David S. Miller 13 - * 14 - * This program is free software; you can redistribute it and/or 15 - * modify it under the terms of the GNU General Public License 16 - * as published by the Free Software Foundation; either version 17 - * 2 of the License, or (at your option) any later version. 18 - */ 19 - #include <linux/types.h> 20 - #include <linux/proc_fs.h> 21 - #include <asm/atomic.h> 22 - 23 - #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2 24 - #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 25 - 26 - #define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l)) 27 - #define of_prop_cmp(s1, s2) strcasecmp((s1), (s2)) 28 - #define of_node_cmp(s1, s2) strcmp((s1), (s2)) 29 - 30 - typedef u32 phandle; 31 - typedef u32 ihandle; 32 - 33 - struct property { 34 - char *name; 35 - int length; 36 - void *value; 37 - struct property *next; 38 - unsigned long _flags; 39 - unsigned int unique_id; 40 - }; 41 - 42 - struct of_irq_controller; 43 - struct device_node { 44 - const char *name; 45 - const char *type; 46 - phandle node; 47 - char *path_component_name; 48 - char *full_name; 49 - 50 - struct property *properties; 51 - struct property *deadprops; /* removed properties */ 52 - struct device_node *parent; 53 - struct device_node *child; 54 - struct device_node *sibling; 55 - struct device_node *next; /* next device of same type */ 56 - struct device_node *allnext; /* next in list of all nodes */ 57 - struct proc_dir_entry *pde; /* this node's proc directory */ 58 - struct kref kref; 59 - unsigned long _flags; 60 - void *data; 61 - unsigned int unique_id; 62 - 63 - struct of_irq_controller *irq_trans; 64 - }; 65 - 66 - struct of_irq_controller { 67 - unsigned int (*irq_build)(struct device_node *, unsigned int, void *); 68 - void *data; 69 - }; 70 - 71 - #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) 72 - #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) 73 - 74 - extern struct device_node *of_find_node_by_cpuid(int cpuid); 75 - extern int of_set_property(struct device_node *node, const char *name, void *val, int len); 76 - extern int of_getintprop_default(struct device_node *np, 77 - const char *name, 78 - int def); 79 - extern int of_find_in_proplist(const char *list, const char *match, int len); 80 - 81 - extern void prom_build_devicetree(void); 82 - 83 - /* Dummy ref counting routines - to be implemented later */ 84 - static inline struct device_node *of_node_get(struct device_node *node) 85 - { 86 - return node; 87 - } 88 - static inline void of_node_put(struct device_node *node) 89 - { 90 - } 91 - 92 - /* 93 - * NB: This is here while we transition from using asm/prom.h 94 - * to linux/of.h 95 - */ 96 - #include <linux/of.h> 97 - 98 - extern struct device_node *of_console_device; 99 - extern char *of_console_path; 100 - extern char *of_console_options; 101 - 102 - #endif /* __KERNEL__ */ 103 - #endif /* _SPARC64_PROM_H */ 1 + #include <asm-sparc/prom.h>