Commit e9a58c69 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] NULL noise removal on ppc

0->NULL in arch/ppc and include/asm-ppc.

[That's it for this series - there's still ~200Kb to merge, but I'd rather
take a break for a couple of hours before dealing with the rest]
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ee9522f4
......@@ -221,7 +221,7 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
puts("\n");
puts("Uncompressing Linux...");
gunzip(0, 0x400000, zimage_start, &zimage_size);
gunzip(NULL, 0x400000, zimage_start, &zimage_size);
puts("done.\n");
/* get the bi_rec address */
......
......@@ -106,7 +106,7 @@ void *irq_kmalloc(size_t size, int pri)
cache_bitmask |= (1<<i);
return (void *)(&malloc_cache[i]);
}
return 0;
return NULL;
}
void irq_kfree(void *ptr)
......@@ -676,7 +676,7 @@ void init_irq_proc (void)
int i;
/* create /proc/irq */
root_irq_dir = proc_mkdir("irq", 0);
root_irq_dir = proc_mkdir("irq", NULL);
/* create /proc/irq/prof_cpu_mask */
entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
......
......@@ -671,11 +671,11 @@ make_one_node_map(struct device_node* node, u8 pci_bus)
struct pci_dev* dev;
unsigned int *class_code, *reg;
class_code = (unsigned int *) get_property(node, "class-code", 0);
class_code = (unsigned int *) get_property(node, "class-code", NULL);
if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
continue;
reg = (unsigned int *)get_property(node, "reg", 0);
reg = (unsigned int *)get_property(node, "reg", NULL);
if (!reg)
continue;
dev = pci_find_slot(pci_bus, ((reg[0] >> 8) & 0xff));
......@@ -712,7 +712,7 @@ pcibios_make_OF_bus_map(void)
continue;
make_one_node_map(node, hose->first_busno);
}
of_prop_map = get_property(find_path_device("/"), "pci-OF-bus-map", 0);
of_prop_map = get_property(find_path_device("/"), "pci-OF-bus-map", NULL);
if (of_prop_map)
memcpy(of_prop_map, pci_to_OF_bus_map, pci_bus_count);
#ifdef DEBUG
......@@ -743,7 +743,7 @@ scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void*
* a fake root for all functions of a multi-function device,
* we go down them as well.
*/
class_code = (unsigned int *) get_property(node, "class-code", 0);
class_code = (unsigned int *) get_property(node, "class-code", NULL);
if ((!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) &&
strcmp(node->name, "multifunc-device"))
......@@ -761,7 +761,7 @@ scan_OF_pci_childs_iterator(struct device_node* node, void* data)
unsigned int *reg;
u8* fdata = (u8*)data;
reg = (unsigned int *) get_property(node, "reg", 0);
reg = (unsigned int *) get_property(node, "reg", NULL);
if (reg && ((reg[0] >> 8) & 0xff) == fdata[1]
&& ((reg[0] >> 16) & 0xff) == fdata[0])
return 1;
......@@ -874,7 +874,7 @@ pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn)
if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child,
find_OF_pci_device_filter, (void *)node))
return -ENODEV;
reg = (unsigned int *) get_property(node, "reg", 0);
reg = (unsigned int *) get_property(node, "reg", NULL);
if (!reg)
return -ENODEV;
*bus = (reg[0] >> 16) & 0xff;
......
......@@ -234,7 +234,7 @@ mem2hex(const char *mem, char *buf, int count)
} else {
/* error condition */
}
debugger_fault_handler = 0;
debugger_fault_handler = NULL;
*buf = 0;
return buf;
}
......@@ -300,7 +300,7 @@ hex2mem(char *buf, char *mem, int count)
} else {
/* error condition */
}
debugger_fault_handler = 0;
debugger_fault_handler = NULL;
return mem;
}
......@@ -331,7 +331,7 @@ hexToInt(char **ptr, int *intValue)
} else {
/* error condition */
}
debugger_fault_handler = 0;
debugger_fault_handler = NULL;
return (numChars);
}
......
......@@ -479,9 +479,9 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp)
regs->gpr[1] = sp;
regs->msr = MSR_USER;
if (last_task_used_math == current)
last_task_used_math = 0;
last_task_used_math = NULL;
if (last_task_used_altivec == current)
last_task_used_altivec = 0;
last_task_used_altivec = NULL;
memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
current->thread.fpscr = 0;
#ifdef CONFIG_ALTIVEC
......
......@@ -693,7 +693,7 @@ void __init setup_arch(char **cmdline_p)
#ifdef CONFIG_XMON
xmon_map_scc();
if (strstr(cmd_line, "xmon"))
xmon(0);
xmon(NULL);
#endif /* CONFIG_XMON */
if ( ppc_md.progress ) ppc_md.progress("setup_arch: enter", 0x3eab);
......
......@@ -72,7 +72,7 @@ fixup_one_level_bus_range(struct device_node *node, int higher)
int len;
/* For PCI<->PCI bridges or CardBus bridges, we go down */
class_code = (unsigned int *) get_property(node, "class-code", 0);
class_code = (unsigned int *) get_property(node, "class-code", NULL);
if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
continue;
......@@ -509,7 +509,7 @@ fixup_nec_usb2(void)
continue;
if (0x0035 != *prop)
continue;
prop = (u32 *)get_property(nec, "reg", 0);
prop = (u32 *)get_property(nec, "reg", NULL);
if (prop == NULL)
continue;
devfn = (prop[0] >> 8) & 0xff;
......
......@@ -444,7 +444,7 @@ void __init pmac_pic_init(void)
nmi_irq = pswitch->intrs[0].line;
openpic_init_nmi_irq(nmi_irq);
request_irq(nmi_irq, xmon_irq, 0,
"NMI - XMON", 0);
"NMI - XMON", NULL);
}
}
#endif /* CONFIG_XMON */
......@@ -542,7 +542,7 @@ void __init pmac_pic_init(void)
for ( i = max_real_irqs ; i < max_irqs ; i++ )
irq_desc[i].handler = &gatwick_pic;
request_irq( irq_cascade, gatwick_action, SA_INTERRUPT,
"cascade", 0 );
"cascade", NULL );
}
printk("System has %d possible interrupts\n", max_irqs);
if (max_irqs != max_real_irqs)
......@@ -550,7 +550,7 @@ void __init pmac_pic_init(void)
max_real_irqs);
#ifdef CONFIG_XMON
request_irq(20, xmon_irq, 0, "NMI - XMON", 0);
request_irq(20, xmon_irq, 0, "NMI - XMON", NULL);
#endif /* CONFIG_XMON */
}
......
......@@ -421,7 +421,7 @@ static void __init smp_psurge_setup_cpu(int cpu_nr)
/* reset the entry point so if we get another intr we won't
* try to startup again */
out_be32(psurge_start, 0x100);
if (request_irq(30, psurge_primary_intr, SA_INTERRUPT, "primary IPI", 0))
if (request_irq(30, psurge_primary_intr, SA_INTERRUPT, "primary IPI", NULL))
printk(KERN_ERR "Couldn't get primary IPI interrupt");
}
......
......@@ -741,7 +741,7 @@ raven_init(void)
}
/* Check the first PCI device to see if it is a Raven. */
early_read_config_dword(0, 0, 0, PCI_VENDOR_ID, &devid);
early_read_config_dword(NULL, 0, 0, PCI_VENDOR_ID, &devid);
switch (devid & 0xffff0000) {
case MPIC_RAVEN_ID:
......@@ -757,7 +757,7 @@ raven_init(void)
/* Read the memory base register. */
early_read_config_dword(0, 0, 0, PCI_BASE_ADDRESS_1, &pci_membase);
early_read_config_dword(NULL, 0, 0, PCI_BASE_ADDRESS_1, &pci_membase);
if (pci_membase == 0) {
OpenPIC_Addr = NULL;
......
......@@ -865,7 +865,7 @@ prep_init_IRQ(void)
irq_desc[i].handler = &i8259_pic;
/* If we have a Raven PCI bridge or a Hawk PCI bridge / Memory
* controller, we poll (as they have a different int-ack address). */
early_read_config_dword(0, 0, 0, PCI_VENDOR_ID, &pci_viddid);
early_read_config_dword(NULL, 0, 0, PCI_VENDOR_ID, &pci_viddid);
pci_did = (pci_viddid & 0xffff0000) >> 16;
if (((pci_viddid & 0xffff) == PCI_VENDOR_ID_MOTOROLA)
&& ((pci_did == PCI_DEVICE_ID_MOTOROLA_RAVEN)
......
......@@ -802,7 +802,7 @@ PPC_DEVICE __init *residual_find_device(unsigned long BusMask,
!(n--) ) return res->Devices+i;
#undef Dev
}
return 0;
return NULL;
}
PPC_DEVICE __init *residual_find_device_id(unsigned long BusMask,
......@@ -824,7 +824,7 @@ PPC_DEVICE __init *residual_find_device_id(unsigned long BusMask,
!(n--) ) return res->Devices+i;
#undef Dev
}
return 0;
return NULL;
}
PnP_TAG_PACKET *PnP_find_packet(unsigned char *p,
......@@ -832,7 +832,7 @@ PnP_TAG_PACKET *PnP_find_packet(unsigned char *p,
int n)
{
unsigned mask, masked_tag, size;
if(!p) return 0;
if(!p) return NULL;
if (tag_type(packet_tag)) mask=0xff; else mask=0xF8;
masked_tag = packet_tag&mask;
for(; *p != END_TAG; p+=size) {
......@@ -843,7 +843,7 @@ PnP_TAG_PACKET *PnP_find_packet(unsigned char *p,
else
size=tag_small_count(*p)+1;
}
return 0; /* not found */
return NULL; /* not found */
}
PnP_TAG_PACKET __init *PnP_find_small_vendor_packet(unsigned char *p,
......@@ -857,7 +857,7 @@ PnP_TAG_PACKET __init *PnP_find_small_vendor_packet(unsigned char *p,
return (PnP_TAG_PACKET *) p;
next = 1;
};
return 0; /* not found */
return NULL; /* not found */
}
PnP_TAG_PACKET __init *PnP_find_large_vendor_packet(unsigned char *p,
......@@ -871,7 +871,7 @@ PnP_TAG_PACKET __init *PnP_find_large_vendor_packet(unsigned char *p,
return (PnP_TAG_PACKET *) p;
next = 1;
};
return 0; /* not found */
return NULL; /* not found */
}
#ifdef CONFIG_PROC_PREPRESIDUAL
......
......@@ -579,16 +579,16 @@ void openpic_request_IPIs(void)
/* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset,
openpic_ipi_action, SA_INTERRUPT,
"IPI0 (call function)", 0);
"IPI0 (call function)", NULL);
request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+1,
openpic_ipi_action, SA_INTERRUPT,
"IPI1 (reschedule)", 0);
"IPI1 (reschedule)", NULL);
request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+2,
openpic_ipi_action, SA_INTERRUPT,
"IPI2 (invalidate tlb)", 0);
"IPI2 (invalidate tlb)", NULL);
request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+3,
openpic_ipi_action, SA_INTERRUPT,
"IPI3 (xmon break)", 0);
"IPI3 (xmon break)", NULL);
for ( i = 0; i < OPENPIC_NUM_IPI ; i++ )
openpic_enable_ipi(OPENPIC_VEC_IPI+open_pic_irq_offset+i);
......
......@@ -126,7 +126,7 @@ finish_device_tree(void)
/* All newworld pmac machines and CHRPs now use the interrupt tree */
for (np = allnodes; np != NULL; np = np->allnext) {
if (get_property(np, "interrupt-parent", 0)) {
if (get_property(np, "interrupt-parent", NULL)) {
use_of_interrupt_tree = 1;
break;
}
......@@ -181,8 +181,8 @@ finish_node(struct device_node *np, unsigned long mem_start,
struct device_node *child;
int *ip;
np->name = get_property(np, "name", 0);
np->type = get_property(np, "device_type", 0);
np->name = get_property(np, "name", NULL);
np->type = get_property(np, "device_type", NULL);
if (!np->name)
np->name = "<NULL>";
......@@ -197,10 +197,10 @@ finish_node(struct device_node *np, unsigned long mem_start,
mem_start = finish_node_interrupts(np, mem_start);
/* Look for #address-cells and #size-cells properties. */
ip = (int *) get_property(np, "#address-cells", 0);
ip = (int *) get_property(np, "#address-cells", NULL);
if (ip != NULL)
naddrc = *ip;
ip = (int *) get_property(np, "#size-cells", 0);
ip = (int *) get_property(np, "#size-cells", NULL);
if (ip != NULL)
nsizec = *ip;
......@@ -501,7 +501,7 @@ prom_n_addr_cells(struct device_node* np)
do {
if (np->parent)
np = np->parent;
ip = (int *) get_property(np, "#address-cells", 0);
ip = (int *) get_property(np, "#address-cells", NULL);
if (ip != NULL)
return *ip;
} while (np->parent);
......@@ -516,7 +516,7 @@ prom_n_size_cells(struct device_node* np)
do {
if (np->parent)
np = np->parent;
ip = (int *) get_property(np, "#size-cells", 0);
ip = (int *) get_property(np, "#size-cells", NULL);
if (ip != NULL)
return *ip;
} while (np->parent);
......@@ -836,7 +836,7 @@ find_devices(const char *name)
prevp = &np->next;
}
}
*prevp = 0;
*prevp = NULL;
return head;
}
......@@ -855,7 +855,7 @@ find_type_devices(const char *type)
prevp = &np->next;
}
}
*prevp = 0;
*prevp = NULL;
return head;
}
......@@ -872,7 +872,7 @@ find_all_nodes(void)
*prevp = np;
prevp = &np->next;
}
*prevp = 0;
*prevp = NULL;
return head;
}
......@@ -934,7 +934,7 @@ find_compatible_devices(const char *type, const char *compat)
prevp = &np->next;
}
}
*prevp = 0;
*prevp = NULL;
return head;
}
......@@ -1159,7 +1159,7 @@ get_property(struct device_node *np, const char *name, int *lenp)
*lenp = pp->length;
return pp->value;
}
return 0;
return NULL;
}
/*
......
......@@ -111,15 +111,15 @@ static void prom_instantiate_rtas(void);
static void * early_get_property(unsigned long base, unsigned long node,
char *prop);
prom_entry prom __initdata = 0;
ihandle prom_chosen __initdata = 0;
ihandle prom_stdout __initdata = 0;
prom_entry prom __initdata;
ihandle prom_chosen __initdata;
ihandle prom_stdout __initdata;
char *prom_display_paths[FB_MAX] __initdata = { 0, };
char *prom_display_paths[FB_MAX] __initdata;
phandle prom_display_nodes[FB_MAX] __initdata;
unsigned int prom_num_displays __initdata = 0;
char *of_stdout_device __initdata = 0;
static ihandle prom_disp_node __initdata = 0;
unsigned int prom_num_displays __initdata;
char *of_stdout_device __initdata;
static ihandle prom_disp_node __initdata;
unsigned int rtas_data; /* physical pointer */
unsigned int rtas_entry; /* physical pointer */
......@@ -161,7 +161,7 @@ call_prom(const char *service, int nargs, int nret, ...)
prom_args.args[i] = va_arg(list, void *);
va_end(list);
for (i = 0; i < nret; ++i)
prom_args.args[i + nargs] = 0;
prom_args.args[i + nargs] = NULL;
prom(&prom_args);
return prom_args.args[nargs];
}
......@@ -181,7 +181,7 @@ call_prom_ret(const char *service, int nargs, int nret, void **rets, ...)
prom_args.args[i] = va_arg(list, void *);
va_end(list);
for (i = 0; i < nret; ++i)
prom_args.args[i + nargs] = 0;
prom_args.args[i + nargs] = NULL;
prom(&prom_args);
for (i = 1; i < nret; ++i)
rets[i-1] = prom_args.args[nargs + i];
......@@ -363,9 +363,9 @@ check_display(unsigned long mem)
};
const unsigned char *clut;
prom_disp_node = 0;
prom_disp_node = NULL;
for (node = 0; prom_next_node(&node); ) {
for (node = NULL; prom_next_node(&node); ) {
type[0] = 0;
call_prom("getprop", 4, 1, node, "device_type",
type, sizeof(type));
......@@ -546,8 +546,8 @@ copy_device_tree(unsigned long mem_start, unsigned long mem_end)
}
allnextp = &allnodes;
mem_start = ALIGNUL(mem_start);
new_start = inspect_node(root, 0, mem_start, mem_end, &allnextp);
*allnextp = 0;
new_start = inspect_node(root, NULL, mem_start, mem_end, &allnextp);
*allnextp = NULL;
return new_start;
}
......@@ -695,7 +695,7 @@ prom_hold_cpus(unsigned long mem)
/* look for cpus */
*(unsigned long *)(0x0) = 0;
asm volatile("dcbf 0,%0": : "r" (0) : "memory");
for (node = 0; prom_next_node(&node); ) {
for (node = NULL; prom_next_node(&node); ) {
type[0] = 0;
call_prom("getprop", 4, 1, node, "device_type",
type, sizeof(type));
......@@ -888,7 +888,7 @@ prom_init(int r3, int r4, prom_entry pp)
prom_print("returning 0x");
prom_print_hex(phys);
prom_print("from prom_init\n");
prom_stdout = 0;
prom_stdout = NULL;
return phys;
}
......@@ -910,7 +910,7 @@ early_get_property(unsigned long base, unsigned long node, char *prop)
return (void *)((unsigned long)pp->value + base);
}
}
return 0;
return NULL;
}
/* Is boot-info compatible ? */
......@@ -928,7 +928,7 @@ bootx_init(unsigned long r4, unsigned long phys)
boot_infos = PTRUNRELOC(bi);
if (!BOOT_INFO_IS_V2_COMPATIBLE(bi))
bi->logicalDisplayBase = 0;
bi->logicalDisplayBase = NULL;
#ifdef CONFIG_BOOTX_TEXT
btext_init(bi);
......
......@@ -82,12 +82,12 @@ const struct powerpc_operand powerpc_operands[] =
/* The zero index is used to indicate the end of the list of
operands. */
#define UNUSED (0)
{ 0, 0, 0, 0, 0 },
{ 0, 0, NULL, NULL, 0 },
/* The BA field in an XL form instruction. */
#define BA (1)
#define BA_MASK (0x1f << 16)
{ 5, 16, 0, 0, PPC_OPERAND_CR },
{ 5, 16, NULL, NULL, PPC_OPERAND_CR },
/* The BA field in an XL form instruction when it must be the same
as the BT field in the same instruction. */
......@@ -97,7 +97,7 @@ const struct powerpc_operand powerpc_operands[] =
/* The BB field in an XL form instruction. */
#define BB (3)
#define BB_MASK (0x1f << 11)
{ 5, 11, 0, 0, PPC_OPERAND_CR },
{ 5, 11, NULL, NULL, PPC_OPERAND_CR },
/* The BB field in an XL form instruction when it must be the same
as the BA field in the same instruction. */
......@@ -140,21 +140,21 @@ const struct powerpc_operand powerpc_operands[] =
/* The BF field in an X or XL form instruction. */
#define BF (11)
{ 3, 23, 0, 0, PPC_OPERAND_CR },
{ 3, 23, NULL, NULL, PPC_OPERAND_CR },
/* An optional BF field. This is used for comparison instructions,
in which an omitted BF field is taken as zero. */
#define OBF (12)
{ 3, 23, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
{ 3, 23, NULL, NULL, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
/* The BFA field in an X or XL form instruction. */
#define BFA (13)
{ 3, 18, 0, 0, PPC_OPERAND_CR },
{ 3, 18, NULL, NULL, PPC_OPERAND_CR },
/* The BI field in a B form or XL form instruction. */
#define BI (14)
#define BI_MASK (0x1f << 16)
{ 5, 16, 0, 0, PPC_OPERAND_CR },
{ 5, 16, NULL, NULL, PPC_OPERAND_CR },
/* The BO field in a B form instruction. Certain values are
illegal. */
......@@ -169,20 +169,20 @@ const struct powerpc_operand powerpc_operands[] =
/* The BT field in an X or XL form instruction. */
#define BT (17)
{ 5, 21, 0, 0, PPC_OPERAND_CR },
{ 5, 21, NULL, NULL, PPC_OPERAND_CR },
/* The condition register number portion of the BI field in a B form
or XL form instruction. This is used for the extended
conditional branch mnemonics, which set the lower two bits of the
BI field. This field is optional. */
#define CR (18)
{ 3, 18, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
{ 3, 18, NULL, NULL, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
/* The D field in a D form instruction. This is a displacement off
a register, and implies that the next operand is a register in
parentheses. */
#define D (19)
{ 16, 0, 0, 0, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
{ 16, 0, NULL, NULL, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
/* The DS field in a DS form instruction. This is like D, but the
lower two bits are forced to zero. */
......@@ -191,49 +191,49 @@ const struct powerpc_operand powerpc_operands[] =
/* The FL1 field in a POWER SC form instruction. */
#define FL1 (21)
{ 4, 12, 0, 0, 0 },
{ 4, 12, NULL, NULL, 0 },
/* The FL2 field in a POWER SC form instruction. */
#define FL2 (22)
{ 3, 2, 0, 0, 0 },
{ 3, 2, NULL, NULL, 0 },
/* The FLM field in an XFL form instruction. */
#define FLM (23)
{ 8, 17, 0, 0, 0 },
{ 8, 17, NULL, NULL, 0 },
/* The FRA field in an X or A form instruction. */
#define FRA (24)
#define FRA_MASK (0x1f << 16)
{ 5, 16, 0, 0, PPC_OPERAND_FPR },
{ 5, 16, NULL, NULL, PPC_OPERAND_FPR },
/* The FRB field in an X or A form instruction. */
#define FRB (25)
#define FRB_MASK (0x1f << 11)
{ 5, 11, 0, 0, PPC_OPERAND_FPR },
{ 5, 11, NULL, NULL, PPC_OPERAND_FPR },
/* The FRC field in an A form instruction. */
#define FRC (26)
#define FRC_MASK (0x1f << 6)
{ 5, 6, 0, 0, PPC_OPERAND_FPR },
{ 5, 6, NULL, NULL, PPC_OPERAND_FPR },
/* The FRS field in an X form instruction or the FRT field in a D, X
or A form instruction. */
#define FRS (27)
#define FRT (FRS)
{ 5, 21, 0, 0, PPC_OPERAND_FPR },
{ 5, 21, NULL, NULL, PPC_OPERAND_FPR },
/* The FXM field in an XFX instruction. */
#define FXM (28)
#define FXM_MASK (0xff << 12)
{ 8, 12, 0, 0, 0 },
{ 8, 12, NULL, NULL, 0 },
/* The L field in a D or X form instruction. */
#define L (29)
{ 1, 21, 0, 0, PPC_OPERAND_OPTIONAL },
{ 1, 21, NULL, NULL, PPC_OPERAND_OPTIONAL },
/* The LEV field in a POWER SC form instruction. */
#define LEV (30)
{ 7, 5, 0, 0, 0 },
{ 7, 5, NULL, NULL, 0 },
/* The LI field in an I form instruction. The lower two bits are
forced to zero. */
......@@ -248,19 +248,19 @@ const struct powerpc_operand powerpc_operands[] =
/* The MB field in an M form instruction. */
#define MB (33)
#define MB_MASK (0x1f << 6)
{ 5, 6, 0, 0, 0 },
{ 5, 6, NULL, NULL, 0 },
/* The ME field in an M form instruction. */
#define ME (34)
#define ME_MASK (0x1f << 1)
{ 5, 1, 0, 0, 0 },
{ 5, 1, NULL, NULL, 0 },
/* The MB and ME fields in an M form instruction expressed a single
operand which is a bitmask indicating which bits to select. This
is a two operand form using PPC_OPERAND_NEXT. See the
description in opcode/ppc.h for what this means. */
#define MBE (35)
{ 5, 6, 0, 0, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT },
{ 5, 6, NULL, NULL, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT },
{ 32, 0, insert_mbe, extract_mbe, 0 },
/* The MB or ME field in an MD or MDS form instruction. The high
......@@ -284,29 +284,29 @@ const struct powerpc_operand powerpc_operands[] =
/* The RA field in an D, DS, X, XO, M, or MDS form instruction. */
#define RA (40)
#define RA_MASK (0x1f << 16)
{ 5, 16, 0, 0, PPC_OPERAND_GPR },
{ 5, 16, NULL, NULL, PPC_OPERAND_GPR },
/* The RA field in a D or X form instruction which is an updating
load, which means that the RA field may not be zero and may not
equal the RT field. */
#define RAL (41)
{ 5, 16, insert_ral, 0, PPC_OPERAND_GPR },
{ 5, 16, insert_ral, NULL, PPC_OPERAND_GPR },
/* The RA field in an lmw instruction, which has special value
restrictions. */
#define RAM (42)
{ 5, 16, insert_ram, 0, PPC_OPERAND_GPR },
{ 5, 16, insert_ram, NULL, PPC_OPERAND_GPR },
/* The RA field in a D or X form instruction which is an updating
store or an updating floating point load, which means that the RA
field may not be zero. */
#define RAS (43)
{ 5, 16, insert_ras, 0, PPC_OPERAND_GPR },
{ 5, 16, insert_ras, NULL, PPC_OPERAND_GPR },
/* The RB field in an X, XO, M, or MDS form instruction. */
#define RB (44)
#define RB_MASK (0x1f << 11)
{ 5, 11, 0, 0, PPC_OPERAND_GPR },
{ 5, 11, NULL, NULL, PPC_OPERAND_GPR },
/* The RB field in an X form instruction when it must be the same as
the RS field in the instruction. This is used for extended
......@@ -320,12 +320,12 @@ const struct powerpc_operand powerpc_operands[] =
#define RS (46)
#define RT (RS)
#define RT_MASK (0x1f << 21)
{ 5, 21, 0, 0, PPC_OPERAND_GPR },
{ 5, 21, NULL, NULL, PPC_OPERAND_GPR },
/* The SH field in an X or M form instruction. */
#define SH (47)
#define SH_MASK (0x1f << 11)
{ 5, 11, 0, 0, 0 },
{ 5, 11, NULL, NULL, 0 },
/* The SH field in an MD form instruction. This is split. */
#define SH6 (48)
......@@ -334,12 +334,12 @@ const struct powerpc_operand powerpc_operands[] =
/* The SI field in a D form instruction. */
#define SI (49)
{ 16, 0, 0, 0, PPC_OPERAND_SIGNED },
{ 16, 0, NULL, NULL, PPC_OPERAND_SIGNED },
/* The SI field in a D form instruction when we accept a wide range
of positive values. */
#define SISIGNOPT (50)
{ 16, 0, 0, 0, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT },
{ 16, 0, NULL, NULL, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT },
/* The SPR field in an XFX form instruction. This is flipped--the
lower 5 bits are stored in the upper 5 and vice- versa. */
......@@ -350,20 +350,20 @@ const struct powerpc_operand powerpc_operands[] =
/* The BAT index number in an XFX form m[ft]ibat[lu] instruction. */
#define SPRBAT (52)
#define SPRBAT_MASK (0x3 << 17)
{ 2, 17, 0, 0, 0 },
{ 2, 17, NULL, NULL, 0 },
/* The SPRG register number in an XFX form m[ft]sprg instruction. */
#define SPRG (53)
#define SPRG_MASK (0x3 << 16)
{ 2, 16, 0, 0, 0 },
{ 2, 16, NULL, NULL, 0 },
/* The SR field in an X form instruction. */
#define SR (54)
{ 4, 16, 0, 0, 0 },
{ 4, 16, NULL, NULL, 0 },
/* The SV field in a POWER SC form instruction. */
#define SV (55)
{ 14, 2, 0, 0, 0 },
{ 14, 2, NULL, NULL, 0 },
/* The TBR field in an XFX form instruction. This is like the SPR
field, but it is optional. */
......@@ -373,15 +373,15 @@ const struct powerpc_operand powerpc_operands[] =
/* The TO field in a D or X form instruction. */
#define TO (57)
#define TO_MASK (0x1f << 21)
{ 5, 21, 0, 0, 0 },
{ 5, 21, NULL, NULL, 0 },
/* The U field in an X form instruction. */
#define U (58)
{ 4, 12, 0, 0, 0 },
{ 4, 12, NULL, NULL, 0 },
/* The UI field in a D form instruction. */
#define UI (59)
{ 16, 0, 0, 0, 0 },
{ 16, 0, NULL, NULL, 0 },
};
/* The functions used to insert and extract complicated operands. */
......
......@@ -448,13 +448,13 @@ xmon_init_scc(void)
scc_initialized = 1;
if (via_modem) {
for (;;) {
xmon_write(0, "ATE1V1\r", 7);
xmon_write(NULL, "ATE1V1\r", 7);
if (xmon_expect("OK", 5)) {
xmon_write(0, "ATA\r", 4);
xmon_write(NULL, "ATA\r", 4);
if (xmon_expect("CONNECT", 40))
break;
}
xmon_write(0, "+++", 3);
xmon_write(NULL, "+++", 3);
xmon_expect("OK", 3);
}
}
......@@ -618,7 +618,7 @@ xmon_fgets(char *str, int nb, void *f)
c = xmon_getchar();
if (c == -1) {
if (p == str)
return 0;
return NULL;
break;
}
*p++ = c;
......
......@@ -239,7 +239,7 @@ xmon(struct pt_regs *excp)
set_backlight_level(BACKLIGHT_MAX);
sync();
}
debugger_fault_handler = 0;
debugger_fault_handler = NULL;
#endif /* CONFIG_PMAC_BACKLIGHT */
cmd = cmds(excp);
if (cmd == 's') {
......@@ -253,7 +253,7 @@ xmon(struct pt_regs *excp)
insert_bpts();
}
xmon_leave();
xmon_regs[smp_processor_id()] = 0;
xmon_regs[smp_processor_id()] = NULL;
#ifdef CONFIG_SMP
clear_bit(0, &got_xmon);
clear_bit(smp_processor_id(), &cpus_in_xmon);
......@@ -352,7 +352,7 @@ at_breakpoint(unsigned pc)
for (i = 0; i < NBPTS; ++i, ++bp)
if (bp->enabled && pc == bp->address)
return bp;
return 0;
return NULL;
}
static void
......@@ -962,7 +962,7 @@ print_sysmap(void)
xmon_puts(sysmap);
sync();
}
debugger_fault_handler = 0;
debugger_fault_handler = NULL;
}
else
printf("No System.map\n");
......@@ -1203,7 +1203,7 @@ mread(unsigned adrs, void *buf, int size)
__delay(200);
n = size;
}
debugger_fault_handler = 0;
debugger_fault_handler = NULL;
return n;
}
......@@ -1233,7 +1233,7 @@ mwrite(unsigned adrs, void *buf, int size)
} else {
printf("*** Error writing address %x\n", adrs + n);
}
debugger_fault_handler = 0;
debugger_fault_handler = NULL;
return n;
}
......@@ -1673,7 +1673,7 @@ void proccall(void)
} else {
printf("*** %x exception occurred\n", fault_except);
}
debugger_fault_handler = 0;
debugger_fault_handler = NULL;
}
/* Input scanning routines */
......@@ -1886,7 +1886,7 @@ sysmap_lookup(void)
} while (cur);
sync();
}
debugger_fault_handler = 0;
debugger_fault_handler = NULL;
termch = 0;
break;
}
......@@ -1939,7 +1939,7 @@ xmon_find_symbol(unsigned long addr, unsigned long* saddr)
*(ep++) = 0;
if (saddr)
*saddr = prev;
debugger_fault_handler = 0;
debugger_fault_handler = NULL;
return rbuffer;
}
prev = next;
......@@ -1951,7 +1951,7 @@ xmon_find_symbol(unsigned long addr, unsigned long* saddr)
bail:
sync();
}
debugger_fault_handler = 0;
debugger_fault_handler = NULL;
return NULL;
}
......@@ -2003,6 +2003,6 @@ xmon_symbol_to_addr(char* symbol)
}
sync();
}
debugger_fault_handler = 0;
debugger_fault_handler = NULL;
return result;
}
......@@ -91,7 +91,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type)
BUG_ON(!pte_none(*(kmap_pte+idx)));
#endif
set_pte(kmap_pte+idx, mk_pte(page, kmap_prot));
flush_tlb_page(0, vaddr);
flush_tlb_page(NULL, vaddr);
return (void*) vaddr;
}
......@@ -115,7 +115,7 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type)
* this pte without first remap it
*/
pte_clear(kmap_pte+idx);
flush_tlb_page(0, vaddr);
flush_tlb_page(NULL, vaddr);
#endif
dec_preempt_count();
preempt_check_resched();
......
......@@ -237,7 +237,7 @@ extern inline void * bus_to_virt(unsigned long address)
{
#ifndef CONFIG_APUS
if (address == 0)
return 0;
return NULL;
return (void *)(address - PCI_DRAM_OFFSET + KERNELBASE);
#else
return (void*) mm_ptov (address);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment