diff options
Diffstat (limited to 'arch/alpha/kernel')
-rw-r--r-- | arch/alpha/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/alpha/kernel/err_ev6.c | 4 | ||||
-rw-r--r-- | arch/alpha/kernel/err_ev7.c | 6 | ||||
-rw-r--r-- | arch/alpha/kernel/err_marvel.c | 40 | ||||
-rw-r--r-- | arch/alpha/kernel/err_titan.c | 28 | ||||
-rw-r--r-- | arch/alpha/kernel/pci-sysfs.c | 366 | ||||
-rw-r--r-- | arch/alpha/kernel/pci.c | 2 | ||||
-rw-r--r-- | arch/alpha/kernel/pci_iommu.c | 34 | ||||
-rw-r--r-- | arch/alpha/kernel/proto.h | 16 | ||||
-rw-r--r-- | arch/alpha/kernel/setup.c | 2 | ||||
-rw-r--r-- | arch/alpha/kernel/smc37c669.c | 4 | ||||
-rw-r--r-- | arch/alpha/kernel/sys_jensen.c | 3 | ||||
-rw-r--r-- | arch/alpha/kernel/sys_sable.c | 4 | ||||
-rw-r--r-- | arch/alpha/kernel/traps.c | 2 |
14 files changed, 439 insertions, 74 deletions
diff --git a/arch/alpha/kernel/Makefile b/arch/alpha/kernel/Makefile index b4697759a123..a427538252f8 100644 --- a/arch/alpha/kernel/Makefile +++ b/arch/alpha/kernel/Makefile | |||
@@ -12,7 +12,7 @@ obj-y := entry.o traps.o process.o init_task.o osf_sys.o irq.o \ | |||
12 | 12 | ||
13 | obj-$(CONFIG_VGA_HOSE) += console.o | 13 | obj-$(CONFIG_VGA_HOSE) += console.o |
14 | obj-$(CONFIG_SMP) += smp.o | 14 | obj-$(CONFIG_SMP) += smp.o |
15 | obj-$(CONFIG_PCI) += pci.o pci_iommu.o | 15 | obj-$(CONFIG_PCI) += pci.o pci_iommu.o pci-sysfs.o |
16 | obj-$(CONFIG_SRM_ENV) += srm_env.o | 16 | obj-$(CONFIG_SRM_ENV) += srm_env.o |
17 | obj-$(CONFIG_MODULES) += module.o | 17 | obj-$(CONFIG_MODULES) += module.o |
18 | 18 | ||
diff --git a/arch/alpha/kernel/err_ev6.c b/arch/alpha/kernel/err_ev6.c index 11aee012a8ae..985e5c1681ac 100644 --- a/arch/alpha/kernel/err_ev6.c +++ b/arch/alpha/kernel/err_ev6.c | |||
@@ -157,8 +157,8 @@ ev6_parse_cbox(u64 c_addr, u64 c1_syn, u64 c2_syn, | |||
157 | err_print_prefix, | 157 | err_print_prefix, |
158 | streamname[stream], bitsname[bits], sourcename[source]); | 158 | streamname[stream], bitsname[bits], sourcename[source]); |
159 | 159 | ||
160 | printk("%s Address: 0x%016lx\n" | 160 | printk("%s Address: 0x%016llx\n" |
161 | " Syndrome[upper.lower]: %02lx.%02lx\n", | 161 | " Syndrome[upper.lower]: %02llx.%02llx\n", |
162 | err_print_prefix, | 162 | err_print_prefix, |
163 | c_addr, | 163 | c_addr, |
164 | c2_syn, c1_syn); | 164 | c2_syn, c1_syn); |
diff --git a/arch/alpha/kernel/err_ev7.c b/arch/alpha/kernel/err_ev7.c index 68cd493f54c5..73770c6ca013 100644 --- a/arch/alpha/kernel/err_ev7.c +++ b/arch/alpha/kernel/err_ev7.c | |||
@@ -246,13 +246,13 @@ ev7_process_pal_subpacket(struct el_subpacket *header) | |||
246 | 246 | ||
247 | switch(header->type) { | 247 | switch(header->type) { |
248 | case EL_TYPE__PAL__LOGOUT_FRAME: | 248 | case EL_TYPE__PAL__LOGOUT_FRAME: |
249 | printk("%s*** MCHK occurred on LPID %ld (RBOX %lx)\n", | 249 | printk("%s*** MCHK occurred on LPID %ld (RBOX %llx)\n", |
250 | err_print_prefix, | 250 | err_print_prefix, |
251 | packet->by_type.logout.whami, | 251 | packet->by_type.logout.whami, |
252 | packet->by_type.logout.rbox_whami); | 252 | packet->by_type.logout.rbox_whami); |
253 | el_print_timestamp(&packet->by_type.logout.timestamp); | 253 | el_print_timestamp(&packet->by_type.logout.timestamp); |
254 | printk("%s EXC_ADDR: %016lx\n" | 254 | printk("%s EXC_ADDR: %016llx\n" |
255 | " HALT_CODE: %lx\n", | 255 | " HALT_CODE: %llx\n", |
256 | err_print_prefix, | 256 | err_print_prefix, |
257 | packet->by_type.logout.exc_addr, | 257 | packet->by_type.logout.exc_addr, |
258 | packet->by_type.logout.halt_code); | 258 | packet->by_type.logout.halt_code); |
diff --git a/arch/alpha/kernel/err_marvel.c b/arch/alpha/kernel/err_marvel.c index 413bf37eb094..6bfd243efba3 100644 --- a/arch/alpha/kernel/err_marvel.c +++ b/arch/alpha/kernel/err_marvel.c | |||
@@ -129,7 +129,7 @@ marvel_print_po7_crrct_sym(u64 crrct_sym) | |||
129 | 129 | ||
130 | 130 | ||
131 | printk("%s Correctable Error Symptoms:\n" | 131 | printk("%s Correctable Error Symptoms:\n" |
132 | "%s Syndrome: 0x%lx\n", | 132 | "%s Syndrome: 0x%llx\n", |
133 | err_print_prefix, | 133 | err_print_prefix, |
134 | err_print_prefix, EXTRACT(crrct_sym, IO7__PO7_CRRCT_SYM__SYN)); | 134 | err_print_prefix, EXTRACT(crrct_sym, IO7__PO7_CRRCT_SYM__SYN)); |
135 | marvel_print_err_cyc(EXTRACT(crrct_sym, IO7__PO7_CRRCT_SYM__ERR_CYC)); | 135 | marvel_print_err_cyc(EXTRACT(crrct_sym, IO7__PO7_CRRCT_SYM__ERR_CYC)); |
@@ -186,7 +186,7 @@ marvel_print_po7_uncrr_sym(u64 uncrr_sym, u64 valid_mask) | |||
186 | uncrr_sym &= valid_mask; | 186 | uncrr_sym &= valid_mask; |
187 | 187 | ||
188 | if (EXTRACT(valid_mask, IO7__PO7_UNCRR_SYM__SYN)) | 188 | if (EXTRACT(valid_mask, IO7__PO7_UNCRR_SYM__SYN)) |
189 | printk("%s Syndrome: 0x%lx\n", | 189 | printk("%s Syndrome: 0x%llx\n", |
190 | err_print_prefix, | 190 | err_print_prefix, |
191 | EXTRACT(uncrr_sym, IO7__PO7_UNCRR_SYM__SYN)); | 191 | EXTRACT(uncrr_sym, IO7__PO7_UNCRR_SYM__SYN)); |
192 | 192 | ||
@@ -307,7 +307,7 @@ marvel_print_po7_ugbge_sym(u64 ugbge_sym) | |||
307 | sprintf(opcode_str, "BlkIO"); | 307 | sprintf(opcode_str, "BlkIO"); |
308 | break; | 308 | break; |
309 | default: | 309 | default: |
310 | sprintf(opcode_str, "0x%lx\n", | 310 | sprintf(opcode_str, "0x%llx\n", |
311 | EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_OPCODE)); | 311 | EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_OPCODE)); |
312 | break; | 312 | break; |
313 | } | 313 | } |
@@ -321,7 +321,7 @@ marvel_print_po7_ugbge_sym(u64 ugbge_sym) | |||
321 | opcode_str); | 321 | opcode_str); |
322 | 322 | ||
323 | if (0xC5 != EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_OPCODE)) | 323 | if (0xC5 != EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_OPCODE)) |
324 | printk("%s Packet Offset 0x%08lx\n", | 324 | printk("%s Packet Offset 0x%08llx\n", |
325 | err_print_prefix, | 325 | err_print_prefix, |
326 | EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_PKT_OFF)); | 326 | EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_PKT_OFF)); |
327 | } | 327 | } |
@@ -480,8 +480,8 @@ marvel_print_po7_err_sum(struct ev7_pal_io_subpacket *io) | |||
480 | printk("%s Lost Error\n", err_print_prefix); | 480 | printk("%s Lost Error\n", err_print_prefix); |
481 | 481 | ||
482 | printk("%s Failing Packet:\n" | 482 | printk("%s Failing Packet:\n" |
483 | "%s Cycle 1: %016lx\n" | 483 | "%s Cycle 1: %016llx\n" |
484 | "%s Cycle 2: %016lx\n", | 484 | "%s Cycle 2: %016llx\n", |
485 | err_print_prefix, | 485 | err_print_prefix, |
486 | err_print_prefix, io->po7_err_pkt0, | 486 | err_print_prefix, io->po7_err_pkt0, |
487 | err_print_prefix, io->po7_err_pkt1); | 487 | err_print_prefix, io->po7_err_pkt1); |
@@ -515,9 +515,9 @@ marvel_print_pox_tlb_err(u64 tlb_err) | |||
515 | if (!(tlb_err & IO7__POX_TLBERR__ERR_VALID)) | 515 | if (!(tlb_err & IO7__POX_TLBERR__ERR_VALID)) |
516 | return; | 516 | return; |
517 | 517 | ||
518 | printk("%s TLB Error on index 0x%lx:\n" | 518 | printk("%s TLB Error on index 0x%llx:\n" |
519 | "%s - %s\n" | 519 | "%s - %s\n" |
520 | "%s - Addr: 0x%016lx\n", | 520 | "%s - Addr: 0x%016llx\n", |
521 | err_print_prefix, | 521 | err_print_prefix, |
522 | EXTRACT(tlb_err, IO7__POX_TLBERR__ERR_TLB_PTR), | 522 | EXTRACT(tlb_err, IO7__POX_TLBERR__ERR_TLB_PTR), |
523 | err_print_prefix, | 523 | err_print_prefix, |
@@ -579,7 +579,7 @@ marvel_print_pox_spl_cmplt(u64 spl_cmplt) | |||
579 | sprintf(message, "Uncorrectable Split Write Data Error"); | 579 | sprintf(message, "Uncorrectable Split Write Data Error"); |
580 | break; | 580 | break; |
581 | default: | 581 | default: |
582 | sprintf(message, "%08lx\n", | 582 | sprintf(message, "%08llx\n", |
583 | EXTRACT(spl_cmplt, IO7__POX_SPLCMPLT__MESSAGE)); | 583 | EXTRACT(spl_cmplt, IO7__POX_SPLCMPLT__MESSAGE)); |
584 | break; | 584 | break; |
585 | } | 585 | } |
@@ -620,9 +620,9 @@ marvel_print_pox_trans_sum(u64 trans_sum) | |||
620 | return; | 620 | return; |
621 | 621 | ||
622 | printk("%s Transaction Summary:\n" | 622 | printk("%s Transaction Summary:\n" |
623 | "%s Command: 0x%lx - %s\n" | 623 | "%s Command: 0x%llx - %s\n" |
624 | "%s Address: 0x%016lx%s\n" | 624 | "%s Address: 0x%016llx%s\n" |
625 | "%s PCI-X Master Slot: 0x%lx\n", | 625 | "%s PCI-X Master Slot: 0x%llx\n", |
626 | err_print_prefix, | 626 | err_print_prefix, |
627 | err_print_prefix, | 627 | err_print_prefix, |
628 | EXTRACT(trans_sum, IO7__POX_TRANSUM__PCIX_CMD), | 628 | EXTRACT(trans_sum, IO7__POX_TRANSUM__PCIX_CMD), |
@@ -964,12 +964,12 @@ marvel_process_io_error(struct ev7_lf_subpackets *lf_subpackets, int print) | |||
964 | 964 | ||
965 | #if 0 | 965 | #if 0 |
966 | printk("%s PORT 7 ERROR:\n" | 966 | printk("%s PORT 7 ERROR:\n" |
967 | "%s PO7_ERROR_SUM: %016lx\n" | 967 | "%s PO7_ERROR_SUM: %016llx\n" |
968 | "%s PO7_UNCRR_SYM: %016lx\n" | 968 | "%s PO7_UNCRR_SYM: %016llx\n" |
969 | "%s PO7_CRRCT_SYM: %016lx\n" | 969 | "%s PO7_CRRCT_SYM: %016llx\n" |
970 | "%s PO7_UGBGE_SYM: %016lx\n" | 970 | "%s PO7_UGBGE_SYM: %016llx\n" |
971 | "%s PO7_ERR_PKT0: %016lx\n" | 971 | "%s PO7_ERR_PKT0: %016llx\n" |
972 | "%s PO7_ERR_PKT1: %016lx\n", | 972 | "%s PO7_ERR_PKT1: %016llx\n", |
973 | err_print_prefix, | 973 | err_print_prefix, |
974 | err_print_prefix, io->po7_error_sum, | 974 | err_print_prefix, io->po7_error_sum, |
975 | err_print_prefix, io->po7_uncrr_sym, | 975 | err_print_prefix, io->po7_uncrr_sym, |
@@ -987,12 +987,12 @@ marvel_process_io_error(struct ev7_lf_subpackets *lf_subpackets, int print) | |||
987 | if (!MARVEL_IO_ERR_VALID(io->ports[i].pox_err_sum)) | 987 | if (!MARVEL_IO_ERR_VALID(io->ports[i].pox_err_sum)) |
988 | continue; | 988 | continue; |
989 | 989 | ||
990 | printk("%s PID %u PORT %d POx_ERR_SUM: %016lx\n", | 990 | printk("%s PID %u PORT %d POx_ERR_SUM: %016llx\n", |
991 | err_print_prefix, | 991 | err_print_prefix, |
992 | lf_subpackets->io_pid, i, io->ports[i].pox_err_sum); | 992 | lf_subpackets->io_pid, i, io->ports[i].pox_err_sum); |
993 | marvel_print_pox_err(io->ports[i].pox_err_sum, &io->ports[i]); | 993 | marvel_print_pox_err(io->ports[i].pox_err_sum, &io->ports[i]); |
994 | 994 | ||
995 | printk("%s [ POx_FIRST_ERR: %016lx ]\n", | 995 | printk("%s [ POx_FIRST_ERR: %016llx ]\n", |
996 | err_print_prefix, io->ports[i].pox_first_err); | 996 | err_print_prefix, io->ports[i].pox_first_err); |
997 | marvel_print_pox_err(io->ports[i].pox_first_err, | 997 | marvel_print_pox_err(io->ports[i].pox_first_err, |
998 | &io->ports[i]); | 998 | &io->ports[i]); |
diff --git a/arch/alpha/kernel/err_titan.c b/arch/alpha/kernel/err_titan.c index 257449ed15ef..c7e28a88d6e3 100644 --- a/arch/alpha/kernel/err_titan.c +++ b/arch/alpha/kernel/err_titan.c | |||
@@ -107,12 +107,12 @@ titan_parse_p_serror(int which, u64 serror, int print) | |||
107 | if (!print) | 107 | if (!print) |
108 | return status; | 108 | return status; |
109 | 109 | ||
110 | printk("%s PChip %d SERROR: %016lx\n", | 110 | printk("%s PChip %d SERROR: %016llx\n", |
111 | err_print_prefix, which, serror); | 111 | err_print_prefix, which, serror); |
112 | if (serror & TITAN__PCHIP_SERROR__ECCMASK) { | 112 | if (serror & TITAN__PCHIP_SERROR__ECCMASK) { |
113 | printk("%s %sorrectable ECC Error:\n" | 113 | printk("%s %sorrectable ECC Error:\n" |
114 | " Source: %-6s Command: %-8s Syndrome: 0x%08x\n" | 114 | " Source: %-6s Command: %-8s Syndrome: 0x%08x\n" |
115 | " Address: 0x%lx\n", | 115 | " Address: 0x%llx\n", |
116 | err_print_prefix, | 116 | err_print_prefix, |
117 | (serror & TITAN__PCHIP_SERROR__UECC) ? "Unc" : "C", | 117 | (serror & TITAN__PCHIP_SERROR__UECC) ? "Unc" : "C", |
118 | serror_src[EXTRACT(serror, TITAN__PCHIP_SERROR__SRC)], | 118 | serror_src[EXTRACT(serror, TITAN__PCHIP_SERROR__SRC)], |
@@ -223,7 +223,7 @@ titan_parse_p_perror(int which, int port, u64 perror, int print) | |||
223 | if (!print) | 223 | if (!print) |
224 | return status; | 224 | return status; |
225 | 225 | ||
226 | printk("%s PChip %d %cPERROR: %016lx\n", | 226 | printk("%s PChip %d %cPERROR: %016llx\n", |
227 | err_print_prefix, which, | 227 | err_print_prefix, which, |
228 | port ? 'A' : 'G', perror); | 228 | port ? 'A' : 'G', perror); |
229 | if (perror & TITAN__PCHIP_PERROR__IPTPW) | 229 | if (perror & TITAN__PCHIP_PERROR__IPTPW) |
@@ -316,7 +316,7 @@ titan_parse_p_agperror(int which, u64 agperror, int print) | |||
316 | addr = EXTRACT(agperror, TITAN__PCHIP_AGPERROR__ADDR) << 3; | 316 | addr = EXTRACT(agperror, TITAN__PCHIP_AGPERROR__ADDR) << 3; |
317 | len = EXTRACT(agperror, TITAN__PCHIP_AGPERROR__LEN); | 317 | len = EXTRACT(agperror, TITAN__PCHIP_AGPERROR__LEN); |
318 | 318 | ||
319 | printk("%s PChip %d AGPERROR: %016lx\n", err_print_prefix, | 319 | printk("%s PChip %d AGPERROR: %016llx\n", err_print_prefix, |
320 | which, agperror); | 320 | which, agperror); |
321 | if (agperror & TITAN__PCHIP_AGPERROR__NOWINDOW) | 321 | if (agperror & TITAN__PCHIP_AGPERROR__NOWINDOW) |
322 | printk("%s No Window\n", err_print_prefix); | 322 | printk("%s No Window\n", err_print_prefix); |
@@ -597,16 +597,16 @@ privateer_process_680_frame(struct el_common *mchk_header, int print) | |||
597 | return status; | 597 | return status; |
598 | 598 | ||
599 | /* TODO - decode instead of just dumping... */ | 599 | /* TODO - decode instead of just dumping... */ |
600 | printk("%s Summary Flags: %016lx\n" | 600 | printk("%s Summary Flags: %016llx\n" |
601 | " CChip DIRx: %016lx\n" | 601 | " CChip DIRx: %016llx\n" |
602 | " System Management IR: %016lx\n" | 602 | " System Management IR: %016llx\n" |
603 | " CPU IR: %016lx\n" | 603 | " CPU IR: %016llx\n" |
604 | " Power Supply IR: %016lx\n" | 604 | " Power Supply IR: %016llx\n" |
605 | " LM78 Fault Status: %016lx\n" | 605 | " LM78 Fault Status: %016llx\n" |
606 | " System Doors: %016lx\n" | 606 | " System Doors: %016llx\n" |
607 | " Temperature Warning: %016lx\n" | 607 | " Temperature Warning: %016llx\n" |
608 | " Fan Control: %016lx\n" | 608 | " Fan Control: %016llx\n" |
609 | " Fatal Power Down Code: %016lx\n", | 609 | " Fatal Power Down Code: %016llx\n", |
610 | err_print_prefix, | 610 | err_print_prefix, |
611 | emchk->summary, | 611 | emchk->summary, |
612 | emchk->c_dirx, | 612 | emchk->c_dirx, |
diff --git a/arch/alpha/kernel/pci-sysfs.c b/arch/alpha/kernel/pci-sysfs.c new file mode 100644 index 000000000000..6ea822e7f724 --- /dev/null +++ b/arch/alpha/kernel/pci-sysfs.c | |||
@@ -0,0 +1,366 @@ | |||
1 | /* | ||
2 | * arch/alpha/kernel/pci-sysfs.c | ||
3 | * | ||
4 | * Copyright (C) 2009 Ivan Kokshaysky | ||
5 | * | ||
6 | * Alpha PCI resource files. | ||
7 | * | ||
8 | * Loosely based on generic HAVE_PCI_MMAP implementation in | ||
9 | * drivers/pci/pci-sysfs.c | ||
10 | */ | ||
11 | |||
12 | #include <linux/sched.h> | ||
13 | #include <linux/pci.h> | ||
14 | |||
15 | static int hose_mmap_page_range(struct pci_controller *hose, | ||
16 | struct vm_area_struct *vma, | ||
17 | enum pci_mmap_state mmap_type, int sparse) | ||
18 | { | ||
19 | unsigned long base; | ||
20 | |||
21 | if (mmap_type == pci_mmap_mem) | ||
22 | base = sparse ? hose->sparse_mem_base : hose->dense_mem_base; | ||
23 | else | ||
24 | base = sparse ? hose->sparse_io_base : hose->dense_io_base; | ||
25 | |||
26 | vma->vm_pgoff += base >> PAGE_SHIFT; | ||
27 | vma->vm_flags |= (VM_IO | VM_RESERVED); | ||
28 | |||
29 | return io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, | ||
30 | vma->vm_end - vma->vm_start, | ||
31 | vma->vm_page_prot); | ||
32 | } | ||
33 | |||
34 | static int __pci_mmap_fits(struct pci_dev *pdev, int num, | ||
35 | struct vm_area_struct *vma, int sparse) | ||
36 | { | ||
37 | unsigned long nr, start, size; | ||
38 | int shift = sparse ? 5 : 0; | ||
39 | |||
40 | nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; | ||
41 | start = vma->vm_pgoff; | ||
42 | size = ((pci_resource_len(pdev, num) - 1) >> (PAGE_SHIFT - shift)) + 1; | ||
43 | |||
44 | if (start < size && size - start >= nr) | ||
45 | return 1; | ||
46 | WARN(1, "process \"%s\" tried to map%s 0x%08lx-0x%08lx on %s BAR %d " | ||
47 | "(size 0x%08lx)\n", | ||
48 | current->comm, sparse ? " sparse" : "", start, start + nr, | ||
49 | pci_name(pdev), num, size); | ||
50 | return 0; | ||
51 | } | ||
52 | |||
53 | /** | ||
54 | * pci_mmap_resource - map a PCI resource into user memory space | ||
55 | * @kobj: kobject for mapping | ||
56 | * @attr: struct bin_attribute for the file being mapped | ||
57 | * @vma: struct vm_area_struct passed into the mmap | ||
58 | * @sparse: address space type | ||
59 | * | ||
60 | * Use the bus mapping routines to map a PCI resource into userspace. | ||
61 | */ | ||
62 | static int pci_mmap_resource(struct kobject *kobj, struct bin_attribute *attr, | ||
63 | struct vm_area_struct *vma, int sparse) | ||
64 | { | ||
65 | struct pci_dev *pdev = to_pci_dev(container_of(kobj, | ||
66 | struct device, kobj)); | ||
67 | struct resource *res = (struct resource *)attr->private; | ||
68 | enum pci_mmap_state mmap_type; | ||
69 | struct pci_bus_region bar; | ||
70 | int i; | ||
71 | |||
72 | for (i = 0; i < PCI_ROM_RESOURCE; i++) | ||
73 | if (res == &pdev->resource[i]) | ||
74 | break; | ||
75 | if (i >= PCI_ROM_RESOURCE) | ||
76 | return -ENODEV; | ||
77 | |||
78 | if (!__pci_mmap_fits(pdev, i, vma, sparse)) | ||
79 | return -EINVAL; | ||
80 | |||
81 | if (iomem_is_exclusive(res->start)) | ||
82 | return -EINVAL; | ||
83 | |||
84 | pcibios_resource_to_bus(pdev, &bar, res); | ||
85 | vma->vm_pgoff += bar.start >> (PAGE_SHIFT - (sparse ? 5 : 0)); | ||
86 | mmap_type = res->flags & IORESOURCE_MEM ? pci_mmap_mem : pci_mmap_io; | ||
87 | |||
88 | return hose_mmap_page_range(pdev->sysdata, vma, mmap_type, sparse); | ||
89 | } | ||
90 | |||
91 | static int pci_mmap_resource_sparse(struct kobject *kobj, | ||
92 | struct bin_attribute *attr, | ||
93 | struct vm_area_struct *vma) | ||
94 | { | ||
95 | return pci_mmap_resource(kobj, attr, vma, 1); | ||
96 | } | ||
97 | |||
98 | static int pci_mmap_resource_dense(struct kobject *kobj, | ||
99 | struct bin_attribute *attr, | ||
100 | struct vm_area_struct *vma) | ||
101 | { | ||
102 | return pci_mmap_resource(kobj, attr, vma, 0); | ||
103 | } | ||
104 | |||
105 | /** | ||
106 | * pci_remove_resource_files - cleanup resource files | ||
107 | * @dev: dev to cleanup | ||
108 | * | ||
109 | * If we created resource files for @dev, remove them from sysfs and | ||
110 | * free their resources. | ||
111 | */ | ||
112 | void pci_remove_resource_files(struct pci_dev *pdev) | ||
113 | { | ||
114 | int i; | ||
115 | |||
116 | for (i = 0; i < PCI_ROM_RESOURCE; i++) { | ||
117 | struct bin_attribute *res_attr; | ||
118 | |||
119 | res_attr = pdev->res_attr[i]; | ||
120 | if (res_attr) { | ||
121 | sysfs_remove_bin_file(&pdev->dev.kobj, res_attr); | ||
122 | kfree(res_attr); | ||
123 | } | ||
124 | |||
125 | res_attr = pdev->res_attr_wc[i]; | ||
126 | if (res_attr) { | ||
127 | sysfs_remove_bin_file(&pdev->dev.kobj, res_attr); | ||
128 | kfree(res_attr); | ||
129 | } | ||
130 | } | ||
131 | } | ||
132 | |||
133 | static int sparse_mem_mmap_fits(struct pci_dev *pdev, int num) | ||
134 | { | ||
135 | struct pci_bus_region bar; | ||
136 | struct pci_controller *hose = pdev->sysdata; | ||
137 | long dense_offset; | ||
138 | unsigned long sparse_size; | ||
139 | |||
140 | pcibios_resource_to_bus(pdev, &bar, &pdev->resource[num]); | ||
141 | |||
142 | /* All core logic chips have 4G sparse address space, except | ||
143 | CIA which has 16G (see xxx_SPARSE_MEM and xxx_DENSE_MEM | ||
144 | definitions in asm/core_xxx.h files). This corresponds | ||
145 | to 128M or 512M of the bus space. */ | ||
146 | dense_offset = (long)(hose->dense_mem_base - hose->sparse_mem_base); | ||
147 | sparse_size = dense_offset >= 0x400000000UL ? 0x20000000 : 0x8000000; | ||
148 | |||
149 | return bar.end < sparse_size; | ||
150 | } | ||
151 | |||
152 | static int pci_create_one_attr(struct pci_dev *pdev, int num, char *name, | ||
153 | char *suffix, struct bin_attribute *res_attr, | ||
154 | unsigned long sparse) | ||
155 | { | ||
156 | size_t size = pci_resource_len(pdev, num); | ||
157 | |||
158 | sprintf(name, "resource%d%s", num, suffix); | ||
159 | res_attr->mmap = sparse ? pci_mmap_resource_sparse : | ||
160 | pci_mmap_resource_dense; | ||
161 | res_attr->attr.name = name; | ||
162 | res_attr->attr.mode = S_IRUSR | S_IWUSR; | ||
163 | res_attr->size = sparse ? size << 5 : size; | ||
164 | res_attr->private = &pdev->resource[num]; | ||
165 | return sysfs_create_bin_file(&pdev->dev.kobj, res_attr); | ||
166 | } | ||
167 | |||
168 | static int pci_create_attr(struct pci_dev *pdev, int num) | ||
169 | { | ||
170 | /* allocate attribute structure, piggyback attribute name */ | ||
171 | int retval, nlen1, nlen2 = 0, res_count = 1; | ||
172 | unsigned long sparse_base, dense_base; | ||
173 | struct bin_attribute *attr; | ||
174 | struct pci_controller *hose = pdev->sysdata; | ||
175 | char *suffix, *attr_name; | ||
176 | |||
177 | suffix = ""; /* Assume bwx machine, normal resourceN files. */ | ||
178 | nlen1 = 10; | ||
179 | |||
180 | if (pdev->resource[num].flags & IORESOURCE_MEM) { | ||
181 | sparse_base = hose->sparse_mem_base; | ||
182 | dense_base = hose->dense_mem_base; | ||
183 | if (sparse_base && !sparse_mem_mmap_fits(pdev, num)) { | ||
184 | sparse_base = 0; | ||
185 | suffix = "_dense"; | ||
186 | nlen1 = 16; /* resourceN_dense */ | ||
187 | } | ||
188 | } else { | ||
189 | sparse_base = hose->sparse_io_base; | ||
190 | dense_base = hose->dense_io_base; | ||
191 | } | ||
192 | |||
193 | if (sparse_base) { | ||
194 | suffix = "_sparse"; | ||
195 | nlen1 = 17; | ||
196 | if (dense_base) { | ||
197 | nlen2 = 16; /* resourceN_dense */ | ||
198 | res_count = 2; | ||
199 | } | ||
200 | } | ||
201 | |||
202 | attr = kzalloc(sizeof(*attr) * res_count + nlen1 + nlen2, GFP_ATOMIC); | ||
203 | if (!attr) | ||
204 | return -ENOMEM; | ||
205 | |||
206 | /* Create bwx, sparse or single dense file */ | ||
207 | attr_name = (char *)(attr + res_count); | ||
208 | pdev->res_attr[num] = attr; | ||
209 | retval = pci_create_one_attr(pdev, num, attr_name, suffix, attr, | ||
210 | sparse_base); | ||
211 | if (retval || res_count == 1) | ||
212 | return retval; | ||
213 | |||
214 | /* Create dense file */ | ||
215 | attr_name += nlen1; | ||
216 | attr++; | ||
217 | pdev->res_attr_wc[num] = attr; | ||
218 | return pci_create_one_attr(pdev, num, attr_name, "_dense", attr, 0); | ||
219 | } | ||
220 | |||
221 | /** | ||
222 | * pci_create_resource_files - create resource files in sysfs for @dev | ||
223 | * @dev: dev in question | ||
224 | * | ||
225 | * Walk the resources in @dev creating files for each resource available. | ||
226 | */ | ||
227 | int pci_create_resource_files(struct pci_dev *pdev) | ||
228 | { | ||
229 | int i; | ||
230 | int retval; | ||
231 | |||
232 | /* Expose the PCI resources from this device as files */ | ||
233 | for (i = 0; i < PCI_ROM_RESOURCE; i++) { | ||
234 | |||
235 | /* skip empty resources */ | ||
236 | if (!pci_resource_len(pdev, i)) | ||
237 | continue; | ||
238 | |||
239 | retval = pci_create_attr(pdev, i); | ||
240 | if (retval) { | ||
241 | pci_remove_resource_files(pdev); | ||
242 | return retval; | ||
243 | } | ||
244 | } | ||
245 | return 0; | ||
246 | } | ||
247 | |||
248 | /* Legacy I/O bus mapping stuff. */ | ||
249 | |||
250 | static int __legacy_mmap_fits(struct pci_controller *hose, | ||
251 | struct vm_area_struct *vma, | ||
252 | unsigned long res_size, int sparse) | ||
253 | { | ||
254 | unsigned long nr, start, size; | ||
255 | |||
256 | nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; | ||
257 | start = vma->vm_pgoff; | ||
258 | size = ((res_size - 1) >> PAGE_SHIFT) + 1; | ||
259 | |||
260 | if (start < size && size - start >= nr) | ||
261 | return 1; | ||
262 | WARN(1, "process \"%s\" tried to map%s 0x%08lx-0x%08lx on hose %d " | ||
263 | "(size 0x%08lx)\n", | ||
264 | current->comm, sparse ? " sparse" : "", start, start + nr, | ||
265 | hose->index, size); | ||
266 | return 0; | ||
267 | } | ||
268 | |||
269 | static inline int has_sparse(struct pci_controller *hose, | ||
270 | enum pci_mmap_state mmap_type) | ||
271 | { | ||
272 | unsigned long base; | ||
273 | |||
274 | base = (mmap_type == pci_mmap_mem) ? hose->sparse_mem_base : | ||
275 | hose->sparse_io_base; | ||
276 | |||
277 | return base != 0; | ||
278 | } | ||
279 | |||
280 | int pci_mmap_legacy_page_range(struct pci_bus *bus, struct vm_area_struct *vma, | ||
281 | enum pci_mmap_state mmap_type) | ||
282 | { | ||
283 | struct pci_controller *hose = bus->sysdata; | ||
284 | int sparse = has_sparse(hose, mmap_type); | ||
285 | unsigned long res_size; | ||
286 | |||
287 | res_size = (mmap_type == pci_mmap_mem) ? bus->legacy_mem->size : | ||
288 | bus->legacy_io->size; | ||
289 | if (!__legacy_mmap_fits(hose, vma, res_size, sparse)) | ||
290 | return -EINVAL; | ||
291 | |||
292 | return hose_mmap_page_range(hose, vma, mmap_type, sparse); | ||
293 | } | ||
294 | |||
295 | /** | ||
296 | * pci_adjust_legacy_attr - adjustment of legacy file attributes | ||
297 | * @b: bus to create files under | ||
298 | * @mmap_type: I/O port or memory | ||
299 | * | ||
300 | * Adjust file name and size for sparse mappings. | ||
301 | */ | ||
302 | void pci_adjust_legacy_attr(struct pci_bus *bus, enum pci_mmap_state mmap_type) | ||
303 | { | ||
304 | struct pci_controller *hose = bus->sysdata; | ||
305 | |||
306 | if (!has_sparse(hose, mmap_type)) | ||
307 | return; | ||
308 | |||
309 | if (mmap_type == pci_mmap_mem) { | ||
310 | bus->legacy_mem->attr.name = "legacy_mem_sparse"; | ||
311 | bus->legacy_mem->size <<= 5; | ||
312 | } else { | ||
313 | bus->legacy_io->attr.name = "legacy_io_sparse"; | ||
314 | bus->legacy_io->size <<= 5; | ||
315 | } | ||
316 | return; | ||
317 | } | ||
318 | |||
319 | /* Legacy I/O bus read/write functions */ | ||
320 | int pci_legacy_read(struct pci_bus *bus, loff_t port, u32 *val, size_t size) | ||
321 | { | ||
322 | struct pci_controller *hose = bus->sysdata; | ||
323 | |||
324 | port += hose->io_space->start; | ||
325 | |||
326 | switch(size) { | ||
327 | case 1: | ||
328 | *((u8 *)val) = inb(port); | ||
329 | return 1; | ||
330 | case 2: | ||
331 | if (port & 1) | ||
332 | return -EINVAL; | ||
333 | *((u16 *)val) = inw(port); | ||
334 | return 2; | ||
335 | case 4: | ||
336 | if (port & 3) | ||
337 | return -EINVAL; | ||
338 | *((u32 *)val) = inl(port); | ||
339 | return 4; | ||
340 | } | ||
341 | return -EINVAL; | ||
342 | } | ||
343 | |||
344 | int pci_legacy_write(struct pci_bus *bus, loff_t port, u32 val, size_t size) | ||
345 | { | ||
346 | struct pci_controller *hose = bus->sysdata; | ||
347 | |||
348 | port += hose->io_space->start; | ||
349 | |||
350 | switch(size) { | ||
351 | case 1: | ||
352 | outb(port, val); | ||
353 | return 1; | ||
354 | case 2: | ||
355 | if (port & 1) | ||
356 | return -EINVAL; | ||
357 | outw(port, val); | ||
358 | return 2; | ||
359 | case 4: | ||
360 | if (port & 3) | ||
361 | return -EINVAL; | ||
362 | outl(port, val); | ||
363 | return 4; | ||
364 | } | ||
365 | return -EINVAL; | ||
366 | } | ||
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index a3b938811400..a91ba28999b5 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c | |||
@@ -168,7 +168,7 @@ pcibios_align_resource(void *data, struct resource *res, | |||
168 | */ | 168 | */ |
169 | 169 | ||
170 | /* Align to multiple of size of minimum base. */ | 170 | /* Align to multiple of size of minimum base. */ |
171 | alignto = max(0x1000UL, align); | 171 | alignto = max_t(resource_size_t, 0x1000, align); |
172 | start = ALIGN(start, alignto); | 172 | start = ALIGN(start, alignto); |
173 | if (hose->sparse_mem_base && size <= 7 * 16*MB) { | 173 | if (hose->sparse_mem_base && size <= 7 * 16*MB) { |
174 | if (((start / (16*MB)) & 0x7) == 0) { | 174 | if (((start / (16*MB)) & 0x7) == 0) { |
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c index b9094da05d7a..bfb880af959d 100644 --- a/arch/alpha/kernel/pci_iommu.c +++ b/arch/alpha/kernel/pci_iommu.c | |||
@@ -247,7 +247,7 @@ pci_map_single_1(struct pci_dev *pdev, void *cpu_addr, size_t size, | |||
247 | && paddr + size <= __direct_map_size) { | 247 | && paddr + size <= __direct_map_size) { |
248 | ret = paddr + __direct_map_base; | 248 | ret = paddr + __direct_map_base; |
249 | 249 | ||
250 | DBGA2("pci_map_single: [%p,%lx] -> direct %lx from %p\n", | 250 | DBGA2("pci_map_single: [%p,%zx] -> direct %llx from %p\n", |
251 | cpu_addr, size, ret, __builtin_return_address(0)); | 251 | cpu_addr, size, ret, __builtin_return_address(0)); |
252 | 252 | ||
253 | return ret; | 253 | return ret; |
@@ -258,7 +258,7 @@ pci_map_single_1(struct pci_dev *pdev, void *cpu_addr, size_t size, | |||
258 | if (dac_allowed) { | 258 | if (dac_allowed) { |
259 | ret = paddr + alpha_mv.pci_dac_offset; | 259 | ret = paddr + alpha_mv.pci_dac_offset; |
260 | 260 | ||
261 | DBGA2("pci_map_single: [%p,%lx] -> DAC %lx from %p\n", | 261 | DBGA2("pci_map_single: [%p,%zx] -> DAC %llx from %p\n", |
262 | cpu_addr, size, ret, __builtin_return_address(0)); | 262 | cpu_addr, size, ret, __builtin_return_address(0)); |
263 | 263 | ||
264 | return ret; | 264 | return ret; |
@@ -299,7 +299,7 @@ pci_map_single_1(struct pci_dev *pdev, void *cpu_addr, size_t size, | |||
299 | ret = arena->dma_base + dma_ofs * PAGE_SIZE; | 299 | ret = arena->dma_base + dma_ofs * PAGE_SIZE; |
300 | ret += (unsigned long)cpu_addr & ~PAGE_MASK; | 300 | ret += (unsigned long)cpu_addr & ~PAGE_MASK; |
301 | 301 | ||
302 | DBGA2("pci_map_single: [%p,%lx] np %ld -> sg %lx from %p\n", | 302 | DBGA2("pci_map_single: [%p,%zx] np %ld -> sg %llx from %p\n", |
303 | cpu_addr, size, npages, ret, __builtin_return_address(0)); | 303 | cpu_addr, size, npages, ret, __builtin_return_address(0)); |
304 | 304 | ||
305 | return ret; | 305 | return ret; |
@@ -355,14 +355,14 @@ pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size, | |||
355 | && dma_addr < __direct_map_base + __direct_map_size) { | 355 | && dma_addr < __direct_map_base + __direct_map_size) { |
356 | /* Nothing to do. */ | 356 | /* Nothing to do. */ |
357 | 357 | ||
358 | DBGA2("pci_unmap_single: direct [%lx,%lx] from %p\n", | 358 | DBGA2("pci_unmap_single: direct [%llx,%zx] from %p\n", |
359 | dma_addr, size, __builtin_return_address(0)); | 359 | dma_addr, size, __builtin_return_address(0)); |
360 | 360 | ||
361 | return; | 361 | return; |
362 | } | 362 | } |
363 | 363 | ||
364 | if (dma_addr > 0xffffffff) { | 364 | if (dma_addr > 0xffffffff) { |
365 | DBGA2("pci64_unmap_single: DAC [%lx,%lx] from %p\n", | 365 | DBGA2("pci64_unmap_single: DAC [%llx,%zx] from %p\n", |
366 | dma_addr, size, __builtin_return_address(0)); | 366 | dma_addr, size, __builtin_return_address(0)); |
367 | return; | 367 | return; |
368 | } | 368 | } |
@@ -373,9 +373,9 @@ pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size, | |||
373 | 373 | ||
374 | dma_ofs = (dma_addr - arena->dma_base) >> PAGE_SHIFT; | 374 | dma_ofs = (dma_addr - arena->dma_base) >> PAGE_SHIFT; |
375 | if (dma_ofs * PAGE_SIZE >= arena->size) { | 375 | if (dma_ofs * PAGE_SIZE >= arena->size) { |
376 | printk(KERN_ERR "Bogus pci_unmap_single: dma_addr %lx " | 376 | printk(KERN_ERR "Bogus pci_unmap_single: dma_addr %llx " |
377 | " base %lx size %x\n", dma_addr, arena->dma_base, | 377 | " base %llx size %x\n", |
378 | arena->size); | 378 | dma_addr, arena->dma_base, arena->size); |
379 | return; | 379 | return; |
380 | BUG(); | 380 | BUG(); |
381 | } | 381 | } |
@@ -394,7 +394,7 @@ pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size, | |||
394 | 394 | ||
395 | spin_unlock_irqrestore(&arena->lock, flags); | 395 | spin_unlock_irqrestore(&arena->lock, flags); |
396 | 396 | ||
397 | DBGA2("pci_unmap_single: sg [%lx,%lx] np %ld from %p\n", | 397 | DBGA2("pci_unmap_single: sg [%llx,%zx] np %ld from %p\n", |
398 | dma_addr, size, npages, __builtin_return_address(0)); | 398 | dma_addr, size, npages, __builtin_return_address(0)); |
399 | } | 399 | } |
400 | EXPORT_SYMBOL(pci_unmap_single); | 400 | EXPORT_SYMBOL(pci_unmap_single); |
@@ -444,7 +444,7 @@ try_again: | |||
444 | goto try_again; | 444 | goto try_again; |
445 | } | 445 | } |
446 | 446 | ||
447 | DBGA2("pci_alloc_consistent: %lx -> [%p,%x] from %p\n", | 447 | DBGA2("pci_alloc_consistent: %zx -> [%p,%llx] from %p\n", |
448 | size, cpu_addr, *dma_addrp, __builtin_return_address(0)); | 448 | size, cpu_addr, *dma_addrp, __builtin_return_address(0)); |
449 | 449 | ||
450 | return cpu_addr; | 450 | return cpu_addr; |
@@ -464,7 +464,7 @@ pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu_addr, | |||
464 | pci_unmap_single(pdev, dma_addr, size, PCI_DMA_BIDIRECTIONAL); | 464 | pci_unmap_single(pdev, dma_addr, size, PCI_DMA_BIDIRECTIONAL); |
465 | free_pages((unsigned long)cpu_addr, get_order(size)); | 465 | free_pages((unsigned long)cpu_addr, get_order(size)); |
466 | 466 | ||
467 | DBGA2("pci_free_consistent: [%x,%lx] from %p\n", | 467 | DBGA2("pci_free_consistent: [%llx,%zx] from %p\n", |
468 | dma_addr, size, __builtin_return_address(0)); | 468 | dma_addr, size, __builtin_return_address(0)); |
469 | } | 469 | } |
470 | EXPORT_SYMBOL(pci_free_consistent); | 470 | EXPORT_SYMBOL(pci_free_consistent); |
@@ -551,7 +551,7 @@ sg_fill(struct device *dev, struct scatterlist *leader, struct scatterlist *end, | |||
551 | out->dma_address = paddr + __direct_map_base; | 551 | out->dma_address = paddr + __direct_map_base; |
552 | out->dma_length = size; | 552 | out->dma_length = size; |
553 | 553 | ||
554 | DBGA(" sg_fill: [%p,%lx] -> direct %lx\n", | 554 | DBGA(" sg_fill: [%p,%lx] -> direct %llx\n", |
555 | __va(paddr), size, out->dma_address); | 555 | __va(paddr), size, out->dma_address); |
556 | 556 | ||
557 | return 0; | 557 | return 0; |
@@ -563,7 +563,7 @@ sg_fill(struct device *dev, struct scatterlist *leader, struct scatterlist *end, | |||
563 | out->dma_address = paddr + alpha_mv.pci_dac_offset; | 563 | out->dma_address = paddr + alpha_mv.pci_dac_offset; |
564 | out->dma_length = size; | 564 | out->dma_length = size; |
565 | 565 | ||
566 | DBGA(" sg_fill: [%p,%lx] -> DAC %lx\n", | 566 | DBGA(" sg_fill: [%p,%lx] -> DAC %llx\n", |
567 | __va(paddr), size, out->dma_address); | 567 | __va(paddr), size, out->dma_address); |
568 | 568 | ||
569 | return 0; | 569 | return 0; |
@@ -589,7 +589,7 @@ sg_fill(struct device *dev, struct scatterlist *leader, struct scatterlist *end, | |||
589 | out->dma_address = arena->dma_base + dma_ofs*PAGE_SIZE + paddr; | 589 | out->dma_address = arena->dma_base + dma_ofs*PAGE_SIZE + paddr; |
590 | out->dma_length = size; | 590 | out->dma_length = size; |
591 | 591 | ||
592 | DBGA(" sg_fill: [%p,%lx] -> sg %lx np %ld\n", | 592 | DBGA(" sg_fill: [%p,%lx] -> sg %llx np %ld\n", |
593 | __va(paddr), size, out->dma_address, npages); | 593 | __va(paddr), size, out->dma_address, npages); |
594 | 594 | ||
595 | /* All virtually contiguous. We need to find the length of each | 595 | /* All virtually contiguous. We need to find the length of each |
@@ -752,7 +752,7 @@ pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents, | |||
752 | 752 | ||
753 | if (addr > 0xffffffff) { | 753 | if (addr > 0xffffffff) { |
754 | /* It's a DAC address -- nothing to do. */ | 754 | /* It's a DAC address -- nothing to do. */ |
755 | DBGA(" (%ld) DAC [%lx,%lx]\n", | 755 | DBGA(" (%ld) DAC [%llx,%zx]\n", |
756 | sg - end + nents, addr, size); | 756 | sg - end + nents, addr, size); |
757 | continue; | 757 | continue; |
758 | } | 758 | } |
@@ -760,12 +760,12 @@ pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents, | |||
760 | if (addr >= __direct_map_base | 760 | if (addr >= __direct_map_base |
761 | && addr < __direct_map_base + __direct_map_size) { | 761 | && addr < __direct_map_base + __direct_map_size) { |
762 | /* Nothing to do. */ | 762 | /* Nothing to do. */ |
763 | DBGA(" (%ld) direct [%lx,%lx]\n", | 763 | DBGA(" (%ld) direct [%llx,%zx]\n", |
764 | sg - end + nents, addr, size); | 764 | sg - end + nents, addr, size); |
765 | continue; | 765 | continue; |
766 | } | 766 | } |
767 | 767 | ||
768 | DBGA(" (%ld) sg [%lx,%lx]\n", | 768 | DBGA(" (%ld) sg [%llx,%zx]\n", |
769 | sg - end + nents, addr, size); | 769 | sg - end + nents, addr, size); |
770 | 770 | ||
771 | npages = iommu_num_pages(addr, size, PAGE_SIZE); | 771 | npages = iommu_num_pages(addr, size, PAGE_SIZE); |
diff --git a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h index fe14c6747cd6..567f2598d090 100644 --- a/arch/alpha/kernel/proto.h +++ b/arch/alpha/kernel/proto.h | |||
@@ -20,7 +20,7 @@ struct pci_controller; | |||
20 | extern struct pci_ops apecs_pci_ops; | 20 | extern struct pci_ops apecs_pci_ops; |
21 | extern void apecs_init_arch(void); | 21 | extern void apecs_init_arch(void); |
22 | extern void apecs_pci_clr_err(void); | 22 | extern void apecs_pci_clr_err(void); |
23 | extern void apecs_machine_check(u64, u64); | 23 | extern void apecs_machine_check(unsigned long vector, unsigned long la_ptr); |
24 | extern void apecs_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); | 24 | extern void apecs_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); |
25 | 25 | ||
26 | /* core_cia.c */ | 26 | /* core_cia.c */ |
@@ -29,7 +29,7 @@ extern void cia_init_pci(void); | |||
29 | extern void cia_init_arch(void); | 29 | extern void cia_init_arch(void); |
30 | extern void pyxis_init_arch(void); | 30 | extern void pyxis_init_arch(void); |
31 | extern void cia_kill_arch(int); | 31 | extern void cia_kill_arch(int); |
32 | extern void cia_machine_check(u64, u64); | 32 | extern void cia_machine_check(unsigned long vector, unsigned long la_ptr); |
33 | extern void cia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); | 33 | extern void cia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); |
34 | 34 | ||
35 | /* core_irongate.c */ | 35 | /* core_irongate.c */ |
@@ -42,7 +42,7 @@ extern void irongate_machine_check(u64, u64); | |||
42 | /* core_lca.c */ | 42 | /* core_lca.c */ |
43 | extern struct pci_ops lca_pci_ops; | 43 | extern struct pci_ops lca_pci_ops; |
44 | extern void lca_init_arch(void); | 44 | extern void lca_init_arch(void); |
45 | extern void lca_machine_check(u64, u64); | 45 | extern void lca_machine_check(unsigned long vector, unsigned long la_ptr); |
46 | extern void lca_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); | 46 | extern void lca_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); |
47 | 47 | ||
48 | /* core_marvel.c */ | 48 | /* core_marvel.c */ |
@@ -64,7 +64,7 @@ void io7_clear_errors(struct io7 *io7); | |||
64 | extern struct pci_ops mcpcia_pci_ops; | 64 | extern struct pci_ops mcpcia_pci_ops; |
65 | extern void mcpcia_init_arch(void); | 65 | extern void mcpcia_init_arch(void); |
66 | extern void mcpcia_init_hoses(void); | 66 | extern void mcpcia_init_hoses(void); |
67 | extern void mcpcia_machine_check(u64, u64); | 67 | extern void mcpcia_machine_check(unsigned long vector, unsigned long la_ptr); |
68 | extern void mcpcia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); | 68 | extern void mcpcia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); |
69 | 69 | ||
70 | /* core_polaris.c */ | 70 | /* core_polaris.c */ |
@@ -72,14 +72,14 @@ extern struct pci_ops polaris_pci_ops; | |||
72 | extern int polaris_read_config_dword(struct pci_dev *, int, u32 *); | 72 | extern int polaris_read_config_dword(struct pci_dev *, int, u32 *); |
73 | extern int polaris_write_config_dword(struct pci_dev *, int, u32); | 73 | extern int polaris_write_config_dword(struct pci_dev *, int, u32); |
74 | extern void polaris_init_arch(void); | 74 | extern void polaris_init_arch(void); |
75 | extern void polaris_machine_check(u64, u64); | 75 | extern void polaris_machine_check(unsigned long vector, unsigned long la_ptr); |
76 | #define polaris_pci_tbi ((void *)0) | 76 | #define polaris_pci_tbi ((void *)0) |
77 | 77 | ||
78 | /* core_t2.c */ | 78 | /* core_t2.c */ |
79 | extern struct pci_ops t2_pci_ops; | 79 | extern struct pci_ops t2_pci_ops; |
80 | extern void t2_init_arch(void); | 80 | extern void t2_init_arch(void); |
81 | extern void t2_kill_arch(int); | 81 | extern void t2_kill_arch(int); |
82 | extern void t2_machine_check(u64, u64); | 82 | extern void t2_machine_check(unsigned long vector, unsigned long la_ptr); |
83 | extern void t2_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); | 83 | extern void t2_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); |
84 | 84 | ||
85 | /* core_titan.c */ | 85 | /* core_titan.c */ |
@@ -94,14 +94,14 @@ extern struct _alpha_agp_info *titan_agp_info(void); | |||
94 | extern struct pci_ops tsunami_pci_ops; | 94 | extern struct pci_ops tsunami_pci_ops; |
95 | extern void tsunami_init_arch(void); | 95 | extern void tsunami_init_arch(void); |
96 | extern void tsunami_kill_arch(int); | 96 | extern void tsunami_kill_arch(int); |
97 | extern void tsunami_machine_check(u64, u64); | 97 | extern void tsunami_machine_check(unsigned long vector, unsigned long la_ptr); |
98 | extern void tsunami_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); | 98 | extern void tsunami_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); |
99 | 99 | ||
100 | /* core_wildfire.c */ | 100 | /* core_wildfire.c */ |
101 | extern struct pci_ops wildfire_pci_ops; | 101 | extern struct pci_ops wildfire_pci_ops; |
102 | extern void wildfire_init_arch(void); | 102 | extern void wildfire_init_arch(void); |
103 | extern void wildfire_kill_arch(int); | 103 | extern void wildfire_kill_arch(int); |
104 | extern void wildfire_machine_check(u64, u64); | 104 | extern void wildfire_machine_check(unsigned long vector, unsigned long la_ptr); |
105 | extern void wildfire_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); | 105 | extern void wildfire_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); |
106 | extern int wildfire_pa_to_nid(unsigned long); | 106 | extern int wildfire_pa_to_nid(unsigned long); |
107 | extern int wildfire_cpuid_to_nid(int); | 107 | extern int wildfire_cpuid_to_nid(int); |
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index 02bee6983ce2..80df86cd746b 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c | |||
@@ -1255,7 +1255,7 @@ show_cpuinfo(struct seq_file *f, void *slot) | |||
1255 | platform_string(), nr_processors); | 1255 | platform_string(), nr_processors); |
1256 | 1256 | ||
1257 | #ifdef CONFIG_SMP | 1257 | #ifdef CONFIG_SMP |
1258 | seq_printf(f, "cpus active\t\t: %d\n" | 1258 | seq_printf(f, "cpus active\t\t: %u\n" |
1259 | "cpu active mask\t\t: %016lx\n", | 1259 | "cpu active mask\t\t: %016lx\n", |
1260 | num_online_cpus(), cpus_addr(cpu_possible_map)[0]); | 1260 | num_online_cpus(), cpus_addr(cpu_possible_map)[0]); |
1261 | #endif | 1261 | #endif |
diff --git a/arch/alpha/kernel/smc37c669.c b/arch/alpha/kernel/smc37c669.c index fd467b207f0f..bca5bda90cde 100644 --- a/arch/alpha/kernel/smc37c669.c +++ b/arch/alpha/kernel/smc37c669.c | |||
@@ -2542,8 +2542,8 @@ void __init SMC669_Init ( int index ) | |||
2542 | SMC37c669_display_device_info( ); | 2542 | SMC37c669_display_device_info( ); |
2543 | #endif | 2543 | #endif |
2544 | local_irq_restore(flags); | 2544 | local_irq_restore(flags); |
2545 | printk( "SMC37c669 Super I/O Controller found @ 0x%lx\n", | 2545 | printk( "SMC37c669 Super I/O Controller found @ 0x%p\n", |
2546 | (unsigned long) SMC_base ); | 2546 | SMC_base ); |
2547 | } | 2547 | } |
2548 | else { | 2548 | else { |
2549 | local_irq_restore(flags); | 2549 | local_irq_restore(flags); |
diff --git a/arch/alpha/kernel/sys_jensen.c b/arch/alpha/kernel/sys_jensen.c index e2516f9a8967..2b5caf3d9b15 100644 --- a/arch/alpha/kernel/sys_jensen.c +++ b/arch/alpha/kernel/sys_jensen.c | |||
@@ -244,12 +244,11 @@ jensen_init_arch(void) | |||
244 | } | 244 | } |
245 | 245 | ||
246 | static void | 246 | static void |
247 | jensen_machine_check (u64 vector, u64 la) | 247 | jensen_machine_check(unsigned long vector, unsigned long la) |
248 | { | 248 | { |
249 | printk(KERN_CRIT "Machine check\n"); | 249 | printk(KERN_CRIT "Machine check\n"); |
250 | } | 250 | } |
251 | 251 | ||
252 | |||
253 | /* | 252 | /* |
254 | * The System Vector | 253 | * The System Vector |
255 | */ | 254 | */ |
diff --git a/arch/alpha/kernel/sys_sable.c b/arch/alpha/kernel/sys_sable.c index d232e42be018..9e263256a42d 100644 --- a/arch/alpha/kernel/sys_sable.c +++ b/arch/alpha/kernel/sys_sable.c | |||
@@ -453,7 +453,7 @@ sable_lynx_enable_irq(unsigned int irq) | |||
453 | sable_lynx_irq_swizzle->update_irq_hw(bit, mask); | 453 | sable_lynx_irq_swizzle->update_irq_hw(bit, mask); |
454 | spin_unlock(&sable_lynx_irq_lock); | 454 | spin_unlock(&sable_lynx_irq_lock); |
455 | #if 0 | 455 | #if 0 |
456 | printk("%s: mask 0x%lx bit 0x%x irq 0x%x\n", | 456 | printk("%s: mask 0x%lx bit 0x%lx irq 0x%x\n", |
457 | __func__, mask, bit, irq); | 457 | __func__, mask, bit, irq); |
458 | #endif | 458 | #endif |
459 | } | 459 | } |
@@ -469,7 +469,7 @@ sable_lynx_disable_irq(unsigned int irq) | |||
469 | sable_lynx_irq_swizzle->update_irq_hw(bit, mask); | 469 | sable_lynx_irq_swizzle->update_irq_hw(bit, mask); |
470 | spin_unlock(&sable_lynx_irq_lock); | 470 | spin_unlock(&sable_lynx_irq_lock); |
471 | #if 0 | 471 | #if 0 |
472 | printk("%s: mask 0x%lx bit 0x%x irq 0x%x\n", | 472 | printk("%s: mask 0x%lx bit 0x%lx irq 0x%x\n", |
473 | __func__, mask, bit, irq); | 473 | __func__, mask, bit, irq); |
474 | #endif | 474 | #endif |
475 | } | 475 | } |
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c index cefc5a355ef9..6ee7655b7568 100644 --- a/arch/alpha/kernel/traps.c +++ b/arch/alpha/kernel/traps.c | |||
@@ -623,7 +623,7 @@ do_entUna(void * va, unsigned long opcode, unsigned long reg, | |||
623 | } | 623 | } |
624 | 624 | ||
625 | lock_kernel(); | 625 | lock_kernel(); |
626 | printk("Bad unaligned kernel access at %016lx: %p %lx %ld\n", | 626 | printk("Bad unaligned kernel access at %016lx: %p %lx %lu\n", |
627 | pc, va, opcode, reg); | 627 | pc, va, opcode, reg); |
628 | do_exit(SIGSEGV); | 628 | do_exit(SIGSEGV); |
629 | 629 | ||