Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'next-remove-ldst' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc into next

+139 -190
+6 -6
arch/powerpc/include/asm/dbdma.h
··· 42 42 * DBDMA command structure. These fields are all little-endian! 43 43 */ 44 44 struct dbdma_cmd { 45 - unsigned short req_count; /* requested byte transfer count */ 46 - unsigned short command; /* command word (has bit-fields) */ 47 - unsigned int phy_addr; /* physical data address */ 48 - unsigned int cmd_dep; /* command-dependent field */ 49 - unsigned short res_count; /* residual count after completion */ 50 - unsigned short xfer_status; /* transfer status */ 45 + __le16 req_count; /* requested byte transfer count */ 46 + __le16 command; /* command word (has bit-fields) */ 47 + __le32 phy_addr; /* physical data address */ 48 + __le32 cmd_dep; /* command-dependent field */ 49 + __le16 res_count; /* residual count after completion */ 50 + __le16 xfer_status; /* transfer status */ 51 51 }; 52 52 53 53 /* DBDMA command values in command field */
+1 -1
arch/powerpc/include/asm/kvm_host.h
··· 585 585 pgd_t *pgdir; 586 586 587 587 u8 io_gpr; /* GPR used as IO source/target */ 588 - u8 mmio_is_bigendian; 588 + u8 mmio_host_swabbed; 589 589 u8 mmio_sign_extend; 590 590 u8 osi_needed; 591 591 u8 osi_enabled;
-26
arch/powerpc/include/asm/swab.h
··· 9 9 10 10 #include <uapi/asm/swab.h> 11 11 12 - static __inline__ __u16 ld_le16(const volatile __u16 *addr) 13 - { 14 - __u16 val; 15 - 16 - __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr)); 17 - return val; 18 - } 19 - 20 - static __inline__ void st_le16(volatile __u16 *addr, const __u16 val) 21 - { 22 - __asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); 23 - } 24 - 25 - static __inline__ __u32 ld_le32(const volatile __u32 *addr) 26 - { 27 - __u32 val; 28 - 29 - __asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr)); 30 - return val; 31 - } 32 - 33 - static __inline__ void st_le32(volatile __u32 *addr, const __u32 val) 34 - { 35 - __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); 36 - } 37 - 38 12 #endif /* _ASM_POWERPC_SWAB_H */
+2 -2
arch/powerpc/include/asm/vga.h
··· 25 25 26 26 static inline void scr_writew(u16 val, volatile u16 *addr) 27 27 { 28 - st_le16(addr, val); 28 + *addr = cpu_to_le16(val); 29 29 } 30 30 31 31 static inline u16 scr_readw(volatile const u16 *addr) 32 32 { 33 - return ld_le16(addr); 33 + return le16_to_cpu(*addr); 34 34 } 35 35 36 36 #define VT_BUF_HAVE_MEMCPYW
+18 -20
arch/powerpc/kvm/powerpc.c
··· 720 720 return; 721 721 } 722 722 723 - if (vcpu->arch.mmio_is_bigendian) { 723 + if (!vcpu->arch.mmio_host_swabbed) { 724 724 switch (run->mmio.len) { 725 725 case 8: gpr = *(u64 *)run->mmio.data; break; 726 726 case 4: gpr = *(u32 *)run->mmio.data; break; ··· 728 728 case 1: gpr = *(u8 *)run->mmio.data; break; 729 729 } 730 730 } else { 731 - /* Convert BE data from userland back to LE. */ 732 731 switch (run->mmio.len) { 733 - case 4: gpr = ld_le32((u32 *)run->mmio.data); break; 734 - case 2: gpr = ld_le16((u16 *)run->mmio.data); break; 732 + case 8: gpr = swab64(*(u64 *)run->mmio.data); break; 733 + case 4: gpr = swab32(*(u32 *)run->mmio.data); break; 734 + case 2: gpr = swab16(*(u16 *)run->mmio.data); break; 735 735 case 1: gpr = *(u8 *)run->mmio.data; break; 736 736 } 737 737 } ··· 780 780 int is_default_endian) 781 781 { 782 782 int idx, ret; 783 - int is_bigendian; 783 + bool host_swabbed; 784 784 785 + /* Pity C doesn't have a logical XOR operator */ 785 786 if (kvmppc_need_byteswap(vcpu)) { 786 - /* Default endianness is "little endian". */ 787 - is_bigendian = !is_default_endian; 787 + host_swabbed = is_default_endian; 788 788 } else { 789 - /* Default endianness is "big endian". */ 790 - is_bigendian = is_default_endian; 789 + host_swabbed = !is_default_endian; 791 790 } 792 791 793 792 if (bytes > sizeof(run->mmio.data)) { ··· 799 800 run->mmio.is_write = 0; 800 801 801 802 vcpu->arch.io_gpr = rt; 802 - vcpu->arch.mmio_is_bigendian = is_bigendian; 803 + vcpu->arch.mmio_host_swabbed = host_swabbed; 803 804 vcpu->mmio_needed = 1; 804 805 vcpu->mmio_is_write = 0; 805 806 vcpu->arch.mmio_sign_extend = 0; ··· 839 840 { 840 841 void *data = run->mmio.data; 841 842 int idx, ret; 842 - int is_bigendian; 843 + bool host_swabbed; 843 844 845 + /* Pity C doesn't have a logical XOR operator */ 844 846 if (kvmppc_need_byteswap(vcpu)) { 845 - /* Default endianness is "little endian". */ 846 - is_bigendian = !is_default_endian; 847 + host_swabbed = is_default_endian; 847 848 } else { 848 - /* Default endianness is "big endian". */ 849 - is_bigendian = is_default_endian; 849 + host_swabbed = !is_default_endian; 850 850 } 851 851 852 852 if (bytes > sizeof(run->mmio.data)) { ··· 860 862 vcpu->mmio_is_write = 1; 861 863 862 864 /* Store the value at the lowest bytes in 'data'. */ 863 - if (is_bigendian) { 865 + if (!host_swabbed) { 864 866 switch (bytes) { 865 867 case 8: *(u64 *)data = val; break; 866 868 case 4: *(u32 *)data = val; break; ··· 868 870 case 1: *(u8 *)data = val; break; 869 871 } 870 872 } else { 871 - /* Store LE value into 'data'. */ 872 873 switch (bytes) { 873 - case 4: st_le32(data, val); break; 874 - case 2: st_le16(data, val); break; 875 - case 1: *(u8 *)data = val; break; 874 + case 8: *(u64 *)data = swab64(val); break; 875 + case 4: *(u32 *)data = swab32(val); break; 876 + case 2: *(u16 *)data = swab16(val); break; 877 + case 1: *(u8 *)data = val; break; 876 878 } 877 879 } 878 880
+5 -5
drivers/ata/pata_macio.c
··· 540 540 BUG_ON (pi++ >= MAX_DCMDS); 541 541 542 542 len = (sg_len < MAX_DBDMA_SEG) ? sg_len : MAX_DBDMA_SEG; 543 - st_le16(&table->command, write ? OUTPUT_MORE: INPUT_MORE); 544 - st_le16(&table->req_count, len); 545 - st_le32(&table->phy_addr, addr); 543 + table->command = cpu_to_le16(write ? OUTPUT_MORE: INPUT_MORE); 544 + table->req_count = cpu_to_le16(len); 545 + table->phy_addr = cpu_to_le32(addr); 546 546 table->cmd_dep = 0; 547 547 table->xfer_status = 0; 548 548 table->res_count = 0; ··· 557 557 558 558 /* Convert the last command to an input/output */ 559 559 table--; 560 - st_le16(&table->command, write ? OUTPUT_LAST: INPUT_LAST); 560 + table->command = cpu_to_le16(write ? OUTPUT_LAST: INPUT_LAST); 561 561 table++; 562 562 563 563 /* Add the stop command to the end of the list */ 564 564 memset(table, 0, sizeof(struct dbdma_cmd)); 565 - st_le16(&table->command, DBDMA_STOP); 565 + table->command = cpu_to_le16(DBDMA_STOP); 566 566 567 567 dev_dbgdma(priv->dev, "%s: %d DMA list entries\n", __func__, pi); 568 568 }
+6 -6
drivers/block/swim3.c
··· 440 440 static inline void init_dma(struct dbdma_cmd *cp, int cmd, 441 441 void *buf, int count) 442 442 { 443 - st_le16(&cp->req_count, count); 444 - st_le16(&cp->command, cmd); 445 - st_le32(&cp->phy_addr, virt_to_bus(buf)); 443 + cp->req_count = cpu_to_le16(count); 444 + cp->command = cpu_to_le16(cmd); 445 + cp->phy_addr = cpu_to_le32(virt_to_bus(buf)); 446 446 cp->xfer_status = 0; 447 447 } 448 448 ··· 771 771 } 772 772 /* turn off DMA */ 773 773 out_le32(&dr->control, (RUN | PAUSE) << 16); 774 - stat = ld_le16(&cp->xfer_status); 775 - resid = ld_le16(&cp->res_count); 774 + stat = le16_to_cpu(cp->xfer_status); 775 + resid = le16_to_cpu(cp->res_count); 776 776 if (intr & ERROR_INTR) { 777 777 n = fs->scount - 1 - resid / 512; 778 778 if (n > 0) { ··· 1170 1170 1171 1171 fs->dma_cmd = (struct dbdma_cmd *) DBDMA_ALIGN(fs->dbdma_cmd_space); 1172 1172 memset(fs->dma_cmd, 0, 2 * sizeof(struct dbdma_cmd)); 1173 - st_le16(&fs->dma_cmd[1].command, DBDMA_STOP); 1173 + fs->dma_cmd[1].command = cpu_to_le16(DBDMA_STOP); 1174 1174 1175 1175 if (mdev->media_bay == NULL || check_media_bay(mdev->media_bay) == MB_FD) 1176 1176 swim3_mb_event(mdev, MB_FD);
+5 -5
drivers/ide/pmac.c
··· 1497 1497 drive->name); 1498 1498 return 0; 1499 1499 } 1500 - st_le16(&table->command, wr? OUTPUT_MORE: INPUT_MORE); 1501 - st_le16(&table->req_count, tc); 1502 - st_le32(&table->phy_addr, cur_addr); 1500 + table->command = cpu_to_le16(wr? OUTPUT_MORE: INPUT_MORE); 1501 + table->req_count = cpu_to_le16(tc); 1502 + table->phy_addr = cpu_to_le32(cur_addr); 1503 1503 table->cmd_dep = 0; 1504 1504 table->xfer_status = 0; 1505 1505 table->res_count = 0; ··· 1513 1513 1514 1514 /* convert the last command to an input/output last command */ 1515 1515 if (count) { 1516 - st_le16(&table[-1].command, wr? OUTPUT_LAST: INPUT_LAST); 1516 + table[-1].command = cpu_to_le16(wr? OUTPUT_LAST: INPUT_LAST); 1517 1517 /* add the stop command to the end of the list */ 1518 1518 memset(table, 0, sizeof(struct dbdma_cmd)); 1519 - st_le16(&table->command, DBDMA_STOP); 1519 + table->command = cpu_to_le16(DBDMA_STOP); 1520 1520 mb(); 1521 1521 writel(hwif->dmatable_dma, &dma->cmdptr); 1522 1522 return 1;
+15 -15
drivers/macintosh/rack-meter.c
··· 182 182 183 183 /* Prepare 4 dbdma commands for the 2 buffers */ 184 184 memset(cmd, 0, 4 * sizeof(struct dbdma_cmd)); 185 - st_le16(&cmd->req_count, 4); 186 - st_le16(&cmd->command, STORE_WORD | INTR_ALWAYS | KEY_SYSTEM); 187 - st_le32(&cmd->phy_addr, rm->dma_buf_p + 185 + cmd->req_count = cpu_to_le16(4); 186 + cmd->command = cpu_to_le16(STORE_WORD | INTR_ALWAYS | KEY_SYSTEM); 187 + cmd->phy_addr = cpu_to_le32(rm->dma_buf_p + 188 188 offsetof(struct rackmeter_dma, mark)); 189 - st_le32(&cmd->cmd_dep, 0x02000000); 189 + cmd->cmd_dep = cpu_to_le32(0x02000000); 190 190 cmd++; 191 191 192 - st_le16(&cmd->req_count, SAMPLE_COUNT * 4); 193 - st_le16(&cmd->command, OUTPUT_MORE); 194 - st_le32(&cmd->phy_addr, rm->dma_buf_p + 192 + cmd->req_count = cpu_to_le16(SAMPLE_COUNT * 4); 193 + cmd->command = cpu_to_le16(OUTPUT_MORE); 194 + cmd->phy_addr = cpu_to_le32(rm->dma_buf_p + 195 195 offsetof(struct rackmeter_dma, buf1)); 196 196 cmd++; 197 197 198 - st_le16(&cmd->req_count, 4); 199 - st_le16(&cmd->command, STORE_WORD | INTR_ALWAYS | KEY_SYSTEM); 200 - st_le32(&cmd->phy_addr, rm->dma_buf_p + 198 + cmd->req_count = cpu_to_le16(4); 199 + cmd->command = cpu_to_le16(STORE_WORD | INTR_ALWAYS | KEY_SYSTEM); 200 + cmd->phy_addr = cpu_to_le32(rm->dma_buf_p + 201 201 offsetof(struct rackmeter_dma, mark)); 202 - st_le32(&cmd->cmd_dep, 0x01000000); 202 + cmd->cmd_dep = cpu_to_le32(0x01000000); 203 203 cmd++; 204 204 205 - st_le16(&cmd->req_count, SAMPLE_COUNT * 4); 206 - st_le16(&cmd->command, OUTPUT_MORE | BR_ALWAYS); 207 - st_le32(&cmd->phy_addr, rm->dma_buf_p + 205 + cmd->req_count = cpu_to_le16(SAMPLE_COUNT * 4); 206 + cmd->command = cpu_to_le16(OUTPUT_MORE | BR_ALWAYS); 207 + cmd->phy_addr = cpu_to_le32(rm->dma_buf_p + 208 208 offsetof(struct rackmeter_dma, buf2)); 209 - st_le32(&cmd->cmd_dep, rm->dma_buf_p); 209 + cmd->cmd_dep = cpu_to_le32(rm->dma_buf_p); 210 210 211 211 rackmeter_do_pause(rm, 0); 212 212 }
-12
drivers/media/pci/bt8xx/bt878.c
··· 416 416 int result = 0; 417 417 unsigned char lat; 418 418 struct bt878 *bt; 419 - #if defined(__powerpc__) 420 - unsigned int cmd; 421 - #endif 422 419 unsigned int cardid; 423 420 424 421 printk(KERN_INFO "bt878: Bt878 AUDIO function found (%d).\n", ··· 457 460 PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); 458 461 printk("irq: %d, latency: %d, memory: 0x%lx\n", 459 462 bt->irq, lat, bt->bt878_adr); 460 - 461 - 462 - #if defined(__powerpc__) 463 - /* on OpenFirmware machines (PowerMac at least), PCI memory cycle */ 464 - /* response on cards with no firmware is not enabled by OF */ 465 - pci_read_config_dword(dev, PCI_COMMAND, &cmd); 466 - cmd = (cmd | PCI_COMMAND_MEMORY); 467 - pci_write_config_dword(dev, PCI_COMMAND, cmd); 468 - #endif 469 463 470 464 #ifdef __sparc__ 471 465 bt->bt878_mem = (unsigned char *) bt->bt878_adr;
-11
drivers/media/pci/bt8xx/bt878.h
··· 142 142 u32 irq_err_ignore); 143 143 void bt878_stop(struct bt878 *bt); 144 144 145 - #if defined(__powerpc__) /* big-endian */ 146 - static inline void io_st_le32(volatile unsigned __iomem *addr, unsigned val) 147 - { 148 - st_le32(addr, val); 149 - eieio(); 150 - } 151 - 152 - #define bmtwrite(dat,adr) io_st_le32((adr),(dat)) 153 - #define bmtread(adr) ld_le32((adr)) 154 - #else 155 145 #define bmtwrite(dat,adr) writel((dat), (adr)) 156 146 #define bmtread(adr) readl(adr) 157 - #endif 158 147 159 148 #endif
+1 -1
drivers/mmc/host/mxcmmc.c
··· 281 281 int i; 282 282 283 283 for (i = 0; i < ((len + 3) / 4); i++) { 284 - st_le32(buf, *buf); 284 + *buf = swab32(*buf); 285 285 buf++; 286 286 } 287 287 }
+15 -15
drivers/net/ethernet/apple/bmac.c
··· 483 483 bmwrite(dev, TXCFG, (config & ~TxMACEnable)); 484 484 bmwrite(dev, INTDISABLE, DisableAll); /* disable all intrs */ 485 485 /* disable rx and tx dma */ 486 - st_le32(&rd->control, DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */ 487 - st_le32(&td->control, DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */ 486 + rd->control = cpu_to_le32(DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */ 487 + td->control = cpu_to_le32(DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */ 488 488 /* free some skb's */ 489 489 for (i=0; i<N_RX_RING; i++) { 490 490 if (bp->rx_bufs[i] != NULL) { ··· 699 699 700 700 while (1) { 701 701 cp = &bp->rx_cmds[i]; 702 - stat = ld_le16(&cp->xfer_status); 703 - residual = ld_le16(&cp->res_count); 702 + stat = le16_to_cpu(cp->xfer_status); 703 + residual = le16_to_cpu(cp->res_count); 704 704 if ((stat & ACTIVE) == 0) 705 705 break; 706 706 nb = RX_BUFLEN - residual - 2; ··· 728 728 skb_reserve(bp->rx_bufs[i], 2); 729 729 } 730 730 bmac_construct_rxbuff(skb, &bp->rx_cmds[i]); 731 - st_le16(&cp->res_count, 0); 732 - st_le16(&cp->xfer_status, 0); 731 + cp->res_count = cpu_to_le16(0); 732 + cp->xfer_status = cpu_to_le16(0); 733 733 last = i; 734 734 if (++i >= N_RX_RING) i = 0; 735 735 } ··· 769 769 770 770 while (1) { 771 771 cp = &bp->tx_cmds[bp->tx_empty]; 772 - stat = ld_le16(&cp->xfer_status); 772 + stat = le16_to_cpu(cp->xfer_status); 773 773 if (txintcount < 10) { 774 774 XXDEBUG(("bmac_txdma_xfer_stat=%#0x\n", stat)); 775 775 } ··· 1411 1411 bmwrite(dev, INTDISABLE, DisableAll); /* disable all intrs */ 1412 1412 1413 1413 /* disable rx and tx dma */ 1414 - st_le32(&rd->control, DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */ 1415 - st_le32(&td->control, DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */ 1414 + rd->control = cpu_to_le32(DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */ 1415 + td->control = cpu_to_le32(DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */ 1416 1416 1417 1417 /* free some skb's */ 1418 1418 XXDEBUG(("bmac: free rx bufs\n")); ··· 1493 1493 1494 1494 cp = &bp->tx_cmds[bp->tx_empty]; 1495 1495 /* XXDEBUG((KERN_DEBUG "bmac: tx dmastat=%x %x runt=%d pr=%x fs=%x fc=%x\n", */ 1496 - /* ld_le32(&td->status), ld_le16(&cp->xfer_status), bp->tx_bad_runt, */ 1496 + /* le32_to_cpu(td->status), le16_to_cpu(cp->xfer_status), bp->tx_bad_runt, */ 1497 1497 /* mb->pr, mb->xmtfs, mb->fifofc)); */ 1498 1498 1499 1499 /* turn off both tx and rx and reset the chip */ ··· 1506 1506 bmac_enable_and_reset_chip(dev); 1507 1507 1508 1508 /* restart rx dma */ 1509 - cp = bus_to_virt(ld_le32(&rd->cmdptr)); 1509 + cp = bus_to_virt(le32_to_cpu(rd->cmdptr)); 1510 1510 out_le32(&rd->control, DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE|ACTIVE|DEAD)); 1511 1511 out_le16(&cp->xfer_status, 0); 1512 1512 out_le32(&rd->cmdptr, virt_to_bus(cp)); ··· 1553 1553 ip = (int*)(cp+i); 1554 1554 1555 1555 printk("dbdma req 0x%x addr 0x%x baddr 0x%x xfer/res 0x%x\n", 1556 - ld_le32(ip+0), 1557 - ld_le32(ip+1), 1558 - ld_le32(ip+2), 1559 - ld_le32(ip+3)); 1556 + le32_to_cpup(ip+0), 1557 + le32_to_cpup(ip+1), 1558 + le32_to_cpup(ip+2), 1559 + le32_to_cpup(ip+3)); 1560 1560 } 1561 1561 1562 1562 }
+22 -22
drivers/net/ethernet/apple/mace.c
··· 310 310 * way on some machines. 311 311 */ 312 312 for (i = 200; i > 0; --i) 313 - if (ld_le32(&dma->control) & RUN) 313 + if (le32_to_cpu(dma->control) & RUN) 314 314 udelay(1); 315 315 } 316 316 ··· 452 452 data = skb->data; 453 453 } 454 454 mp->rx_bufs[i] = skb; 455 - st_le16(&cp->req_count, RX_BUFLEN); 456 - st_le16(&cp->command, INPUT_LAST + INTR_ALWAYS); 457 - st_le32(&cp->phy_addr, virt_to_bus(data)); 455 + cp->req_count = cpu_to_le16(RX_BUFLEN); 456 + cp->command = cpu_to_le16(INPUT_LAST + INTR_ALWAYS); 457 + cp->phy_addr = cpu_to_le32(virt_to_bus(data)); 458 458 cp->xfer_status = 0; 459 459 ++cp; 460 460 } 461 461 mp->rx_bufs[i] = NULL; 462 - st_le16(&cp->command, DBDMA_STOP); 462 + cp->command = cpu_to_le16(DBDMA_STOP); 463 463 mp->rx_fill = i; 464 464 mp->rx_empty = 0; 465 465 466 466 /* Put a branch back to the beginning of the receive command list */ 467 467 ++cp; 468 - st_le16(&cp->command, DBDMA_NOP + BR_ALWAYS); 469 - st_le32(&cp->cmd_dep, virt_to_bus(mp->rx_cmds)); 468 + cp->command = cpu_to_le16(DBDMA_NOP + BR_ALWAYS); 469 + cp->cmd_dep = cpu_to_le32(virt_to_bus(mp->rx_cmds)); 470 470 471 471 /* start rx dma */ 472 472 out_le32(&rd->control, (RUN|PAUSE|FLUSH|WAKE) << 16); /* clear run bit */ ··· 475 475 476 476 /* put a branch at the end of the tx command list */ 477 477 cp = mp->tx_cmds + NCMDS_TX * N_TX_RING; 478 - st_le16(&cp->command, DBDMA_NOP + BR_ALWAYS); 479 - st_le32(&cp->cmd_dep, virt_to_bus(mp->tx_cmds)); 478 + cp->command = cpu_to_le16(DBDMA_NOP + BR_ALWAYS); 479 + cp->cmd_dep = cpu_to_le32(virt_to_bus(mp->tx_cmds)); 480 480 481 481 /* reset tx dma */ 482 482 out_le32(&td->control, (RUN|PAUSE|FLUSH|WAKE) << 16); ··· 507 507 out_8(&mb->imr, 0xff); /* disable all intrs */ 508 508 509 509 /* disable rx and tx dma */ 510 - st_le32(&rd->control, (RUN|PAUSE|FLUSH|WAKE) << 16); /* clear run bit */ 511 - st_le32(&td->control, (RUN|PAUSE|FLUSH|WAKE) << 16); /* clear run bit */ 510 + rd->control = cpu_to_le32((RUN|PAUSE|FLUSH|WAKE) << 16); /* clear run bit */ 511 + td->control = cpu_to_le32((RUN|PAUSE|FLUSH|WAKE) << 16); /* clear run bit */ 512 512 513 513 mace_clean_rings(mp); 514 514 ··· 558 558 } 559 559 mp->tx_bufs[fill] = skb; 560 560 cp = mp->tx_cmds + NCMDS_TX * fill; 561 - st_le16(&cp->req_count, len); 562 - st_le32(&cp->phy_addr, virt_to_bus(skb->data)); 561 + cp->req_count = cpu_to_le16(len); 562 + cp->phy_addr = cpu_to_le32(virt_to_bus(skb->data)); 563 563 564 564 np = mp->tx_cmds + NCMDS_TX * next; 565 565 out_le16(&np->command, DBDMA_STOP); ··· 691 691 out_8(&mb->xmtfc, AUTO_PAD_XMIT); 692 692 continue; 693 693 } 694 - dstat = ld_le32(&td->status); 694 + dstat = le32_to_cpu(td->status); 695 695 /* stop DMA controller */ 696 696 out_le32(&td->control, RUN << 16); 697 697 /* ··· 724 724 */ 725 725 } 726 726 cp = mp->tx_cmds + NCMDS_TX * i; 727 - stat = ld_le16(&cp->xfer_status); 727 + stat = le16_to_cpu(cp->xfer_status); 728 728 if ((fs & (UFLO|LCOL|LCAR|RTRY)) || (dstat & DEAD) || xcount == 0) { 729 729 /* 730 730 * Check whether there were in fact 2 bytes written to ··· 830 830 mace_reset(dev); 831 831 832 832 /* restart rx dma */ 833 - cp = bus_to_virt(ld_le32(&rd->cmdptr)); 833 + cp = bus_to_virt(le32_to_cpu(rd->cmdptr)); 834 834 dbdma_reset(rd); 835 835 out_le16(&cp->xfer_status, 0); 836 836 out_le32(&rd->cmdptr, virt_to_bus(cp)); ··· 889 889 spin_lock_irqsave(&mp->lock, flags); 890 890 for (i = mp->rx_empty; i != mp->rx_fill; ) { 891 891 cp = mp->rx_cmds + i; 892 - stat = ld_le16(&cp->xfer_status); 892 + stat = le16_to_cpu(cp->xfer_status); 893 893 if ((stat & ACTIVE) == 0) { 894 894 next = i + 1; 895 895 if (next >= N_RX_RING) 896 896 next = 0; 897 897 np = mp->rx_cmds + next; 898 898 if (next != mp->rx_fill && 899 - (ld_le16(&np->xfer_status) & ACTIVE) != 0) { 899 + (le16_to_cpu(np->xfer_status) & ACTIVE) != 0) { 900 900 printk(KERN_DEBUG "mace: lost a status word\n"); 901 901 ++mace_lost_status; 902 902 } else 903 903 break; 904 904 } 905 - nb = ld_le16(&cp->req_count) - ld_le16(&cp->res_count); 905 + nb = le16_to_cpu(cp->req_count) - le16_to_cpu(cp->res_count); 906 906 out_le16(&cp->command, DBDMA_STOP); 907 907 /* got a packet, have a look at it */ 908 908 skb = mp->rx_bufs[i]; ··· 962 962 mp->rx_bufs[i] = skb; 963 963 } 964 964 } 965 - st_le16(&cp->req_count, RX_BUFLEN); 965 + cp->req_count = cpu_to_le16(RX_BUFLEN); 966 966 data = skb? skb->data: dummy_buf; 967 - st_le32(&cp->phy_addr, virt_to_bus(data)); 967 + cp->phy_addr = cpu_to_le32(virt_to_bus(data)); 968 968 out_le16(&cp->xfer_status, 0); 969 969 out_le16(&cp->command, INPUT_LAST + INTR_ALWAYS); 970 970 #if 0 971 - if ((ld_le32(&rd->status) & ACTIVE) != 0) { 971 + if ((le32_to_cpu(rd->status) & ACTIVE) != 0) { 972 972 out_le32(&rd->control, (PAUSE << 16) | PAUSE); 973 973 while ((in_le32(&rd->status) & ACTIVE) != 0) 974 974 ;
+5 -5
drivers/scsi/mac53c94.c
··· 382 382 if (dma_len > 0xffff) 383 383 panic("mac53c94: scatterlist element >= 64k"); 384 384 total += dma_len; 385 - st_le16(&dcmds->req_count, dma_len); 386 - st_le16(&dcmds->command, dma_cmd); 387 - st_le32(&dcmds->phy_addr, dma_addr); 385 + dcmds->req_count = cpu_to_le16(dma_len); 386 + dcmds->command = cpu_to_le16(dma_cmd); 387 + dcmds->phy_addr = cpu_to_le32(dma_addr); 388 388 dcmds->xfer_status = 0; 389 389 ++dcmds; 390 390 } 391 391 392 392 dma_cmd += OUTPUT_LAST - OUTPUT_MORE; 393 - st_le16(&dcmds[-1].command, dma_cmd); 394 - st_le16(&dcmds->command, DBDMA_STOP); 393 + dcmds[-1].command = cpu_to_le16(dma_cmd); 394 + dcmds->command = cpu_to_le16(DBDMA_STOP); 395 395 cmd->SCp.this_residual = total; 396 396 } 397 397
+7 -7
drivers/scsi/mesh.c
··· 1287 1287 } 1288 1288 if (dma_len > 0xffff) 1289 1289 panic("mesh: scatterlist element >= 64k"); 1290 - st_le16(&dcmds->req_count, dma_len - off); 1291 - st_le16(&dcmds->command, dma_cmd); 1292 - st_le32(&dcmds->phy_addr, dma_addr + off); 1290 + dcmds->req_count = cpu_to_le16(dma_len - off); 1291 + dcmds->command = cpu_to_le16(dma_cmd); 1292 + dcmds->phy_addr = cpu_to_le32(dma_addr + off); 1293 1293 dcmds->xfer_status = 0; 1294 1294 ++dcmds; 1295 1295 dtot += dma_len - off; ··· 1303 1303 static char mesh_extra_buf[64]; 1304 1304 1305 1305 dtot = sizeof(mesh_extra_buf); 1306 - st_le16(&dcmds->req_count, dtot); 1307 - st_le32(&dcmds->phy_addr, virt_to_phys(mesh_extra_buf)); 1306 + dcmds->req_count = cpu_to_le16(dtot); 1307 + dcmds->phy_addr = cpu_to_le32(virt_to_phys(mesh_extra_buf)); 1308 1308 dcmds->xfer_status = 0; 1309 1309 ++dcmds; 1310 1310 } 1311 1311 dma_cmd += OUTPUT_LAST - OUTPUT_MORE; 1312 - st_le16(&dcmds[-1].command, dma_cmd); 1312 + dcmds[-1].command = cpu_to_le16(dma_cmd); 1313 1313 memset(dcmds, 0, sizeof(*dcmds)); 1314 - st_le16(&dcmds->command, DBDMA_STOP); 1314 + dcmds->command = cpu_to_le16(DBDMA_STOP); 1315 1315 ms->dma_count = dtot; 1316 1316 } 1317 1317
+1 -1
drivers/video/fbdev/controlfb.c
··· 315 315 container_of(info, struct fb_info_control, info); 316 316 unsigned ctrl; 317 317 318 - ctrl = ld_le32(CNTRL_REG(p,ctrl)); 318 + ctrl = le32_to_cpup(CNTRL_REG(p,ctrl)); 319 319 if (blank_mode > 0) 320 320 switch (blank_mode) { 321 321 case FB_BLANK_VSYNC_SUSPEND:
+1 -1
drivers/video/fbdev/platinumfb.c
··· 168 168 struct fb_info_platinum *info = (struct fb_info_platinum *) fb; 169 169 int ctrl; 170 170 171 - ctrl = ld_le32(&info->platinum_regs->ctrl.r) | 0x33; 171 + ctrl = le32_to_cpup(&info->platinum_regs->ctrl.r) | 0x33; 172 172 if (blank) 173 173 --blank_mode; 174 174 if (blank & VESA_VSYNC_SUSPEND)
+29 -29
sound/ppc/pmac.c
··· 240 240 */ 241 241 spin_lock_irq(&chip->reg_lock); 242 242 snd_pmac_dma_stop(rec); 243 - st_le16(&chip->extra_dma.cmds->command, DBDMA_STOP); 243 + chip->extra_dma.cmds->command = cpu_to_le16(DBDMA_STOP); 244 244 snd_pmac_dma_set_command(rec, &chip->extra_dma); 245 245 snd_pmac_dma_run(rec, RUN); 246 246 spin_unlock_irq(&chip->reg_lock); ··· 251 251 */ 252 252 offset = runtime->dma_addr; 253 253 for (i = 0, cp = rec->cmd.cmds; i < rec->nperiods; i++, cp++) { 254 - st_le32(&cp->phy_addr, offset); 255 - st_le16(&cp->req_count, rec->period_size); 256 - /*st_le16(&cp->res_count, 0);*/ 257 - st_le16(&cp->xfer_status, 0); 254 + cp->phy_addr = cpu_to_le32(offset); 255 + cp->req_count = cpu_to_le16(rec->period_size); 256 + /*cp->res_count = cpu_to_le16(0);*/ 257 + cp->xfer_status = cpu_to_le16(0); 258 258 offset += rec->period_size; 259 259 } 260 260 /* make loop */ 261 - st_le16(&cp->command, DBDMA_NOP + BR_ALWAYS); 262 - st_le32(&cp->cmd_dep, rec->cmd.addr); 261 + cp->command = cpu_to_le16(DBDMA_NOP + BR_ALWAYS); 262 + cp->cmd_dep = cpu_to_le32(rec->cmd.addr); 263 263 264 264 snd_pmac_dma_stop(rec); 265 265 snd_pmac_dma_set_command(rec, &rec->cmd); ··· 328 328 #if 1 /* hmm.. how can we get the current dma pointer?? */ 329 329 int stat; 330 330 volatile struct dbdma_cmd __iomem *cp = &rec->cmd.cmds[rec->cur_period]; 331 - stat = ld_le16(&cp->xfer_status); 331 + stat = le16_to_cpu(cp->xfer_status); 332 332 if (stat & (ACTIVE|DEAD)) { 333 333 count = in_le16(&cp->res_count); 334 334 if (count) ··· 427 427 memcpy((void *)emergency_dbdma.cmds, (void *)cp, 428 428 sizeof(struct dbdma_cmd)); 429 429 emergency_in_use = 1; 430 - st_le16(&cp->xfer_status, 0); 431 - st_le16(&cp->req_count, rec->period_size); 430 + cp->xfer_status = cpu_to_le16(0); 431 + cp->req_count = cpu_to_le16(rec->period_size); 432 432 cp = emergency_dbdma.cmds; 433 433 } 434 434 435 435 /* now bump the values to reflect the amount 436 436 we haven't yet shifted */ 437 - req = ld_le16(&cp->req_count); 438 - res = ld_le16(&cp->res_count); 439 - phy = ld_le32(&cp->phy_addr); 437 + req = le16_to_cpu(cp->req_count); 438 + res = le16_to_cpu(cp->res_count); 439 + phy = le32_to_cpu(cp->phy_addr); 440 440 phy += (req - res); 441 - st_le16(&cp->req_count, res); 442 - st_le16(&cp->res_count, 0); 443 - st_le16(&cp->xfer_status, 0); 444 - st_le32(&cp->phy_addr, phy); 441 + cp->req_count = cpu_to_le16(res); 442 + cp->res_count = cpu_to_le16(0); 443 + cp->xfer_status = cpu_to_le16(0); 444 + cp->phy_addr = cpu_to_le32(phy); 445 445 446 - st_le32(&cp->cmd_dep, rec->cmd.addr 446 + cp->cmd_dep = cpu_to_le32(rec->cmd.addr 447 447 + sizeof(struct dbdma_cmd)*((rec->cur_period+1)%rec->nperiods)); 448 448 449 - st_le16(&cp->command, OUTPUT_MORE | BR_ALWAYS | INTR_ALWAYS); 449 + cp->command = cpu_to_le16(OUTPUT_MORE | BR_ALWAYS | INTR_ALWAYS); 450 450 451 451 /* point at our patched up command block */ 452 452 out_le32(&rec->dma->cmdptr, emergency_dbdma.addr); ··· 475 475 else 476 476 cp = &rec->cmd.cmds[rec->cur_period]; 477 477 478 - stat = ld_le16(&cp->xfer_status); 478 + stat = le16_to_cpu(cp->xfer_status); 479 479 480 480 if (stat & DEAD) { 481 481 snd_pmac_pcm_dead_xfer(rec, cp); ··· 489 489 break; 490 490 491 491 /*printk(KERN_DEBUG "update frag %d\n", rec->cur_period);*/ 492 - st_le16(&cp->xfer_status, 0); 493 - st_le16(&cp->req_count, rec->period_size); 494 - /*st_le16(&cp->res_count, 0);*/ 492 + cp->xfer_status = cpu_to_le16(0); 493 + cp->req_count = cpu_to_le16(rec->period_size); 494 + /*cp->res_count = cpu_to_le16(0);*/ 495 495 rec->cur_period++; 496 496 if (rec->cur_period >= rec->nperiods) { 497 497 rec->cur_period = 0; ··· 760 760 struct pmac_stream *rec = &chip->playback; 761 761 762 762 snd_pmac_dma_stop(rec); 763 - st_le16(&chip->extra_dma.cmds->req_count, bytes); 764 - st_le16(&chip->extra_dma.cmds->xfer_status, 0); 765 - st_le32(&chip->extra_dma.cmds->cmd_dep, chip->extra_dma.addr); 766 - st_le32(&chip->extra_dma.cmds->phy_addr, addr); 767 - st_le16(&chip->extra_dma.cmds->command, OUTPUT_MORE + BR_ALWAYS); 763 + chip->extra_dma.cmds->req_count = cpu_to_le16(bytes); 764 + chip->extra_dma.cmds->xfer_status = cpu_to_le16(0); 765 + chip->extra_dma.cmds->cmd_dep = cpu_to_le32(chip->extra_dma.addr); 766 + chip->extra_dma.cmds->phy_addr = cpu_to_le32(addr); 767 + chip->extra_dma.cmds->command = cpu_to_le16(OUTPUT_MORE + BR_ALWAYS); 768 768 out_le32(&chip->awacs->control, 769 769 (in_le32(&chip->awacs->control) & ~0x1f00) 770 770 | (speed << 8)); ··· 776 776 void snd_pmac_beep_dma_stop(struct snd_pmac *chip) 777 777 { 778 778 snd_pmac_dma_stop(&chip->playback); 779 - st_le16(&chip->extra_dma.cmds->command, DBDMA_STOP); 779 + chip->extra_dma.cmds->command = cpu_to_le16(DBDMA_STOP); 780 780 snd_pmac_pcm_set_format(chip); /* reset format */ 781 781 } 782 782