Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87948
b: refs/heads/master
c: 0c76be3
h: refs/heads/master
v: v3
  • Loading branch information
Dave Airlie committed Mar 29, 2008
1 parent d70f67b commit 0970d9a
Show file tree
Hide file tree
Showing 72 changed files with 258 additions and 217 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a77df5cd1cde203ef11c8e5a3ca47def5f5a1687
refs/heads/master: 0c76be35194563f56e02fc1775d0fe29281e84d4
37 changes: 21 additions & 16 deletions trunk/arch/powerpc/oprofile/cell/vma_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ vma_map_add(struct vma_to_fileoffset_map *map, unsigned int vma,
* A pointer to the first vma_map in the generated list
* of vma_maps is returned. */
struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
unsigned long __spu_elf_start)
unsigned long spu_elf_start)
{
static const unsigned char expected[EI_PAD] = {
[EI_MAG0] = ELFMAG0,
Expand All @@ -107,11 +107,9 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,

int grd_val;
struct vma_to_fileoffset_map *map = NULL;
void __user *spu_elf_start = (void __user *)__spu_elf_start;
struct spu_overlay_info ovly;
unsigned int overlay_tbl_offset = -1;
Elf32_Phdr __user *phdr_start;
Elf32_Shdr __user *shdr_start;
unsigned long phdr_start, shdr_start;
Elf32_Ehdr ehdr;
Elf32_Phdr phdr;
Elf32_Shdr shdr, shdr_str;
Expand All @@ -123,12 +121,12 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
unsigned int ovly_buf_table_sym = 0;
unsigned int ovly_table_end_sym = 0;
unsigned int ovly_buf_table_end_sym = 0;
struct spu_overlay_info __user *ovly_table;
unsigned long ovly_table;
unsigned int n_ovlys;

/* Get and validate ELF header. */

if (copy_from_user(&ehdr, spu_elf_start, sizeof (ehdr)))
if (copy_from_user(&ehdr, (void *) spu_elf_start, sizeof (ehdr)))
goto fail;

if (memcmp(ehdr.e_ident, expected, EI_PAD) != 0) {
Expand All @@ -154,7 +152,9 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,

/* Traverse program headers. */
for (i = 0; i < ehdr.e_phnum; i++) {
if (copy_from_user(&phdr, phdr_start + i, sizeof(phdr)))
if (copy_from_user(&phdr,
(void *) (phdr_start + i * sizeof(phdr)),
sizeof(phdr)))
goto fail;

if (phdr.p_type != PT_LOAD)
Expand All @@ -171,7 +171,9 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
pr_debug("SPU_PROF: Created non-overlay maps\n");
/* Traverse section table and search for overlay-related symbols. */
for (i = 0; i < ehdr.e_shnum; i++) {
if (copy_from_user(&shdr, shdr_start + i, sizeof(shdr)))
if (copy_from_user(&shdr,
(void *) (shdr_start + i * sizeof(shdr)),
sizeof(shdr)))
goto fail;

if (shdr.sh_type != SHT_SYMTAB)
Expand All @@ -180,23 +182,24 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
continue;

if (copy_from_user(&shdr_str,
shdr_start + shdr.sh_link,
(void *) (shdr_start + shdr.sh_link *
sizeof(shdr)),
sizeof(shdr)))
goto fail;

if (shdr_str.sh_type != SHT_STRTAB)
goto fail;;

for (j = 0; j < shdr.sh_size / sizeof (sym); j++) {
if (copy_from_user(&sym, spu_elf_start +
shdr.sh_offset +
j * sizeof (sym),
if (copy_from_user(&sym, (void *) (spu_elf_start +
shdr.sh_offset + j *
sizeof (sym)),
sizeof (sym)))
goto fail;

if (copy_from_user(name,
spu_elf_start + shdr_str.sh_offset +
sym.st_name,
if (copy_from_user(name, (void *)
(spu_elf_start + shdr_str.sh_offset +
sym.st_name),
20))
goto fail;

Expand Down Expand Up @@ -242,7 +245,9 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,

/* Traverse overlay table. */
for (i = 0; i < n_ovlys; i++) {
if (copy_from_user(&ovly, ovly_table + i, sizeof (ovly)))
if (copy_from_user(&ovly, (void *)
(ovly_table + i * sizeof (ovly)),
sizeof (ovly)))
goto fail;

/* The ovly.vma/size/offset arguments are analogous to the same
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/platforms/pseries/xics.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ void xics_request_IPIs(void)
}
#endif /* CONFIG_SMP */

void xics_teardown_cpu(void)
void xics_teardown_cpu()
{
int cpu = smp_processor_id();

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ static void ata_dev_disable_pm(struct ata_device *dev)
void ata_lpm_schedule(struct ata_port *ap, enum link_pm policy)
{
ap->pm_policy = policy;
ap->link.eh_info.action |= ATA_EH_LPM;
ap->link.eh_info.action |= ATA_EHI_LPM;
ap->link.eh_info.flags |= ATA_EHI_NO_AUTOPSY;
ata_port_schedule_eh(ap);
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ata/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -2748,7 +2748,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
ehc->i.flags &= ~ATA_EHI_SETMODE;
}

if (ehc->i.action & ATA_EH_LPM)
if (ehc->i.action & ATA_EHI_LPM)
ata_link_for_each_dev(dev, link)
ata_dev_enable_pm(dev, ap->pm_policy);

Expand Down
6 changes: 1 addition & 5 deletions trunk/drivers/ata/pata_sil680.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,7 @@ static u8 sil680_init_chip(struct pci_dev *pdev, int *try_mmio)
dev_dbg(&pdev->dev, "sil680: BA5_EN = %d clock = %02X\n",
tmpbyte & 1, tmpbyte & 0x30);

*try_mmio = 0;
#ifdef CONFIG_PPC
if (machine_is(cell))
*try_mmio = (tmpbyte & 1) || pci_resource_start(pdev, 5);
#endif
*try_mmio = (tmpbyte & 1) || pci_resource_start(pdev, 5);

switch(tmpbyte & 0x30) {
case 0x00:
Expand Down
54 changes: 42 additions & 12 deletions trunk/drivers/char/drm/r300_cmdbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,47 @@ static void r300_discard_buffer(struct drm_device * dev, struct drm_buf * buf)
buf->used = 0;
}

static void r300_cmd_wait(drm_radeon_private_t * dev_priv,
drm_r300_cmd_header_t header)
{
u32 wait_until;
RING_LOCALS;

if (!header.wait.flags)
return;

wait_until = 0;

switch(header.wait.flags) {
case R300_WAIT_2D:
wait_until = RADEON_WAIT_2D_IDLE;
break;
case R300_WAIT_3D:
wait_until = RADEON_WAIT_3D_IDLE;
break;
case R300_NEW_WAIT_2D_3D:
wait_until = RADEON_WAIT_2D_IDLE|RADEON_WAIT_3D_IDLE;
break;
case R300_NEW_WAIT_2D_2D_CLEAN:
wait_until = RADEON_WAIT_2D_IDLE|RADEON_WAIT_2D_IDLECLEAN;
break;
case R300_NEW_WAIT_3D_3D_CLEAN:
wait_until = RADEON_WAIT_3D_IDLE|RADEON_WAIT_3D_IDLECLEAN;
break;
case R300_NEW_WAIT_2D_2D_CLEAN_3D_3D_CLEAN:
wait_until = RADEON_WAIT_2D_IDLE|RADEON_WAIT_2D_IDLECLEAN;
wait_until |= RADEON_WAIT_3D_IDLE|RADEON_WAIT_3D_IDLECLEAN;
break;
default:
return;
}

BEGIN_RING(2);
OUT_RING(CP_PACKET0(RADEON_WAIT_UNTIL, 0));
OUT_RING(wait_until);
ADVANCE_RING();
}

static int r300_scratch(drm_radeon_private_t *dev_priv,
drm_radeon_kcmd_buffer_t *cmdbuf,
drm_r300_cmd_header_t header)
Expand Down Expand Up @@ -909,19 +950,8 @@ int r300_do_cp_cmdbuf(struct drm_device *dev,
break;

case R300_CMD_WAIT:
/* simple enough, we can do it here */
DRM_DEBUG("R300_CMD_WAIT\n");
if (header.wait.flags == 0)
break; /* nothing to do */

{
RING_LOCALS;

BEGIN_RING(2);
OUT_RING(CP_PACKET0(RADEON_WAIT_UNTIL, 0));
OUT_RING((header.wait.flags & 0xf) << 14);
ADVANCE_RING();
}
r300_cmd_wait(dev_priv, header);
break;

case R300_CMD_SCRATCH:
Expand Down
12 changes: 12 additions & 0 deletions trunk/drivers/char/drm/radeon_drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,20 @@ typedef union {
#define R300_CMD_WAIT 7
# define R300_WAIT_2D 0x1
# define R300_WAIT_3D 0x2
/* these two defines are DOING IT WRONG - however
* we have userspace which relies on using these.
* The wait interface is backwards compat new
* code should use the NEW_WAIT defines below
* THESE ARE NOT BIT FIELDS
*/
# define R300_WAIT_2D_CLEAN 0x3
# define R300_WAIT_3D_CLEAN 0x4

# define R300_NEW_WAIT_2D_3D 0x3
# define R300_NEW_WAIT_2D_2D_CLEAN 0x4
# define R300_NEW_WAIT_3D_3D_CLEAN 0x6
# define R300_NEW_WAIT_2D_2D_CLEAN_3D_3D_CLEAN 0x8

#define R300_CMD_SCRATCH 8

typedef union {
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/char/n_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ static int copy_from_read_buf(struct tty_struct *tty,
return retval;
}

extern ssize_t redirected_tty_write(struct file *, const char __user *,
extern ssize_t redirected_tty_write(struct file *, const char *,
size_t, loff_t *);

/**
Expand Down
20 changes: 10 additions & 10 deletions trunk/drivers/char/nozomi.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
u32 size_bytes)
{
u32 i = 0;
const u32 __iomem *ptr = mem_addr_start;
const u32 *ptr = (__force u32 *) mem_addr_start;
u16 *buf16;

if (unlikely(!ptr || !buf))
Expand All @@ -448,11 +448,11 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
switch (size_bytes) {
case 2: /* 2 bytes */
buf16 = (u16 *) buf;
*buf16 = __le16_to_cpu(readw(ptr));
*buf16 = __le16_to_cpu(readw((void __iomem *)ptr));
goto out;
break;
case 4: /* 4 bytes */
*(buf) = __le32_to_cpu(readl(ptr));
*(buf) = __le32_to_cpu(readl((void __iomem *)ptr));
goto out;
break;
}
Expand All @@ -461,11 +461,11 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
if (size_bytes - i == 2) {
/* Handle 2 bytes in the end */
buf16 = (u16 *) buf;
*(buf16) = __le16_to_cpu(readw(ptr));
*(buf16) = __le16_to_cpu(readw((void __iomem *)ptr));
i += 2;
} else {
/* Read 4 bytes */
*(buf) = __le32_to_cpu(readl(ptr));
*(buf) = __le32_to_cpu(readl((void __iomem *)ptr));
i += 4;
}
buf++;
Expand All @@ -484,7 +484,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
u32 size_bytes)
{
u32 i = 0;
u32 __iomem *ptr = mem_addr_start;
u32 *ptr = (__force u32 *) mem_addr_start;
const u16 *buf16;

if (unlikely(!ptr || !buf))
Expand All @@ -494,15 +494,15 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
switch (size_bytes) {
case 2: /* 2 bytes */
buf16 = (const u16 *)buf;
writew(__cpu_to_le16(*buf16), ptr);
writew(__cpu_to_le16(*buf16), (void __iomem *)ptr);
return 2;
break;
case 1: /*
* also needs to write 4 bytes in this case
* so falling through..
*/
case 4: /* 4 bytes */
writel(__cpu_to_le32(*buf), ptr);
writel(__cpu_to_le32(*buf), (void __iomem *)ptr);
return 4;
break;
}
Expand All @@ -511,11 +511,11 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
if (size_bytes - i == 2) {
/* 2 bytes */
buf16 = (const u16 *)buf;
writew(__cpu_to_le16(*buf16), ptr);
writew(__cpu_to_le16(*buf16), (void __iomem *)ptr);
i += 2;
} else {
/* 4 bytes */
writel(__cpu_to_le32(*buf), ptr);
writel(__cpu_to_le32(*buf), (void __iomem *)ptr);
i += 4;
}
buf++;
Expand Down
28 changes: 14 additions & 14 deletions trunk/drivers/crypto/hifn_795x.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,8 @@ static atomic_t hifn_dev_number;

struct hifn_desc
{
volatile __le32 l;
volatile __le32 p;
volatile u32 l;
volatile u32 p;
};

struct hifn_dma {
Expand Down Expand Up @@ -481,10 +481,10 @@ struct hifn_device

struct hifn_base_command
{
volatile __le16 masks;
volatile __le16 session_num;
volatile __le16 total_source_count;
volatile __le16 total_dest_count;
volatile u16 masks;
volatile u16 session_num;
volatile u16 total_source_count;
volatile u16 total_dest_count;
};

#define HIFN_BASE_CMD_COMP 0x0100 /* enable compression engine */
Expand All @@ -504,10 +504,10 @@ struct hifn_base_command
*/
struct hifn_crypt_command
{
volatile __le16 masks;
volatile __le16 header_skip;
volatile __le16 source_count;
volatile __le16 reserved;
volatile u16 masks;
volatile u16 header_skip;
volatile u16 source_count;
volatile u16 reserved;
};

#define HIFN_CRYPT_CMD_ALG_MASK 0x0003 /* algorithm: */
Expand Down Expand Up @@ -670,7 +670,7 @@ static inline u32 hifn_read_0(struct hifn_device *dev, u32 reg)
{
u32 ret;

ret = readl(dev->bar[0] + reg);
ret = readl((char *)(dev->bar[0]) + reg);

return ret;
}
Expand All @@ -679,19 +679,19 @@ static inline u32 hifn_read_1(struct hifn_device *dev, u32 reg)
{
u32 ret;

ret = readl(dev->bar[1] + reg);
ret = readl((char *)(dev->bar[1]) + reg);

return ret;
}

static inline void hifn_write_0(struct hifn_device *dev, u32 reg, u32 val)
{
writel(val, dev->bar[0] + reg);
writel(val, (char *)(dev->bar[0]) + reg);
}

static inline void hifn_write_1(struct hifn_device *dev, u32 reg, u32 val)
{
writel(val, dev->bar[1] + reg);
writel(val, (char *)(dev->bar[1]) + reg);
}

static void hifn_wait_puc(struct hifn_device *dev)
Expand Down
Loading

0 comments on commit 0970d9a

Please sign in to comment.