Commit a2ec0df5 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://ppc.bkbits.net/for-linus-ppc64

into home.osdl.org:/home/torvalds/v2.5/linux
parents d810953c d66f7b39
...@@ -337,6 +337,16 @@ static void __init smp_read_mpc_oem(struct mp_config_oemtable *oemtable, \ ...@@ -337,6 +337,16 @@ static void __init smp_read_mpc_oem(struct mp_config_oemtable *oemtable, \
} }
} }
} }
static inline void mps_oem_check(struct mp_config_table *mpc, char *oem,
char *productid)
{
if (strncmp(oem, "IBM NUMA", 8))
printk("Warning! May not be a NUMA-Q system!\n");
if (mpc->mpc_oemptr)
smp_read_mpc_oem((struct mp_config_oemtable *) mpc->mpc_oemptr,
mpc->mpc_oemsize);
}
#endif /* CONFIG_X86_NUMAQ */ #endif /* CONFIG_X86_NUMAQ */
/* /*
......
...@@ -570,6 +570,7 @@ CONFIG_BRIDGE_EBT_BROUTE=m ...@@ -570,6 +570,7 @@ CONFIG_BRIDGE_EBT_BROUTE=m
CONFIG_BRIDGE_EBT_T_FILTER=m CONFIG_BRIDGE_EBT_T_FILTER=m
CONFIG_BRIDGE_EBT_T_NAT=m CONFIG_BRIDGE_EBT_T_NAT=m
CONFIG_BRIDGE_EBT_802_3=m CONFIG_BRIDGE_EBT_802_3=m
CONFIG_BRIDGE_EBT_AMONG=m
CONFIG_BRIDGE_EBT_ARP=m CONFIG_BRIDGE_EBT_ARP=m
CONFIG_BRIDGE_EBT_IP=m CONFIG_BRIDGE_EBT_IP=m
CONFIG_BRIDGE_EBT_LIMIT=m CONFIG_BRIDGE_EBT_LIMIT=m
......
...@@ -28,7 +28,6 @@ obj-$(CONFIG_ATARI_ACSI) += acsi.o ...@@ -28,7 +28,6 @@ obj-$(CONFIG_ATARI_ACSI) += acsi.o
obj-$(CONFIG_ATARI_SLM) += acsi_slm.o obj-$(CONFIG_ATARI_SLM) += acsi_slm.o
obj-$(CONFIG_AMIGA_Z2RAM) += z2ram.o obj-$(CONFIG_AMIGA_Z2RAM) += z2ram.o
obj-$(CONFIG_BLK_DEV_RAM) += rd.o obj-$(CONFIG_BLK_DEV_RAM) += rd.o
obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
obj-$(CONFIG_BLK_DEV_LOOP) += loop.o obj-$(CONFIG_BLK_DEV_LOOP) += loop.o
obj-$(CONFIG_BLK_DEV_PS2) += ps2esdi.o obj-$(CONFIG_BLK_DEV_PS2) += ps2esdi.o
obj-$(CONFIG_BLK_DEV_XD) += xd.o obj-$(CONFIG_BLK_DEV_XD) += xd.o
......
#include <linux/blkdev.h>
#include <linux/genhd.h>
#include <linux/initrd.h>
#include <linux/init.h>
#include <linux/major.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <asm/uaccess.h>
unsigned long initrd_start, initrd_end;
int initrd_below_start_ok;
static int initrd_users;
static spinlock_t initrd_users_lock = SPIN_LOCK_UNLOCKED;
static struct gendisk *initrd_disk;
static ssize_t initrd_read(struct file *file, char *buf,
size_t count, loff_t *ppos)
{
int left = initrd_end - initrd_start - *ppos;
if (count > left)
count = left;
if (count == 0)
return 0;
if (copy_to_user(buf, (char *)initrd_start + *ppos, count))
return -EFAULT;
*ppos += count;
return count;
}
static int initrd_release(struct inode *inode,struct file *file)
{
blkdev_put(inode->i_bdev, BDEV_FILE);
spin_lock(&initrd_users_lock);
if (!--initrd_users) {
spin_unlock(&initrd_users_lock);
del_gendisk(initrd_disk);
free_initrd_mem(initrd_start, initrd_end);
initrd_start = 0;
} else
spin_unlock(&initrd_users_lock);
return 0;
}
static struct file_operations initrd_fops = {
.read = initrd_read,
.release = initrd_release,
};
static int initrd_open(struct inode *inode, struct file *filp)
{
if (!initrd_start)
return -ENODEV;
spin_lock(&initrd_users_lock);
initrd_users++;
spin_unlock(&initrd_users_lock);
filp->f_op = &initrd_fops;
return 0;
}
static struct block_device_operations initrd_bdops = {
.owner = THIS_MODULE,
.open = initrd_open,
};
static int __init initrd_init(void)
{
initrd_disk = alloc_disk(1);
if (!initrd_disk)
return -ENOMEM;
initrd_disk->major = RAMDISK_MAJOR;
initrd_disk->first_minor = INITRD_MINOR;
initrd_disk->fops = &initrd_bdops;
sprintf(initrd_disk->disk_name, "initrd");
sprintf(initrd_disk->devfs_name, "rd/initrd");
set_capacity(initrd_disk, (initrd_end-initrd_start+511) >> 9);
add_disk(initrd_disk);
return 0;
}
static void __exit initrd_exit(void)
{
put_disk(initrd_disk);
}
module_init(initrd_init);
module_exit(initrd_exit);
...@@ -842,8 +842,9 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp, ...@@ -842,8 +842,9 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp,
CDROM_AUDIO_NO_STATUS; CDROM_AUDIO_NO_STATUS;
} }
copy_from_user(&sjcd_msf, (void *) arg, if (copy_from_user(&sjcd_msf, (void *) arg,
sizeof(sjcd_msf)); sizeof(sjcd_msf)))
return (-EFAULT);
sjcd_playing.start.min = sjcd_playing.start.min =
bin2bcd(sjcd_msf.cdmsf_min0); bin2bcd(sjcd_msf.cdmsf_min0);
...@@ -893,9 +894,9 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp, ...@@ -893,9 +894,9 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp,
sizeof(toc_entry))) == 0) { sizeof(toc_entry))) == 0) {
struct sjcd_hw_disk_info *tp; struct sjcd_hw_disk_info *tp;
copy_from_user(&toc_entry, (void *) arg, if (copy_from_user(&toc_entry, (void *) arg,
sizeof(toc_entry)); sizeof(toc_entry)))
return (-EFAULT);
if (toc_entry.cdte_track == CDROM_LEADOUT) if (toc_entry.cdte_track == CDROM_LEADOUT)
tp = &sjcd_table_of_contents[0]; tp = &sjcd_table_of_contents[0];
else if (toc_entry.cdte_track < else if (toc_entry.cdte_track <
...@@ -948,8 +949,10 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp, ...@@ -948,8 +949,10 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp,
sizeof(subchnl))) == 0) { sizeof(subchnl))) == 0) {
struct sjcd_hw_qinfo q_info; struct sjcd_hw_qinfo q_info;
copy_from_user(&subchnl, (void *) arg, if (copy_from_user(&subchnl, (void *) arg,
sizeof(subchnl)); sizeof(subchnl)))
return (-EFAULT);
if (sjcd_get_q_info(&q_info) < 0) if (sjcd_get_q_info(&q_info) < 0)
return (-EIO); return (-EIO);
...@@ -1005,8 +1008,9 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp, ...@@ -1005,8 +1008,9 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp,
sizeof(vol_ctrl))) == 0) { sizeof(vol_ctrl))) == 0) {
unsigned char dummy[4]; unsigned char dummy[4];
copy_from_user(&vol_ctrl, (void *) arg, if (copy_from_user(&vol_ctrl, (void *) arg,
sizeof(vol_ctrl)); sizeof(vol_ctrl)))
return (-EFAULT);
sjcd_send_4_cmd(SCMD_SET_VOLUME, sjcd_send_4_cmd(SCMD_SET_VOLUME,
vol_ctrl.channel0, 0xFF, vol_ctrl.channel0, 0xFF,
vol_ctrl.channel1, 0xFF); vol_ctrl.channel1, 0xFF);
......
...@@ -214,6 +214,7 @@ int __init applicom_init(void) ...@@ -214,6 +214,7 @@ int __init applicom_init(void)
if (!RamIO) { if (!RamIO) {
printk(KERN_INFO "ac.o: Failed to ioremap PCI memory space at 0x%lx\n", dev->resource[0].start); printk(KERN_INFO "ac.o: Failed to ioremap PCI memory space at 0x%lx\n", dev->resource[0].start);
pci_disable_device(dev);
return -EIO; return -EIO;
} }
...@@ -225,12 +226,14 @@ int __init applicom_init(void) ...@@ -225,12 +226,14 @@ int __init applicom_init(void)
(unsigned long)RamIO,0))) { (unsigned long)RamIO,0))) {
printk(KERN_INFO "ac.o: PCI Applicom device doesn't have correct signature.\n"); printk(KERN_INFO "ac.o: PCI Applicom device doesn't have correct signature.\n");
iounmap(RamIO); iounmap(RamIO);
pci_disable_device(dev);
continue; continue;
} }
if (request_irq(dev->irq, &ac_interrupt, SA_SHIRQ, "Applicom PCI", &dummy)) { if (request_irq(dev->irq, &ac_interrupt, SA_SHIRQ, "Applicom PCI", &dummy)) {
printk(KERN_INFO "Could not allocate IRQ %d for PCI Applicom device.\n", dev->irq); printk(KERN_INFO "Could not allocate IRQ %d for PCI Applicom device.\n", dev->irq);
iounmap(RamIO); iounmap(RamIO);
pci_disable_device(dev);
apbs[boardno - 1].RamIO = 0; apbs[boardno - 1].RamIO = 0;
continue; continue;
} }
...@@ -257,12 +260,6 @@ int __init applicom_init(void) ...@@ -257,12 +260,6 @@ int __init applicom_init(void)
/* Now try the specified ISA cards */ /* Now try the specified ISA cards */
#warning "LEAK"
RamIO = ioremap(mem, LEN_RAM_IO * MAX_ISA_BOARD);
if (!RamIO)
printk(KERN_INFO "ac.o: Failed to ioremap ISA memory space at 0x%lx\n", mem);
for (i = 0; i < MAX_ISA_BOARD; i++) { for (i = 0; i < MAX_ISA_BOARD; i++) {
RamIO = ioremap(mem + (LEN_RAM_IO * i), LEN_RAM_IO); RamIO = ioremap(mem + (LEN_RAM_IO * i), LEN_RAM_IO);
...@@ -285,7 +282,8 @@ int __init applicom_init(void) ...@@ -285,7 +282,8 @@ int __init applicom_init(void)
iounmap((void *) RamIO); iounmap((void *) RamIO);
apbs[boardno - 1].RamIO = 0; apbs[boardno - 1].RamIO = 0;
} }
apbs[boardno - 1].irq = irq; else
apbs[boardno - 1].irq = irq;
} }
else else
apbs[boardno - 1].irq = 0; apbs[boardno - 1].irq = 0;
......
...@@ -1796,7 +1796,7 @@ static void idefloppy_setup (ide_drive_t *drive, idefloppy_floppy_t *floppy) ...@@ -1796,7 +1796,7 @@ static void idefloppy_setup (ide_drive_t *drive, idefloppy_floppy_t *floppy)
* we'll leave the limitation below for the 2.2.x tree. * we'll leave the limitation below for the 2.2.x tree.
*/ */
if (strcmp(drive->id->model, "IOMEGA ZIP 100 ATAPI") == 0) { if (strstr(drive->id->model, "IOMEGA ZIP") != NULL) {
set_bit(IDEFLOPPY_ZIP_DRIVE, &floppy->flags); set_bit(IDEFLOPPY_ZIP_DRIVE, &floppy->flags);
/* This value will be visible in the /proc/ide/hdx/settings */ /* This value will be visible in the /proc/ide/hdx/settings */
floppy->ticks = IDEFLOPPY_TICKS_DELAY; floppy->ticks = IDEFLOPPY_TICKS_DELAY;
......
/* $Id: divasmain.c,v 1.43 2003/09/22 08:57:31 schindler Exp $ /* $Id: divasmain.c,v 1.46 2003/10/10 12:28:14 armin Exp $
* *
* Low level driver for Eicon DIVA Server ISDN cards. * Low level driver for Eicon DIVA Server ISDN cards.
* *
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include "diva_dma.h" #include "diva_dma.h"
#include "diva_pci.h" #include "diva_pci.h"
static char *main_revision = "$Revision: 1.43 $"; static char *main_revision = "$Revision: 1.46 $";
static int major; static int major;
...@@ -69,7 +69,7 @@ extern int divasfunc_init(int dbgmask); ...@@ -69,7 +69,7 @@ extern int divasfunc_init(int dbgmask);
extern void divasfunc_exit(void); extern void divasfunc_exit(void);
typedef struct _diva_os_thread_dpc { typedef struct _diva_os_thread_dpc {
struct tasklet_struct divas_task; struct work_struct divas_task;
struct work_struct trap_script_task; struct work_struct trap_script_task;
diva_os_soft_isr_t *psoft_isr; diva_os_soft_isr_t *psoft_isr;
int card_failed; int card_failed;
...@@ -552,7 +552,7 @@ void diva_os_remove_irq(void *context, byte irq) ...@@ -552,7 +552,7 @@ void diva_os_remove_irq(void *context, byte irq)
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
DPC framework implementation DPC framework implementation
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void diva_os_dpc_proc(unsigned long context) static void diva_os_dpc_proc(void *context)
{ {
diva_os_thread_dpc_t *psoft_isr = (diva_os_thread_dpc_t *) context; diva_os_thread_dpc_t *psoft_isr = (diva_os_thread_dpc_t *) context;
diva_os_soft_isr_t *pisr = psoft_isr->psoft_isr; diva_os_soft_isr_t *pisr = psoft_isr->psoft_isr;
...@@ -575,8 +575,7 @@ int diva_os_initialize_soft_isr(diva_os_soft_isr_t * psoft_isr, ...@@ -575,8 +575,7 @@ int diva_os_initialize_soft_isr(diva_os_soft_isr_t * psoft_isr,
psoft_isr->callback_context = callback_context; psoft_isr->callback_context = callback_context;
pdpc->psoft_isr = psoft_isr; pdpc->psoft_isr = psoft_isr;
INIT_WORK(&pdpc->trap_script_task, diva_adapter_trapped, pdpc); INIT_WORK(&pdpc->trap_script_task, diva_adapter_trapped, pdpc);
tasklet_init(&pdpc->divas_task, diva_os_dpc_proc, INIT_WORK(&pdpc->divas_task, diva_os_dpc_proc, pdpc);
(unsigned long) pdpc);
return (0); return (0);
} }
...@@ -587,7 +586,7 @@ int diva_os_schedule_soft_isr(diva_os_soft_isr_t * psoft_isr) ...@@ -587,7 +586,7 @@ int diva_os_schedule_soft_isr(diva_os_soft_isr_t * psoft_isr)
diva_os_thread_dpc_t *pdpc = diva_os_thread_dpc_t *pdpc =
(diva_os_thread_dpc_t *) psoft_isr->object; (diva_os_thread_dpc_t *) psoft_isr->object;
tasklet_schedule(&pdpc->divas_task); schedule_work(&pdpc->divas_task);
} }
return (1); return (1);
...@@ -595,26 +594,18 @@ int diva_os_schedule_soft_isr(diva_os_soft_isr_t * psoft_isr) ...@@ -595,26 +594,18 @@ int diva_os_schedule_soft_isr(diva_os_soft_isr_t * psoft_isr)
int diva_os_cancel_soft_isr(diva_os_soft_isr_t * psoft_isr) int diva_os_cancel_soft_isr(diva_os_soft_isr_t * psoft_isr)
{ {
if (psoft_isr && psoft_isr->object) { flush_scheduled_work();
diva_os_thread_dpc_t *pdpc =
(diva_os_thread_dpc_t *) psoft_isr->object;
tasklet_kill(&pdpc->divas_task);
}
return (0); return (0);
} }
void diva_os_remove_soft_isr(diva_os_soft_isr_t * psoft_isr) void diva_os_remove_soft_isr(diva_os_soft_isr_t * psoft_isr)
{ {
if (psoft_isr && psoft_isr->object) { if (psoft_isr && psoft_isr->object) {
diva_os_thread_dpc_t *pdpc =
(diva_os_thread_dpc_t *) psoft_isr->object;
void *mem; void *mem;
tasklet_kill(&pdpc->divas_task); flush_scheduled_work();
mem = psoft_isr->object; mem = psoft_isr->object;
psoft_isr->object = 0; psoft_isr->object = 0;
flush_scheduled_work();
diva_os_free(0, mem); diva_os_free(0, mem);
} }
} }
......
...@@ -95,7 +95,7 @@ struct list_head saa7134_devlist; ...@@ -95,7 +95,7 @@ struct list_head saa7134_devlist;
unsigned int saa7134_devcount; unsigned int saa7134_devcount;
#define dprintk(fmt, arg...) if (core_debug) \ #define dprintk(fmt, arg...) if (core_debug) \
printk(KERN_DEBUG "%s/core: " fmt, dev->name, ## arg) printk(KERN_DEBUG "%s/core: " fmt, dev->name , ## arg)
/* ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */
/* debug help functions */ /* debug help functions */
......
...@@ -148,11 +148,14 @@ static struct net_device *init_netdev(struct net_device *dev, int sizeof_priv, ...@@ -148,11 +148,14 @@ static struct net_device *init_netdev(struct net_device *dev, int sizeof_priv,
if (dev->name[0] == '\0' || dev->name[0] == ' ') { if (dev->name[0] == '\0' || dev->name[0] == ' ') {
strcpy(dev->name, mask); strcpy(dev->name, mask);
rtnl_lock();
if (dev_alloc_name(dev, mask)<0) { if (dev_alloc_name(dev, mask)<0) {
rtnl_unlock();
if (new_device) if (new_device)
kfree(dev); kfree(dev);
return NULL; return NULL;
} }
rtnl_unlock();
} }
netdev_boot_setup_check(dev); netdev_boot_setup_check(dev);
......
...@@ -2996,7 +2996,7 @@ static void get_hme_mac_nonsparc(struct pci_dev *pdev, unsigned char *dev_addr) ...@@ -2996,7 +2996,7 @@ static void get_hme_mac_nonsparc(struct pci_dev *pdev, unsigned char *dev_addr)
dev_addr[0] = 0x08; dev_addr[0] = 0x08;
dev_addr[1] = 0x00; dev_addr[1] = 0x00;
dev_addr[2] = 0x20; dev_addr[2] = 0x20;
get_random_bytes(dev_addr, 3); get_random_bytes(&dev_addr[3], 3);
return; return;
} }
#endif /* !(__sparc__) */ #endif /* !(__sparc__) */
......
...@@ -204,7 +204,7 @@ config REISERFS_FS ...@@ -204,7 +204,7 @@ config REISERFS_FS
In general, ReiserFS is as fast as ext2, but is very efficient with In general, ReiserFS is as fast as ext2, but is very efficient with
large directories and small files. Additional patches are needed large directories and small files. Additional patches are needed
for NFS and quotas, please see <http://www.reiserfs.org/> for links. for NFS and quotas, please see <http://www.namesys.com/> for links.
It is more easily extended to have features currently found in It is more easily extended to have features currently found in
database and keyword search systems than block allocation based file database and keyword search systems than block allocation based file
...@@ -212,7 +212,7 @@ config REISERFS_FS ...@@ -212,7 +212,7 @@ config REISERFS_FS
plugins consistent with our motto ``It takes more than a license to plugins consistent with our motto ``It takes more than a license to
make source code open.'' make source code open.''
Read <http://www.reiserfs.org/> to learn more about reiserfs. Read <http://www.namesys.com/> to learn more about reiserfs.
Sponsored by Threshold Networks, Emusic.com, and Bigstorage.com. Sponsored by Threshold Networks, Emusic.com, and Bigstorage.com.
......
...@@ -19,7 +19,7 @@ static struct posix_acl * ...@@ -19,7 +19,7 @@ static struct posix_acl *
ext2_acl_from_disk(const void *value, size_t size) ext2_acl_from_disk(const void *value, size_t size)
{ {
const char *end = (char *)value + size; const char *end = (char *)value + size;
size_t n, count; int n, count;
struct posix_acl *acl; struct posix_acl *acl;
if (!value) if (!value)
......
...@@ -20,7 +20,7 @@ static struct posix_acl * ...@@ -20,7 +20,7 @@ static struct posix_acl *
ext3_acl_from_disk(const void *value, size_t size) ext3_acl_from_disk(const void *value, size_t size)
{ {
const char *end = (char *)value + size; const char *end = (char *)value + size;
size_t n, count; int n, count;
struct posix_acl *acl; struct posix_acl *acl;
if (!value) if (!value)
......
...@@ -769,7 +769,6 @@ ext3_get_block_handle(handle_t *handle, struct inode *inode, sector_t iblock, ...@@ -769,7 +769,6 @@ ext3_get_block_handle(handle_t *handle, struct inode *inode, sector_t iblock,
int boundary = 0; int boundary = 0;
int depth = ext3_block_to_path(inode, iblock, offsets, &boundary); int depth = ext3_block_to_path(inode, iblock, offsets, &boundary);
struct ext3_inode_info *ei = EXT3_I(inode); struct ext3_inode_info *ei = EXT3_I(inode);
loff_t new_size;
J_ASSERT(handle != NULL || create == 0); J_ASSERT(handle != NULL || create == 0);
...@@ -834,23 +833,17 @@ ext3_get_block_handle(handle_t *handle, struct inode *inode, sector_t iblock, ...@@ -834,23 +833,17 @@ ext3_get_block_handle(handle_t *handle, struct inode *inode, sector_t iblock,
if (!err) if (!err)
err = ext3_splice_branch(handle, inode, iblock, chain, err = ext3_splice_branch(handle, inode, iblock, chain,
partial, left); partial, left);
/* i_disksize growing is protected by truncate_sem
* don't forget to protect it if you're about to implement
* concurrent ext3_get_block() -bzzz */
if (!err && extend_disksize && inode->i_size > ei->i_disksize)
ei->i_disksize = inode->i_size;
up(&ei->truncate_sem); up(&ei->truncate_sem);
if (err == -EAGAIN) if (err == -EAGAIN)
goto changed; goto changed;
if (err) if (err)
goto cleanup; goto cleanup;
if (extend_disksize) {
/*
* This is not racy against ext3_truncate's modification of
* i_disksize because VM/VFS ensures that the file cannot be
* extended while truncate is in progress. It is racy between
* multiple parallel instances of get_block, but we have BKL.
*/
new_size = inode->i_size;
if (new_size > ei->i_disksize)
ei->i_disksize = new_size;
}
set_buffer_new(bh_result); set_buffer_new(bh_result);
goto got_it; goto got_it;
......
...@@ -453,7 +453,7 @@ static void prune_icache(int nr_to_scan) ...@@ -453,7 +453,7 @@ static void prune_icache(int nr_to_scan)
dispose_list(&freeable); dispose_list(&freeable);
up(&iprune_sem); up(&iprune_sem);
if (current_is_kswapd) if (current_is_kswapd())
mod_page_state(kswapd_inodesteal, reap); mod_page_state(kswapd_inodesteal, reap);
else else
mod_page_state(pginodesteal, reap); mod_page_state(pginodesteal, reap);
......
...@@ -478,14 +478,15 @@ static void *r_start(struct seq_file *m, loff_t *pos) ...@@ -478,14 +478,15 @@ static void *r_start(struct seq_file *m, loff_t *pos)
static void *r_next(struct seq_file *m, void *v, loff_t *pos) static void *r_next(struct seq_file *m, void *v, loff_t *pos)
{ {
++*pos; ++*pos;
if (v)
deactivate_super(v);
return NULL; return NULL;
} }
static void r_stop(struct seq_file *m, void *v) static void r_stop(struct seq_file *m, void *v)
{ {
struct proc_dir_entry *de = m->private; if (v)
struct super_block *s = de->data; deactivate_super(v);
deactivate_super(s);
} }
static int r_show(struct seq_file *m, void *v) static int r_show(struct seq_file *m, void *v)
......
#ifndef __ASM_MACH_MPPARSE_H #ifndef __ASM_MACH_MPPARSE_H
#define __ASM_MACH_MPPARSE_H #define __ASM_MACH_MPPARSE_H
static void __init smp_read_mpc_oem(struct mp_config_oemtable *oemtable,
unsigned short oemsize);
static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name,
struct mpc_config_translation *translation) struct mpc_config_translation *translation)
{ {
...@@ -24,16 +21,6 @@ static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, ...@@ -24,16 +21,6 @@ static inline void mpc_oem_pci_bus(struct mpc_config_bus *m,
quad_local_to_mp_bus_id[quad][local] = m->mpc_busid; quad_local_to_mp_bus_id[quad][local] = m->mpc_busid;
} }
static inline void mps_oem_check(struct mp_config_table *mpc, char *oem,
char *productid)
{
if (strncmp(oem, "IBM NUMA", 8))
printk("Warning! May not be a NUMA-Q system!\n");
if (mpc->mpc_oemptr)
smp_read_mpc_oem((struct mp_config_oemtable *) mpc->mpc_oemptr,
mpc->mpc_oemsize);
}
/* Hook from generic ACPI tables.c */ /* Hook from generic ACPI tables.c */
static inline void acpi_madt_oem_check(char *oem_id, char *oem_table_id) static inline void acpi_madt_oem_check(char *oem_id, char *oem_table_id)
{ {
......
...@@ -48,10 +48,13 @@ static __inline__ int atomic_read(const atomic_t *v) ...@@ -48,10 +48,13 @@ static __inline__ int atomic_read(const atomic_t *v)
#define atomic_set(v, i) (((v)->counter) = ((i) << 8)) #define atomic_set(v, i) (((v)->counter) = ((i) << 8))
#endif #endif
static __inline__ int __atomic_add(int i, atomic_t *v) static inline int __atomic_add(int i, atomic_t *v)
{ {
register volatile int *ptr asm("g1"); register volatile int *ptr asm("g1");
register int increment asm("g2"); register int increment asm("g2");
register int tmp1 asm("g3");
register int tmp2 asm("g4");
register int tmp3 asm("g7");
ptr = &v->counter; ptr = &v->counter;
increment = i; increment = i;
...@@ -60,17 +63,20 @@ static __inline__ int __atomic_add(int i, atomic_t *v) ...@@ -60,17 +63,20 @@ static __inline__ int __atomic_add(int i, atomic_t *v)
"mov %%o7, %%g4\n\t" "mov %%o7, %%g4\n\t"
"call ___atomic_add\n\t" "call ___atomic_add\n\t"
" add %%o7, 8, %%o7\n" " add %%o7, 8, %%o7\n"
: "=&r" (increment) : "=&r" (increment), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3)
: "0" (increment), "r" (ptr) : "0" (increment), "r" (ptr)
: "g3", "g4", "g7", "memory", "cc"); : "memory", "cc");
return increment; return increment;
} }
static __inline__ int __atomic_sub(int i, atomic_t *v) static inline int __atomic_sub(int i, atomic_t *v)
{ {
register volatile int *ptr asm("g1"); register volatile int *ptr asm("g1");
register int increment asm("g2"); register int increment asm("g2");
register int tmp1 asm("g3");
register int tmp2 asm("g4");
register int tmp3 asm("g7");
ptr = &v->counter; ptr = &v->counter;
increment = i; increment = i;
...@@ -79,9 +85,9 @@ static __inline__ int __atomic_sub(int i, atomic_t *v) ...@@ -79,9 +85,9 @@ static __inline__ int __atomic_sub(int i, atomic_t *v)
"mov %%o7, %%g4\n\t" "mov %%o7, %%g4\n\t"
"call ___atomic_sub\n\t" "call ___atomic_sub\n\t"
" add %%o7, 8, %%o7\n" " add %%o7, 8, %%o7\n"
: "=&r" (increment) : "=&r" (increment), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3)
: "0" (increment), "r" (ptr) : "0" (increment), "r" (ptr)
: "g3", "g4", "g7", "memory", "cc"); : "memory", "cc");
return increment; return increment;
} }
......
...@@ -20,10 +20,14 @@ ...@@ -20,10 +20,14 @@
* within the first byte. Sparc is BIG-Endian. Unless noted otherwise * within the first byte. Sparc is BIG-Endian. Unless noted otherwise
* all bit-ops return 0 if bit was previously clear and != 0 otherwise. * all bit-ops return 0 if bit was previously clear and != 0 otherwise.
*/ */
static __inline__ int test_and_set_bit(unsigned long nr, volatile unsigned long *addr) static inline int test_and_set_bit(unsigned long nr, volatile unsigned long *addr)
{ {
register unsigned long mask asm("g2"); register unsigned long mask asm("g2");
register unsigned long *ADDR asm("g1"); register unsigned long *ADDR asm("g1");
register int tmp1 asm("g3");
register int tmp2 asm("g4");
register int tmp3 asm("g5");
register int tmp4 asm("g7");
ADDR = ((unsigned long *) addr) + (nr >> 5); ADDR = ((unsigned long *) addr) + (nr >> 5);
mask = 1 << (nr & 31); mask = 1 << (nr & 31);
...@@ -32,17 +36,21 @@ static __inline__ int test_and_set_bit(unsigned long nr, volatile unsigned long ...@@ -32,17 +36,21 @@ static __inline__ int test_and_set_bit(unsigned long nr, volatile unsigned long
"mov %%o7, %%g4\n\t" "mov %%o7, %%g4\n\t"
"call ___set_bit\n\t" "call ___set_bit\n\t"
" add %%o7, 8, %%o7\n" " add %%o7, 8, %%o7\n"
: "=&r" (mask) : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
: "0" (mask), "r" (ADDR) : "0" (mask), "r" (ADDR)
: "g3", "g4", "g5", "g7", "memory", "cc"); : "memory", "cc");
return mask != 0; return mask != 0;
} }
static __inline__ void set_bit(unsigned long nr, volatile unsigned long *addr) static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
{ {
register unsigned long mask asm("g2"); register unsigned long mask asm("g2");
register unsigned long *ADDR asm("g1"); register unsigned long *ADDR asm("g1");
register int tmp1 asm("g3");
register int tmp2 asm("g4");
register int tmp3 asm("g5");
register int tmp4 asm("g7");
ADDR = ((unsigned long *) addr) + (nr >> 5); ADDR = ((unsigned long *) addr) + (nr >> 5);
mask = 1 << (nr & 31); mask = 1 << (nr & 31);
...@@ -51,15 +59,19 @@ static __inline__ void set_bit(unsigned long nr, volatile unsigned long *addr) ...@@ -51,15 +59,19 @@ static __inline__ void set_bit(unsigned long nr, volatile unsigned long *addr)
"mov %%o7, %%g4\n\t" "mov %%o7, %%g4\n\t"
"call ___set_bit\n\t" "call ___set_bit\n\t"
" add %%o7, 8, %%o7\n" " add %%o7, 8, %%o7\n"
: "=&r" (mask) : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
: "0" (mask), "r" (ADDR) : "0" (mask), "r" (ADDR)
: "g3", "g4", "g5", "g7", "cc"); : "memory", "cc");
} }
static __inline__ int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr) static inline int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr)
{ {
register unsigned long mask asm("g2"); register unsigned long mask asm("g2");
register unsigned long *ADDR asm("g1"); register unsigned long *ADDR asm("g1");
register int tmp1 asm("g3");
register int tmp2 asm("g4");
register int tmp3 asm("g5");
register int tmp4 asm("g7");
ADDR = ((unsigned long *) addr) + (nr >> 5); ADDR = ((unsigned long *) addr) + (nr >> 5);
mask = 1 << (nr & 31); mask = 1 << (nr & 31);
...@@ -68,17 +80,21 @@ static __inline__ int test_and_clear_bit(unsigned long nr, volatile unsigned lon ...@@ -68,17 +80,21 @@ static __inline__ int test_and_clear_bit(unsigned long nr, volatile unsigned lon
"mov %%o7, %%g4\n\t" "mov %%o7, %%g4\n\t"
"call ___clear_bit\n\t" "call ___clear_bit\n\t"
" add %%o7, 8, %%o7\n" " add %%o7, 8, %%o7\n"
: "=&r" (mask) : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
: "0" (mask), "r" (ADDR) : "0" (mask), "r" (ADDR)
: "g3", "g4", "g5", "g7", "memory", "cc"); : "memory", "cc");
return mask != 0; return mask != 0;
} }
static __inline__ void clear_bit(unsigned long nr, volatile unsigned long *addr) static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
{ {
register unsigned long mask asm("g2"); register unsigned long mask asm("g2");
register unsigned long *ADDR asm("g1"); register unsigned long *ADDR asm("g1");
register int tmp1 asm("g3");
register int tmp2 asm("g4");
register int tmp3 asm("g5");
register int tmp4 asm("g7");
ADDR = ((unsigned long *) addr) + (nr >> 5); ADDR = ((unsigned long *) addr) + (nr >> 5);
mask = 1 << (nr & 31); mask = 1 << (nr & 31);
...@@ -87,15 +103,19 @@ static __inline__ void clear_bit(unsigned long nr, volatile unsigned long *addr) ...@@ -87,15 +103,19 @@ static __inline__ void clear_bit(unsigned long nr, volatile unsigned long *addr)
"mov %%o7, %%g4\n\t" "mov %%o7, %%g4\n\t"
"call ___clear_bit\n\t" "call ___clear_bit\n\t"
" add %%o7, 8, %%o7\n" " add %%o7, 8, %%o7\n"
: "=&r" (mask) : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
: "0" (mask), "r" (ADDR) : "0" (mask), "r" (ADDR)
: "g3", "g4", "g5", "g7", "cc"); : "memory", "cc");
} }
static __inline__ int test_and_change_bit(unsigned long nr, volatile unsigned long *addr) static inline int test_and_change_bit(unsigned long nr, volatile unsigned long *addr)
{ {
register unsigned long mask asm("g2"); register unsigned long mask asm("g2");
register unsigned long *ADDR asm("g1"); register unsigned long *ADDR asm("g1");
register int tmp1 asm("g3");
register int tmp2 asm("g4");
register int tmp3 asm("g5");
register int tmp4 asm("g7");
ADDR = ((unsigned long *) addr) + (nr >> 5); ADDR = ((unsigned long *) addr) + (nr >> 5);
mask = 1 << (nr & 31); mask = 1 << (nr & 31);
...@@ -104,17 +124,21 @@ static __inline__ int test_and_change_bit(unsigned long nr, volatile unsigned lo ...@@ -104,17 +124,21 @@ static __inline__ int test_and_change_bit(unsigned long nr, volatile unsigned lo
"mov %%o7, %%g4\n\t" "mov %%o7, %%g4\n\t"
"call ___change_bit\n\t" "call ___change_bit\n\t"
" add %%o7, 8, %%o7\n" " add %%o7, 8, %%o7\n"
: "=&r" (mask) : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
: "0" (mask), "r" (ADDR) : "0" (mask), "r" (ADDR)
: "g3", "g4", "g5", "g7", "memory", "cc"); : "memory", "cc");
return mask != 0; return mask != 0;
} }
static __inline__ void change_bit(unsigned long nr, volatile unsigned long *addr) static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
{ {
register unsigned long mask asm("g2"); register unsigned long mask asm("g2");
register unsigned long *ADDR asm("g1"); register unsigned long *ADDR asm("g1");
register int tmp1 asm("g3");
register int tmp2 asm("g4");
register int tmp3 asm("g5");
register int tmp4 asm("g7");
ADDR = ((unsigned long *) addr) + (nr >> 5); ADDR = ((unsigned long *) addr) + (nr >> 5);
mask = 1 << (nr & 31); mask = 1 << (nr & 31);
...@@ -123,15 +147,15 @@ static __inline__ void change_bit(unsigned long nr, volatile unsigned long *addr ...@@ -123,15 +147,15 @@ static __inline__ void change_bit(unsigned long nr, volatile unsigned long *addr
"mov %%o7, %%g4\n\t" "mov %%o7, %%g4\n\t"
"call ___change_bit\n\t" "call ___change_bit\n\t"
" add %%o7, 8, %%o7\n" " add %%o7, 8, %%o7\n"
: "=&r" (mask) : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
: "0" (mask), "r" (ADDR) : "0" (mask), "r" (ADDR)
: "g3", "g4", "g5", "g7", "cc"); : "memory", "cc");
} }
/* /*
* non-atomic versions * non-atomic versions
*/ */
static __inline__ void __set_bit(int nr, volatile unsigned long *addr) static inline void __set_bit(int nr, volatile unsigned long *addr)
{ {
unsigned long mask = 1UL << (nr & 0x1f); unsigned long mask = 1UL << (nr & 0x1f);
unsigned long *p = ((unsigned long *)addr) + (nr >> 5); unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
...@@ -139,7 +163,7 @@ static __inline__ void __set_bit(int nr, volatile unsigned long *addr) ...@@ -139,7 +163,7 @@ static __inline__ void __set_bit(int nr, volatile unsigned long *addr)
*p |= mask; *p |= mask;
} }
static __inline__ void __clear_bit(int nr, volatile unsigned long *addr) static inline void __clear_bit(int nr, volatile unsigned long *addr)
{ {
unsigned long mask = 1UL << (nr & 0x1f); unsigned long mask = 1UL << (nr & 0x1f);
unsigned long *p = ((unsigned long *)addr) + (nr >> 5); unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
...@@ -147,7 +171,7 @@ static __inline__ void __clear_bit(int nr, volatile unsigned long *addr) ...@@ -147,7 +171,7 @@ static __inline__ void __clear_bit(int nr, volatile unsigned long *addr)
*p &= ~mask; *p &= ~mask;
} }
static __inline__ void __change_bit(int nr, volatile unsigned long *addr) static inline void __change_bit(int nr, volatile unsigned long *addr)
{ {
unsigned long mask = 1UL << (nr & 0x1f); unsigned long mask = 1UL << (nr & 0x1f);
unsigned long *p = ((unsigned long *)addr) + (nr >> 5); unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
...@@ -155,7 +179,7 @@ static __inline__ void __change_bit(int nr, volatile unsigned long *addr) ...@@ -155,7 +179,7 @@ static __inline__ void __change_bit(int nr, volatile unsigned long *addr)
*p ^= mask; *p ^= mask;
} }
static __inline__ int __test_and_set_bit(int nr, volatile unsigned long *addr) static inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
{ {
unsigned long mask = 1UL << (nr & 0x1f); unsigned long mask = 1UL << (nr & 0x1f);
unsigned long *p = ((unsigned long *)addr) + (nr >> 5); unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
...@@ -165,7 +189,7 @@ static __inline__ int __test_and_set_bit(int nr, volatile unsigned long *addr) ...@@ -165,7 +189,7 @@ static __inline__ int __test_and_set_bit(int nr, volatile unsigned long *addr)
return (old & mask) != 0; return (old & mask) != 0;
} }
static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long *addr) static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
{ {
unsigned long mask = 1UL << (nr & 0x1f); unsigned long mask = 1UL << (nr & 0x1f);
unsigned long *p = ((unsigned long *)addr) + (nr >> 5); unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
...@@ -175,7 +199,7 @@ static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long *addr) ...@@ -175,7 +199,7 @@ static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long *addr)
return (old & mask) != 0; return (old & mask) != 0;
} }
static __inline__ int __test_and_change_bit(int nr, volatile unsigned long *addr) static inline int __test_and_change_bit(int nr, volatile unsigned long *addr)
{ {
unsigned long mask = 1UL << (nr & 0x1f); unsigned long mask = 1UL << (nr & 0x1f);
unsigned long *p = ((unsigned long *)addr) + (nr >> 5); unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
...@@ -189,13 +213,13 @@ static __inline__ int __test_and_change_bit(int nr, volatile unsigned long *addr ...@@ -189,13 +213,13 @@ static __inline__ int __test_and_change_bit(int nr, volatile unsigned long *addr
#define smp_mb__after_clear_bit() do { } while(0) #define smp_mb__after_clear_bit() do { } while(0)
/* The following routine need not be atomic. */ /* The following routine need not be atomic. */
static __inline__ int test_bit(int nr, __const__ volatile unsigned long *addr) static inline int test_bit(int nr, __const__ volatile unsigned long *addr)
{ {
return (1UL & (((unsigned long *)addr)[nr >> 5] >> (nr & 31))) != 0UL; return (1UL & (((unsigned long *)addr)[nr >> 5] >> (nr & 31))) != 0UL;
} }
/* The easy/cheese version for now. */ /* The easy/cheese version for now. */
static __inline__ unsigned long ffz(unsigned long word) static inline unsigned long ffz(unsigned long word)
{ {
unsigned long result = 0; unsigned long result = 0;
...@@ -212,7 +236,7 @@ static __inline__ unsigned long ffz(unsigned long word) ...@@ -212,7 +236,7 @@ static __inline__ unsigned long ffz(unsigned long word)
* *
* Undefined if no bit exists, so code should check against 0 first. * Undefined if no bit exists, so code should check against 0 first.
*/ */
static __inline__ int __ffs(unsigned long word) static inline int __ffs(unsigned long word)
{ {
int num = 0; int num = 0;
...@@ -243,7 +267,7 @@ static __inline__ int __ffs(unsigned long word) ...@@ -243,7 +267,7 @@ static __inline__ int __ffs(unsigned long word)
* unlikely to be set. It's guaranteed that at least one of the 140 * unlikely to be set. It's guaranteed that at least one of the 140
* bits is cleared. * bits is cleared.
*/ */
static __inline__ int sched_find_first_bit(unsigned long *b) static inline int sched_find_first_bit(unsigned long *b)
{ {
if (unlikely(b[0])) if (unlikely(b[0]))
...@@ -262,7 +286,7 @@ static __inline__ int sched_find_first_bit(unsigned long *b) ...@@ -262,7 +286,7 @@ static __inline__ int sched_find_first_bit(unsigned long *b)
* the libc and compiler builtin ffs routines, therefore * the libc and compiler builtin ffs routines, therefore
* differs in spirit from the above ffz (man ffs). * differs in spirit from the above ffz (man ffs).
*/ */
static __inline__ int ffs(int x) static inline int ffs(int x)
{ {
if (!x) if (!x)
return 0; return 0;
...@@ -288,7 +312,7 @@ static __inline__ int ffs(int x) ...@@ -288,7 +312,7 @@ static __inline__ int ffs(int x)
* 'size' bits, starting the search at bit 'offset'. This is largely based * 'size' bits, starting the search at bit 'offset'. This is largely based
* on Linus's ALPHA routines, which are pretty portable BTW. * on Linus's ALPHA routines, which are pretty portable BTW.
*/ */
static __inline__ unsigned long find_next_zero_bit(unsigned long *addr, static inline unsigned long find_next_zero_bit(unsigned long *addr,
unsigned long size, unsigned long offset) unsigned long size, unsigned long offset)
{ {
unsigned long *p = addr + (offset >> 5); unsigned long *p = addr + (offset >> 5);
...@@ -342,7 +366,7 @@ static __inline__ unsigned long find_next_zero_bit(unsigned long *addr, ...@@ -342,7 +366,7 @@ static __inline__ unsigned long find_next_zero_bit(unsigned long *addr,
* *
* Scheduler induced bitop, do not use. * Scheduler induced bitop, do not use.
*/ */
static __inline__ int find_next_bit(unsigned long *addr, int size, int offset) static inline int find_next_bit(unsigned long *addr, int size, int offset)
{ {
unsigned long *p = addr + (offset >> 5); unsigned long *p = addr + (offset >> 5);
int num = offset & ~0x1f; int num = offset & ~0x1f;
...@@ -362,7 +386,7 @@ static __inline__ int find_next_bit(unsigned long *addr, int size, int offset) ...@@ -362,7 +386,7 @@ static __inline__ int find_next_bit(unsigned long *addr, int size, int offset)
/* /*
*/ */
static __inline__ int test_le_bit(int nr, __const__ unsigned long * addr) static inline int test_le_bit(int nr, __const__ unsigned long * addr)
{ {
__const__ unsigned char *ADDR = (__const__ unsigned char *) addr; __const__ unsigned char *ADDR = (__const__ unsigned char *) addr;
return (ADDR[nr >> 3] >> (nr & 7)) & 1; return (ADDR[nr >> 3] >> (nr & 7)) & 1;
...@@ -371,7 +395,7 @@ static __inline__ int test_le_bit(int nr, __const__ unsigned long * addr) ...@@ -371,7 +395,7 @@ static __inline__ int test_le_bit(int nr, __const__ unsigned long * addr)
/* /*
* non-atomic versions * non-atomic versions
*/ */
static __inline__ void __set_le_bit(int nr, unsigned long *addr) static inline void __set_le_bit(int nr, unsigned long *addr)
{ {
unsigned char *ADDR = (unsigned char *)addr; unsigned char *ADDR = (unsigned char *)addr;
...@@ -379,7 +403,7 @@ static __inline__ void __set_le_bit(int nr, unsigned long *addr) ...@@ -379,7 +403,7 @@ static __inline__ void __set_le_bit(int nr, unsigned long *addr)
*ADDR |= 1 << (nr & 0x07); *ADDR |= 1 << (nr & 0x07);
} }
static __inline__ void __clear_le_bit(int nr, unsigned long *addr) static inline void __clear_le_bit(int nr, unsigned long *addr)
{ {
unsigned char *ADDR = (unsigned char *)addr; unsigned char *ADDR = (unsigned char *)addr;
...@@ -387,7 +411,7 @@ static __inline__ void __clear_le_bit(int nr, unsigned long *addr) ...@@ -387,7 +411,7 @@ static __inline__ void __clear_le_bit(int nr, unsigned long *addr)
*ADDR &= ~(1 << (nr & 0x07)); *ADDR &= ~(1 << (nr & 0x07));
} }
static __inline__ int __test_and_set_le_bit(int nr, unsigned long *addr) static inline int __test_and_set_le_bit(int nr, unsigned long *addr)
{ {
int mask, retval; int mask, retval;
unsigned char *ADDR = (unsigned char *)addr; unsigned char *ADDR = (unsigned char *)addr;
...@@ -399,7 +423,7 @@ static __inline__ int __test_and_set_le_bit(int nr, unsigned long *addr) ...@@ -399,7 +423,7 @@ static __inline__ int __test_and_set_le_bit(int nr, unsigned long *addr)
return retval; return retval;
} }
static __inline__ int __test_and_clear_le_bit(int nr, unsigned long *addr) static inline int __test_and_clear_le_bit(int nr, unsigned long *addr)
{ {
int mask, retval; int mask, retval;
unsigned char *ADDR = (unsigned char *)addr; unsigned char *ADDR = (unsigned char *)addr;
...@@ -411,7 +435,7 @@ static __inline__ int __test_and_clear_le_bit(int nr, unsigned long *addr) ...@@ -411,7 +435,7 @@ static __inline__ int __test_and_clear_le_bit(int nr, unsigned long *addr)
return retval; return retval;
} }
static __inline__ unsigned long find_next_zero_le_bit(unsigned long *addr, static inline unsigned long find_next_zero_le_bit(unsigned long *addr,
unsigned long size, unsigned long offset) unsigned long size, unsigned long offset)
{ {
unsigned long *p = addr + (offset >> 5); unsigned long *p = addr + (offset >> 5);
...@@ -455,14 +479,16 @@ static __inline__ unsigned long find_next_zero_le_bit(unsigned long *addr, ...@@ -455,14 +479,16 @@ static __inline__ unsigned long find_next_zero_le_bit(unsigned long *addr,
#define find_first_zero_le_bit(addr, size) \ #define find_first_zero_le_bit(addr, size) \
find_next_zero_le_bit((addr), (size), 0) find_next_zero_le_bit((addr), (size), 0)
#define ext2_set_bit __test_and_set_le_bit #define ext2_set_bit(nr,addr) \
#define ext2_clear_bit __test_and_clear_le_bit __test_and_set_le_bit((nr),(unsigned long *)(addr))
#define ext2_clear_bit(nr,addr) \
__test_and_clear_le_bit((nr),(unsigned long *)(addr))
#define ext2_set_bit_atomic(lock, nr, addr) \ #define ext2_set_bit_atomic(lock, nr, addr) \
({ \ ({ \
int ret; \ int ret; \
spin_lock(lock); \ spin_lock(lock); \
ret = ext2_set_bit((nr), (addr)); \ ret = ext2_set_bit((nr), (unsigned long *)(addr)); \
spin_unlock(lock); \ spin_unlock(lock); \
ret; \ ret; \
}) })
...@@ -471,21 +497,29 @@ static __inline__ unsigned long find_next_zero_le_bit(unsigned long *addr, ...@@ -471,21 +497,29 @@ static __inline__ unsigned long find_next_zero_le_bit(unsigned long *addr,
({ \ ({ \
int ret; \ int ret; \
spin_lock(lock); \ spin_lock(lock); \
ret = ext2_clear_bit((nr), (addr)); \ ret = ext2_clear_bit((nr), (unsigned long *)(addr)); \
spin_unlock(lock); \ spin_unlock(lock); \
ret; \ ret; \
}) })
#define ext2_test_bit test_le_bit #define ext2_test_bit(nr,addr) \
#define ext2_find_first_zero_bit find_first_zero_le_bit test_le_bit((nr),(unsigned long *)(addr))
#define ext2_find_next_zero_bit find_next_zero_le_bit #define ext2_find_first_zero_bit(addr, size) \
find_first_zero_le_bit((unsigned long *)(addr), (size))
#define ext2_find_next_zero_bit(addr, size, off) \
find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
/* Bitmap functions for the minix filesystem. */ /* Bitmap functions for the minix filesystem. */
#define minix_test_and_set_bit(nr,addr) test_and_set_bit(nr,addr) #define minix_test_and_set_bit(nr,addr) \
#define minix_set_bit(nr,addr) set_bit(nr,addr) test_and_set_bit((nr),(unsigned long *)(addr))
#define minix_test_and_clear_bit(nr,addr) test_and_clear_bit(nr,addr) #define minix_set_bit(nr,addr) \
#define minix_test_bit(nr,addr) test_bit(nr,addr) set_bit((nr),(unsigned long *)(addr))
#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size) #define minix_test_and_clear_bit(nr,addr) \
test_and_clear_bit((nr),(unsigned long *)(addr))
#define minix_test_bit(nr,addr) \
test_bit((nr),(unsigned long *)(addr))
#define minix_find_first_zero_bit(addr,size) \
find_first_zero_bit((unsigned long *)(addr),(size))
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -42,23 +42,26 @@ extern unsigned int csum_partial(const unsigned char * buff, int len, unsigned i ...@@ -42,23 +42,26 @@ extern unsigned int csum_partial(const unsigned char * buff, int len, unsigned i
extern unsigned int __csum_partial_copy_sparc_generic (const char *, char *); extern unsigned int __csum_partial_copy_sparc_generic (const char *, char *);
extern __inline__ unsigned int static inline unsigned int
csum_partial_copy_nocheck (const char *src, char *dst, int len, csum_partial_copy_nocheck (const char *src, char *dst, int len,
unsigned int sum) unsigned int sum)
{ {
register unsigned int ret asm("o0") = (unsigned int)src; register unsigned int ret asm("o0") = (unsigned int)src;
register char *d asm("o1") = dst; register char *d asm("o1") = dst;
register int l asm("g1") = len; register int l asm("g1") = len;
__asm__ __volatile__ ( __asm__ __volatile__ (
"call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t" "call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t"
" mov %4, %%g7\n" " mov %6, %%g7\n"
: "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (sum) : : "=&r" (ret), "=&r" (d), "=&r" (l)
"o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "g4", "g5", "g7"); : "0" (ret), "1" (d), "2" (l), "r" (sum)
: "o2", "o3", "o4", "o5", "o7",
"g2", "g3", "g4", "g5", "g7",
"memory", "cc");
return ret; return ret;
} }
extern __inline__ unsigned int static inline unsigned int
csum_partial_copy_from_user(const char *src, char *dst, int len, csum_partial_copy_from_user(const char *src, char *dst, int len,
unsigned int sum, int *err) unsigned int sum, int *err)
{ {
...@@ -79,14 +82,16 @@ csum_partial_copy_from_user(const char *src, char *dst, int len, ...@@ -79,14 +82,16 @@ csum_partial_copy_from_user(const char *src, char *dst, int len,
".previous\n" ".previous\n"
"1:\n\t" "1:\n\t"
"call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t" "call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t"
" st %5, [%%sp + 64]\n" " st %8, [%%sp + 64]\n"
: "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (s), "r" (err) : : "=&r" (ret), "=&r" (d), "=&r" (l), "=&r" (s)
"o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "g4", "g5", "g7"); : "0" (ret), "1" (d), "2" (l), "3" (s), "r" (err)
: "o2", "o3", "o4", "o5", "o7", "g2", "g3", "g4", "g5",
"cc", "memory");
return ret; return ret;
} }
} }
extern __inline__ unsigned int static inline unsigned int
csum_partial_copy_to_user(const char *src, char *dst, int len, csum_partial_copy_to_user(const char *src, char *dst, int len,
unsigned int sum, int *err) unsigned int sum, int *err)
{ {
...@@ -106,9 +111,12 @@ csum_partial_copy_to_user(const char *src, char *dst, int len, ...@@ -106,9 +111,12 @@ csum_partial_copy_to_user(const char *src, char *dst, int len,
".previous\n" ".previous\n"
"1:\n\t" "1:\n\t"
"call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t" "call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t"
" st %5, [%%sp + 64]\n" " st %8, [%%sp + 64]\n"
: "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (s), "r" (err) : : "=&r" (ret), "=&r" (d), "=&r" (l), "=&r" (s)
"o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "g4", "g5", "g7"); : "0" (ret), "1" (d), "2" (l), "3" (s), "r" (err)
: "o2", "o3", "o4", "o5", "o7",
"g2", "g3", "g4", "g5",
"cc", "memory");
return ret; return ret;
} }
} }
...@@ -119,8 +127,8 @@ csum_partial_copy_to_user(const char *src, char *dst, int len, ...@@ -119,8 +127,8 @@ csum_partial_copy_to_user(const char *src, char *dst, int len,
/* ihl is always 5 or greater, almost always is 5, and iph is word aligned /* ihl is always 5 or greater, almost always is 5, and iph is word aligned
* the majority of the time. * the majority of the time.
*/ */
extern __inline__ unsigned short ip_fast_csum(__const__ unsigned char *iph, static inline unsigned short ip_fast_csum(const unsigned char *iph,
unsigned int ihl) unsigned int ihl)
{ {
unsigned short sum; unsigned short sum;
...@@ -157,7 +165,7 @@ extern __inline__ unsigned short ip_fast_csum(__const__ unsigned char *iph, ...@@ -157,7 +165,7 @@ extern __inline__ unsigned short ip_fast_csum(__const__ unsigned char *iph,
} }
/* Fold a partial checksum without adding pseudo headers. */ /* Fold a partial checksum without adding pseudo headers. */
extern __inline__ unsigned int csum_fold(unsigned int sum) static inline unsigned int csum_fold(unsigned int sum)
{ {
unsigned int tmp; unsigned int tmp;
...@@ -171,11 +179,11 @@ extern __inline__ unsigned int csum_fold(unsigned int sum) ...@@ -171,11 +179,11 @@ extern __inline__ unsigned int csum_fold(unsigned int sum)
return sum; return sum;
} }
extern __inline__ unsigned long csum_tcpudp_nofold(unsigned long saddr, static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
unsigned long daddr, unsigned long daddr,
unsigned int len, unsigned int len,
unsigned short proto, unsigned short proto,
unsigned int sum) unsigned int sum)
{ {
__asm__ __volatile__("addcc\t%1, %0, %0\n\t" __asm__ __volatile__("addcc\t%1, %0, %0\n\t"
"addxcc\t%2, %0, %0\n\t" "addxcc\t%2, %0, %0\n\t"
...@@ -203,11 +211,11 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, ...@@ -203,11 +211,11 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
#define _HAVE_ARCH_IPV6_CSUM #define _HAVE_ARCH_IPV6_CSUM
static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, static inline unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
struct in6_addr *daddr, struct in6_addr *daddr,
__u32 len, __u32 len,
unsigned short proto, unsigned short proto,
unsigned int sum) unsigned int sum)
{ {
__asm__ __volatile__ ( __asm__ __volatile__ (
"addcc %3, %4, %%g4\n\t" "addcc %3, %4, %%g4\n\t"
...@@ -238,7 +246,7 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, ...@@ -238,7 +246,7 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
} }
/* this routine is used for miscellaneous IP-like checksums, mainly in icmp.c */ /* this routine is used for miscellaneous IP-like checksums, mainly in icmp.c */
extern __inline__ unsigned short ip_compute_csum(unsigned char * buff, int len) static inline unsigned short ip_compute_csum(unsigned char * buff, int len)
{ {
return csum_fold(csum_partial(buff, len, 0)); return csum_fold(csum_partial(buff, len, 0));
} }
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) #define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
static __inline__ u32 flip_dword (u32 d) static inline u32 flip_dword (u32 d)
{ {
return ((d&0xff)<<24) | (((d>>8)&0xff)<<16) | (((d>>16)&0xff)<<8)| ((d>>24)&0xff); return ((d&0xff)<<24) | (((d>>8)&0xff)<<16) | (((d>>16)&0xff)<<8)| ((d>>24)&0xff);
} }
static __inline__ u16 flip_word (u16 d) static inline u16 flip_word (u16 d)
{ {
return ((d&0xff) << 8) | ((d>>8)&0xff); return ((d&0xff) << 8) | ((d>>8)&0xff);
} }
...@@ -36,43 +36,73 @@ static __inline__ u16 flip_word (u16 d) ...@@ -36,43 +36,73 @@ static __inline__ u16 flip_word (u16 d)
* The offshot is, we must cast readb et. al. arguments with a #define. * The offshot is, we must cast readb et. al. arguments with a #define.
*/ */
static __inline__ u8 __raw_readb(unsigned long addr) static inline u8 __raw_readb(unsigned long addr)
{ {
return *(volatile u8 *)addr; return *(volatile u8 *)addr;
} }
static __inline__ u16 __raw_readw(unsigned long addr) static inline u16 __raw_readw(unsigned long addr)
{ {
return *(volatile u16 *)addr; return *(volatile u16 *)addr;
} }
static __inline__ u32 __raw_readl(unsigned long addr) static inline u32 __raw_readl(unsigned long addr)
{ {
return *(volatile u32 *)addr; return *(volatile u32 *)addr;
} }
static __inline__ void __raw_writeb(u8 b, unsigned long addr) static inline void __raw_writeb(u8 b, unsigned long addr)
{ {
*(volatile u8 *)addr = b; *(volatile u8 *)addr = b;
} }
static __inline__ void __raw_writew(u16 b, unsigned long addr) static inline void __raw_writew(u16 b, unsigned long addr)
{ {
*(volatile u16 *)addr = b; *(volatile u16 *)addr = b;
} }
static __inline__ void __raw_writel(u32 b, unsigned long addr) static inline void __raw_writel(u32 b, unsigned long addr)
{ {
*(volatile u32 *)addr = b; *(volatile u32 *)addr = b;
} }
#define readb(addr) (*(volatile u8 *)(addr)) static inline u8 __readb(unsigned long addr)
#define readw(addr) flip_word(*(volatile u16 *)(addr)) {
#define readl(addr) flip_dword(*(volatile u32 *)(addr)) return *(volatile u8 *)addr;
}
static inline u16 __readw(unsigned long addr)
{
return flip_word(*(volatile u16 *)addr);
}
static inline u32 __readl(unsigned long addr)
{
return flip_dword(*(volatile u32 *)addr);
}
static inline void __writeb(u8 b, unsigned long addr)
{
*(volatile u8 *)addr = b;
}
static inline void __writew(u16 b, unsigned long addr)
{
*(volatile u16 *)addr = flip_word(b);
}
static inline void __writel(u32 b, unsigned long addr)
{
*(volatile u32 *)addr = flip_dword(b);
}
#define readb(addr) __readb((unsigned long)(addr))
#define readw(addr) __readw((unsigned long)(addr))
#define readl(addr) __readl((unsigned long)(addr))
#define writeb(b, a) (*(volatile u8 *)(a) = b) #define writeb(b, addr) __writeb((b),(unsigned long)(addr))
#define writew(b, a) (*(volatile u16 *)(a) = flip_word(b)) #define writew(b, addr) __writew((b),(unsigned long)(addr))
#define writel(b, a) (*(volatile u32 *)(a) = flip_dword(b)) #define writel(b, addr) __writel((b),(unsigned long)(addr))
/* /*
* I/O space operations * I/O space operations
...@@ -91,17 +121,22 @@ static __inline__ void __raw_writel(u32 b, unsigned long addr) ...@@ -91,17 +121,22 @@ static __inline__ void __raw_writel(u32 b, unsigned long addr)
* mapped somewhere into virtual kernel space and we * mapped somewhere into virtual kernel space and we
* can use inb/outb again. * can use inb/outb again.
*/ */
#define inb_local(addr) readb(addr) #define inb_local(addr) __readb(addr)
#define inb(addr) readb(addr) #define inb(addr) __readb(addr)
#define inw(addr) readw(addr) #define inw(addr) __readw(addr)
#define inl(addr) readl(addr) #define inl(addr) __readl(addr)
#define inb_p(addr) readb(addr)
#define outb_local(b, addr) __writeb(b, addr)
#define outb_local(b, addr) writeb(b, addr) #define outb(b, addr) __writeb(b, addr)
#define outb(b, addr) writeb(b, addr) #define outw(b, addr) __writew(b, addr)
#define outw(b, addr) writew(b, addr) #define outl(b, addr) __writel(b, addr)
#define outl(b, addr) writel(b, addr)
#define outb_p(b, addr) writeb(b, addr) #define inb_p inb
#define outb_p outb
#define inw_p inw
#define outw_p outw
#define inl_p inl
#define outl_p outl
extern void outsb(unsigned long addr, const void *src, unsigned long cnt); extern void outsb(unsigned long addr, const void *src, unsigned long cnt);
extern void outsw(unsigned long addr, const void *src, unsigned long cnt); extern void outsw(unsigned long addr, const void *src, unsigned long cnt);
...@@ -118,32 +153,32 @@ extern void insl(unsigned long addr, void *dst, unsigned long count); ...@@ -118,32 +153,32 @@ extern void insl(unsigned long addr, void *dst, unsigned long count);
* SBus has only one, memory mapped, I/O space. * SBus has only one, memory mapped, I/O space.
* We do not need to flip bytes for SBus of course. * We do not need to flip bytes for SBus of course.
*/ */
static __inline__ u8 _sbus_readb(unsigned long addr) static inline u8 _sbus_readb(unsigned long addr)
{ {
return *(volatile u8 *)addr; return *(volatile u8 *)addr;
} }
static __inline__ u16 _sbus_readw(unsigned long addr) static inline u16 _sbus_readw(unsigned long addr)
{ {
return *(volatile u16 *)addr; return *(volatile u16 *)addr;
} }
static __inline__ u32 _sbus_readl(unsigned long addr) static inline u32 _sbus_readl(unsigned long addr)
{ {
return *(volatile u32 *)addr; return *(volatile u32 *)addr;
} }
static __inline__ void _sbus_writeb(u8 b, unsigned long addr) static inline void _sbus_writeb(u8 b, unsigned long addr)
{ {
*(volatile u8 *)addr = b; *(volatile u8 *)addr = b;
} }
static __inline__ void _sbus_writew(u16 b, unsigned long addr) static inline void _sbus_writew(u16 b, unsigned long addr)
{ {
*(volatile u16 *)addr = b; *(volatile u16 *)addr = b;
} }
static __inline__ void _sbus_writel(u32 b, unsigned long addr) static inline void _sbus_writel(u32 b, unsigned long addr)
{ {
*(volatile u32 *)addr = b; *(volatile u32 *)addr = b;
} }
......
...@@ -39,14 +39,45 @@ BTFIXUPDEF_CALL(void, clear_clock_irq, void) ...@@ -39,14 +39,45 @@ BTFIXUPDEF_CALL(void, clear_clock_irq, void)
BTFIXUPDEF_CALL(void, clear_profile_irq, int) BTFIXUPDEF_CALL(void, clear_profile_irq, int)
BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int) BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int)
#define disable_irq_nosync disable_irq static inline void disable_irq_nosync(unsigned int irq)
#define disable_irq(irq) BTFIXUP_CALL(disable_irq)(irq) {
#define enable_irq(irq) BTFIXUP_CALL(enable_irq)(irq) BTFIXUP_CALL(disable_irq)(irq);
#define disable_pil_irq(irq) BTFIXUP_CALL(disable_pil_irq)(irq) }
#define enable_pil_irq(irq) BTFIXUP_CALL(enable_pil_irq)(irq)
#define clear_clock_irq() BTFIXUP_CALL(clear_clock_irq)() static inline void disable_irq(unsigned int irq)
#define clear_profile_irq(cpu) BTFIXUP_CALL(clear_profile_irq)(cpu) {
#define load_profile_irq(cpu,limit) BTFIXUP_CALL(load_profile_irq)(cpu,limit) BTFIXUP_CALL(disable_irq)(irq);
}
static inline void enable_irq(unsigned int irq)
{
BTFIXUP_CALL(enable_irq)(irq);
}
static inline void disable_pil_irq(unsigned int irq)
{
BTFIXUP_CALL(disable_pil_irq)(irq);
}
static inline void enable_pil_irq(unsigned int irq)
{
BTFIXUP_CALL(enable_pil_irq)(irq);
}
static inline void clear_clock_irq(void)
{
BTFIXUP_CALL(clear_clock_irq)();
}
static inline void clear_profile_irq(int irq)
{
BTFIXUP_CALL(clear_profile_irq)(irq);
}
static inline void load_profile_irq(int cpu, int limit)
{
BTFIXUP_CALL(load_profile_irq)(cpu, limit);
}
extern void (*sparc_init_timers)(irqreturn_t (*lvl10_irq)(int, void *, struct pt_regs *)); extern void (*sparc_init_timers)(irqreturn_t (*lvl10_irq)(int, void *, struct pt_regs *));
extern void claim_ticker14(irqreturn_t (*irq_handler)(int, void *, struct pt_regs *), extern void claim_ticker14(irqreturn_t (*irq_handler)(int, void *, struct pt_regs *),
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern __inline__ unsigned long sun4c_get_synchronous_error(void) static inline unsigned long sun4c_get_synchronous_error(void)
{ {
unsigned long sync_err; unsigned long sync_err;
...@@ -86,7 +86,7 @@ extern __inline__ unsigned long sun4c_get_synchronous_error(void) ...@@ -86,7 +86,7 @@ extern __inline__ unsigned long sun4c_get_synchronous_error(void)
return sync_err; return sync_err;
} }
extern __inline__ unsigned long sun4c_get_synchronous_address(void) static inline unsigned long sun4c_get_synchronous_address(void)
{ {
unsigned long sync_addr; unsigned long sync_addr;
...@@ -97,7 +97,7 @@ extern __inline__ unsigned long sun4c_get_synchronous_address(void) ...@@ -97,7 +97,7 @@ extern __inline__ unsigned long sun4c_get_synchronous_address(void)
} }
/* SUN4 pte, segmap, and context manipulation */ /* SUN4 pte, segmap, and context manipulation */
extern __inline__ unsigned long sun4c_get_segmap(unsigned long addr) static inline unsigned long sun4c_get_segmap(unsigned long addr)
{ {
register unsigned long entry; register unsigned long entry;
...@@ -107,14 +107,15 @@ extern __inline__ unsigned long sun4c_get_segmap(unsigned long addr) ...@@ -107,14 +107,15 @@ extern __inline__ unsigned long sun4c_get_segmap(unsigned long addr)
return entry; return entry;
} }
extern __inline__ void sun4c_put_segmap(unsigned long addr, unsigned long entry) static inline void sun4c_put_segmap(unsigned long addr, unsigned long entry)
{ {
__asm__ __volatile__("\n\tstha %1, [%0] %2; nop; nop; nop;\n\t" : : __asm__ __volatile__("\n\tstha %1, [%0] %2; nop; nop; nop;\n\t" : :
"r" (addr), "r" (entry), "r" (addr), "r" (entry),
"i" (ASI_SEGMAP)); "i" (ASI_SEGMAP)
: "memory");
} }
extern __inline__ unsigned long sun4c_get_pte(unsigned long addr) static inline unsigned long sun4c_get_pte(unsigned long addr)
{ {
register unsigned long entry; register unsigned long entry;
...@@ -124,14 +125,15 @@ extern __inline__ unsigned long sun4c_get_pte(unsigned long addr) ...@@ -124,14 +125,15 @@ extern __inline__ unsigned long sun4c_get_pte(unsigned long addr)
return entry; return entry;
} }
extern __inline__ void sun4c_put_pte(unsigned long addr, unsigned long entry) static inline void sun4c_put_pte(unsigned long addr, unsigned long entry)
{ {
__asm__ __volatile__("\n\tsta %1, [%0] %2; nop; nop; nop;\n\t" : : __asm__ __volatile__("\n\tsta %1, [%0] %2; nop; nop; nop;\n\t" : :
"r" (addr), "r" (addr),
"r" ((entry & ~(_SUN4C_PAGE_PRESENT))), "i" (ASI_PTE)); "r" ((entry & ~(_SUN4C_PAGE_PRESENT))), "i" (ASI_PTE)
: "memory");
} }
extern __inline__ int sun4c_get_context(void) static inline int sun4c_get_context(void)
{ {
register int ctx; register int ctx;
...@@ -142,10 +144,11 @@ extern __inline__ int sun4c_get_context(void) ...@@ -142,10 +144,11 @@ extern __inline__ int sun4c_get_context(void)
return ctx; return ctx;
} }
extern __inline__ int sun4c_set_context(int ctx) static inline int sun4c_set_context(int ctx)
{ {
__asm__ __volatile__("\n\tstba %0, [%1] %2; nop; nop; nop;\n\t" : : __asm__ __volatile__("\n\tstba %0, [%1] %2; nop; nop; nop;\n\t" : :
"r" (ctx), "r" (AC_CONTEXT), "i" (ASI_CONTROL)); "r" (ctx), "r" (AC_CONTEXT), "i" (ASI_CONTROL)
: "memory");
return ctx; return ctx;
} }
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern __inline__ unsigned long sun4c_get_synchronous_error(void) static inline unsigned long sun4c_get_synchronous_error(void)
{ {
unsigned long sync_err; unsigned long sync_err;
...@@ -86,7 +86,7 @@ extern __inline__ unsigned long sun4c_get_synchronous_error(void) ...@@ -86,7 +86,7 @@ extern __inline__ unsigned long sun4c_get_synchronous_error(void)
return sync_err; return sync_err;
} }
extern __inline__ unsigned long sun4c_get_synchronous_address(void) static inline unsigned long sun4c_get_synchronous_address(void)
{ {
unsigned long sync_addr; unsigned long sync_addr;
...@@ -97,7 +97,7 @@ extern __inline__ unsigned long sun4c_get_synchronous_address(void) ...@@ -97,7 +97,7 @@ extern __inline__ unsigned long sun4c_get_synchronous_address(void)
} }
/* SUN4C pte, segmap, and context manipulation */ /* SUN4C pte, segmap, and context manipulation */
extern __inline__ unsigned long sun4c_get_segmap(unsigned long addr) static inline unsigned long sun4c_get_segmap(unsigned long addr)
{ {
register unsigned long entry; register unsigned long entry;
...@@ -108,15 +108,16 @@ extern __inline__ unsigned long sun4c_get_segmap(unsigned long addr) ...@@ -108,15 +108,16 @@ extern __inline__ unsigned long sun4c_get_segmap(unsigned long addr)
return entry; return entry;
} }
extern __inline__ void sun4c_put_segmap(unsigned long addr, unsigned long entry) static inline void sun4c_put_segmap(unsigned long addr, unsigned long entry)
{ {
__asm__ __volatile__("\n\tstba %1, [%0] %2; nop; nop; nop;\n\t" : : __asm__ __volatile__("\n\tstba %1, [%0] %2; nop; nop; nop;\n\t" : :
"r" (addr), "r" (entry), "r" (addr), "r" (entry),
"i" (ASI_SEGMAP)); "i" (ASI_SEGMAP)
: "memory");
} }
extern __inline__ unsigned long sun4c_get_pte(unsigned long addr) static inline unsigned long sun4c_get_pte(unsigned long addr)
{ {
register unsigned long entry; register unsigned long entry;
...@@ -126,14 +127,15 @@ extern __inline__ unsigned long sun4c_get_pte(unsigned long addr) ...@@ -126,14 +127,15 @@ extern __inline__ unsigned long sun4c_get_pte(unsigned long addr)
return entry; return entry;
} }
extern __inline__ void sun4c_put_pte(unsigned long addr, unsigned long entry) static inline void sun4c_put_pte(unsigned long addr, unsigned long entry)
{ {
__asm__ __volatile__("\n\tsta %1, [%0] %2; nop; nop; nop;\n\t" : : __asm__ __volatile__("\n\tsta %1, [%0] %2; nop; nop; nop;\n\t" : :
"r" (addr), "r" (addr),
"r" ((entry & ~(_SUN4C_PAGE_PRESENT))), "i" (ASI_PTE)); "r" ((entry & ~(_SUN4C_PAGE_PRESENT))), "i" (ASI_PTE)
: "memory");
} }
extern __inline__ int sun4c_get_context(void) static inline int sun4c_get_context(void)
{ {
register int ctx; register int ctx;
...@@ -144,10 +146,11 @@ extern __inline__ int sun4c_get_context(void) ...@@ -144,10 +146,11 @@ extern __inline__ int sun4c_get_context(void)
return ctx; return ctx;
} }
extern __inline__ int sun4c_set_context(int ctx) static inline int sun4c_set_context(int ctx)
{ {
__asm__ __volatile__("\n\tstba %0, [%1] %2; nop; nop; nop;\n\t" : : __asm__ __volatile__("\n\tstba %0, [%1] %2; nop; nop; nop;\n\t" : :
"r" (ctx), "r" (AC_CONTEXT), "i" (ASI_CONTROL)); "r" (ctx), "r" (AC_CONTEXT), "i" (ASI_CONTROL)
: "memory");
return ctx; return ctx;
} }
......
...@@ -130,8 +130,12 @@ extern __inline__ void start_thread(struct pt_regs * regs, unsigned long pc, ...@@ -130,8 +130,12 @@ extern __inline__ void start_thread(struct pt_regs * regs, unsigned long pc,
"std\t%%g0, [%0 + %3 + 0x30]\n\t" "std\t%%g0, [%0 + %3 + 0x30]\n\t"
"st\t%1, [%0 + %3 + 0x38]\n\t" "st\t%1, [%0 + %3 + 0x38]\n\t"
"st\t%%g0, [%0 + %3 + 0x3c]" "st\t%%g0, [%0 + %3 + 0x3c]"
: : "r" (regs), "r" (sp - sizeof(struct reg_window)), "r" (zero), : /* no outputs */
"i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))); : "r" (regs),
"r" (sp - sizeof(struct reg_window)),
"r" (zero),
"i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))
: "memory");
} }
/* Free all resources held by a thread. */ /* Free all resources held by a thread. */
......
...@@ -96,27 +96,29 @@ ...@@ -96,27 +96,29 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern __inline__ unsigned int get_ross_icr(void) static inline unsigned int get_ross_icr(void)
{ {
unsigned int icreg; unsigned int icreg;
__asm__ __volatile__(".word 0x8347c000\n\t" /* rd %iccr, %g1 */ __asm__ __volatile__(".word 0x8347c000\n\t" /* rd %iccr, %g1 */
"mov %%g1, %0\n\t" : "mov %%g1, %0\n\t"
"=r" (icreg) : : : "=r" (icreg)
"g1", "memory"); : /* no inputs */
: "g1", "memory");
return icreg; return icreg;
} }
extern __inline__ void put_ross_icr(unsigned int icreg) static inline void put_ross_icr(unsigned int icreg)
{ {
__asm__ __volatile__("or %%g0, %0, %%g1\n\t" __asm__ __volatile__("or %%g0, %0, %%g1\n\t"
".word 0xbf806000\n\t" /* wr %g1, 0x0, %iccr */ ".word 0xbf806000\n\t" /* wr %g1, 0x0, %iccr */
"nop\n\t" "nop\n\t"
"nop\n\t" "nop\n\t"
"nop\n\t" : : "nop\n\t"
"r" (icreg) : : /* no outputs */
"g1", "memory"); : "r" (icreg)
: "g1", "memory");
return; return;
} }
...@@ -124,52 +126,62 @@ extern __inline__ void put_ross_icr(unsigned int icreg) ...@@ -124,52 +126,62 @@ extern __inline__ void put_ross_icr(unsigned int icreg)
/* HyperSparc specific cache flushing. */ /* HyperSparc specific cache flushing. */
/* This is for the on-chip instruction cache. */ /* This is for the on-chip instruction cache. */
extern __inline__ void hyper_flush_whole_icache(void) static inline void hyper_flush_whole_icache(void)
{ {
__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : : __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"
"i" (ASI_M_FLUSH_IWHOLE)); : /* no outputs */
: "i" (ASI_M_FLUSH_IWHOLE)
: "memory");
return; return;
} }
extern int vac_cache_size; extern int vac_cache_size;
extern int vac_line_size; extern int vac_line_size;
extern __inline__ void hyper_clear_all_tags(void) static inline void hyper_clear_all_tags(void)
{ {
unsigned long addr; unsigned long addr;
for(addr = 0; addr < vac_cache_size; addr += vac_line_size) for(addr = 0; addr < vac_cache_size; addr += vac_line_size)
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
"r" (addr), "i" (ASI_M_DATAC_TAG)); : /* no outputs */
: "r" (addr), "i" (ASI_M_DATAC_TAG)
: "memory");
} }
extern __inline__ void hyper_flush_unconditional_combined(void) static inline void hyper_flush_unconditional_combined(void)
{ {
unsigned long addr; unsigned long addr;
for(addr = 0; addr < vac_cache_size; addr += vac_line_size) for (addr = 0; addr < vac_cache_size; addr += vac_line_size)
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
"r" (addr), "i" (ASI_M_FLUSH_CTX)); : /* no outputs */
: "r" (addr), "i" (ASI_M_FLUSH_CTX)
: "memory");
} }
extern __inline__ void hyper_flush_cache_user(void) static inline void hyper_flush_cache_user(void)
{ {
unsigned long addr; unsigned long addr;
for(addr = 0; addr < vac_cache_size; addr += vac_line_size) for (addr = 0; addr < vac_cache_size; addr += vac_line_size)
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
"r" (addr), "i" (ASI_M_FLUSH_USER)); : /* no outputs */
: "r" (addr), "i" (ASI_M_FLUSH_USER)
: "memory");
} }
extern __inline__ void hyper_flush_cache_page(unsigned long page) static inline void hyper_flush_cache_page(unsigned long page)
{ {
unsigned long end; unsigned long end;
page &= PAGE_MASK; page &= PAGE_MASK;
end = page + PAGE_SIZE; end = page + PAGE_SIZE;
while(page < end) { while (page < end) {
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
"r" (page), "i" (ASI_M_FLUSH_PAGE)); : /* no outputs */
: "r" (page), "i" (ASI_M_FLUSH_PAGE)
: "memory");
page += vac_line_size; page += vac_line_size;
} }
} }
......
...@@ -27,68 +27,80 @@ ...@@ -27,68 +27,80 @@
#define SWIFT_EN 0x00000001 /* MMU enable */ #define SWIFT_EN 0x00000001 /* MMU enable */
/* Bits [13:5] select one of 512 instruction cache tags */ /* Bits [13:5] select one of 512 instruction cache tags */
extern __inline__ void swift_inv_insn_tag(unsigned long addr) static inline void swift_inv_insn_tag(unsigned long addr)
{ {
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
"r" (addr), "i" (ASI_M_TXTC_TAG)); : /* no outputs */
: "r" (addr), "i" (ASI_M_TXTC_TAG)
: "memory");
} }
/* Bits [12:4] select one of 512 data cache tags */ /* Bits [12:4] select one of 512 data cache tags */
extern __inline__ void swift_inv_data_tag(unsigned long addr) static inline void swift_inv_data_tag(unsigned long addr)
{ {
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
"r" (addr), "i" (ASI_M_DATAC_TAG)); : /* no outputs */
: "r" (addr), "i" (ASI_M_DATAC_TAG)
: "memory");
} }
extern __inline__ void swift_flush_dcache(void) static inline void swift_flush_dcache(void)
{ {
unsigned long addr; unsigned long addr;
for(addr = 0; addr < 0x2000; addr += 0x10) for (addr = 0; addr < 0x2000; addr += 0x10)
swift_inv_data_tag(addr); swift_inv_data_tag(addr);
} }
extern __inline__ void swift_flush_icache(void) static inline void swift_flush_icache(void)
{ {
unsigned long addr; unsigned long addr;
for(addr = 0; addr < 0x4000; addr += 0x20) for (addr = 0; addr < 0x4000; addr += 0x20)
swift_inv_insn_tag(addr); swift_inv_insn_tag(addr);
} }
extern __inline__ void swift_idflash_clear(void) static inline void swift_idflash_clear(void)
{ {
unsigned long addr; unsigned long addr;
for(addr = 0; addr < 0x2000; addr += 0x10) { for (addr = 0; addr < 0x2000; addr += 0x10) {
swift_inv_insn_tag(addr<<1); swift_inv_insn_tag(addr<<1);
swift_inv_data_tag(addr); swift_inv_data_tag(addr);
} }
} }
/* Swift is so broken, it isn't even safe to use the following. */ /* Swift is so broken, it isn't even safe to use the following. */
extern __inline__ void swift_flush_page(unsigned long page) static inline void swift_flush_page(unsigned long page)
{ {
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
"r" (page), "i" (ASI_M_FLUSH_PAGE)); : /* no outputs */
: "r" (page), "i" (ASI_M_FLUSH_PAGE)
: "memory");
} }
extern __inline__ void swift_flush_segment(unsigned long addr) static inline void swift_flush_segment(unsigned long addr)
{ {
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
"r" (addr), "i" (ASI_M_FLUSH_SEG)); : /* no outputs */
: "r" (addr), "i" (ASI_M_FLUSH_SEG)
: "memory");
} }
extern __inline__ void swift_flush_region(unsigned long addr) static inline void swift_flush_region(unsigned long addr)
{ {
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
"r" (addr), "i" (ASI_M_FLUSH_REGION)); : /* no outputs */
: "r" (addr), "i" (ASI_M_FLUSH_REGION)
: "memory");
} }
extern __inline__ void swift_flush_context(void) static inline void swift_flush_context(void)
{ {
__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : : __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"
"i" (ASI_M_FLUSH_CTX)); : /* no outputs */
: "i" (ASI_M_FLUSH_CTX)
: "memory");
} }
#endif /* !(_SPARC_SWIFT_H) */ #endif /* !(_SPARC_SWIFT_H) */
...@@ -220,7 +220,7 @@ extern __inline__ unsigned long swap_pil(unsigned long __new_psr) ...@@ -220,7 +220,7 @@ extern __inline__ unsigned long swap_pil(unsigned long __new_psr)
"wr %0, %2, %%psr\n\t" "wr %0, %2, %%psr\n\t"
"nop; nop; nop;\n" "nop; nop; nop;\n"
"1:\n" "1:\n"
: "=r" (retval) : "=&r" (retval)
: "r" (__new_psr), "i" (PSR_PIL) : "r" (__new_psr), "i" (PSR_PIL)
: "g1", "g2", "memory", "cc"); : "g1", "g2", "memory", "cc");
...@@ -298,7 +298,8 @@ extern __inline__ unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned ...@@ -298,7 +298,8 @@ extern __inline__ unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
__asm__ __volatile__("swap [%2], %0" __asm__ __volatile__("swap [%2], %0"
: "=&r" (val) : "=&r" (val)
: "0" (val), "r" (m)); : "0" (val), "r" (m)
: "memory");
return val; return val;
#else #else
register unsigned long *ptr asm("g1"); register unsigned long *ptr asm("g1");
......
...@@ -45,16 +45,20 @@ ...@@ -45,16 +45,20 @@
#define TSUNAMI_NF 0x00000002 #define TSUNAMI_NF 0x00000002
#define TSUNAMI_ME 0x00000001 #define TSUNAMI_ME 0x00000001
extern __inline__ void tsunami_flush_icache(void) static inline void tsunami_flush_icache(void)
{ {
__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : : __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"
"i" (ASI_M_IC_FLCLEAR) : "memory"); : /* no outputs */
: "i" (ASI_M_IC_FLCLEAR)
: "memory");
} }
extern __inline__ void tsunami_flush_dcache(void) static inline void tsunami_flush_dcache(void)
{ {
__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : : __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"
"i" (ASI_M_DC_FLCLEAR) : "memory"); : /* no outputs */
: "i" (ASI_M_DC_FLCLEAR)
: "memory");
} }
#endif /* !(_SPARC_TSUNAMI_H) */ #endif /* !(_SPARC_TSUNAMI_H) */
...@@ -59,60 +59,64 @@ ...@@ -59,60 +59,64 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
/* Bits [13:5] select one of 512 instruction cache tags */ /* Bits [13:5] select one of 512 instruction cache tags */
extern __inline__ void turbosparc_inv_insn_tag(unsigned long addr) static inline void turbosparc_inv_insn_tag(unsigned long addr)
{ {
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
"r" (addr), "i" (ASI_M_TXTC_TAG)); : /* no outputs */
: "r" (addr), "i" (ASI_M_TXTC_TAG)
: "memory");
} }
/* Bits [13:5] select one of 512 data cache tags */ /* Bits [13:5] select one of 512 data cache tags */
extern __inline__ void turbosparc_inv_data_tag(unsigned long addr) static inline void turbosparc_inv_data_tag(unsigned long addr)
{ {
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
"r" (addr), "i" (ASI_M_DATAC_TAG)); : /* no outputs */
: "r" (addr), "i" (ASI_M_DATAC_TAG)
: "memory");
} }
extern __inline__ void turbosparc_flush_icache(void) static inline void turbosparc_flush_icache(void)
{ {
unsigned long addr; unsigned long addr;
for(addr = 0; addr < 0x4000; addr += 0x20) for (addr = 0; addr < 0x4000; addr += 0x20)
turbosparc_inv_insn_tag(addr); turbosparc_inv_insn_tag(addr);
} }
extern __inline__ void turbosparc_flush_dcache(void) static inline void turbosparc_flush_dcache(void)
{ {
unsigned long addr; unsigned long addr;
for(addr = 0; addr < 0x4000; addr += 0x20) for (addr = 0; addr < 0x4000; addr += 0x20)
turbosparc_inv_data_tag(addr); turbosparc_inv_data_tag(addr);
} }
extern __inline__ void turbosparc_idflash_clear(void) static inline void turbosparc_idflash_clear(void)
{ {
unsigned long addr; unsigned long addr;
for(addr = 0; addr < 0x4000; addr += 0x20) { for (addr = 0; addr < 0x4000; addr += 0x20) {
turbosparc_inv_insn_tag(addr); turbosparc_inv_insn_tag(addr);
turbosparc_inv_data_tag(addr); turbosparc_inv_data_tag(addr);
} }
} }
extern __inline__ void turbosparc_set_ccreg(unsigned long regval) static inline void turbosparc_set_ccreg(unsigned long regval)
{ {
__asm__ __volatile__("sta %0, [%1] %2\n\t" : : __asm__ __volatile__("sta %0, [%1] %2\n\t"
"r" (regval), "r" (0x600), : /* no outputs */
"i" (ASI_M_MMUREGS)); : "r" (regval), "r" (0x600), "i" (ASI_M_MMUREGS)
: "memory");
} }
extern __inline__ unsigned long turbosparc_get_ccreg(void) static inline unsigned long turbosparc_get_ccreg(void)
{ {
unsigned long regval; unsigned long regval;
__asm__ __volatile__("lda [%1] %2, %0\n\t" : __asm__ __volatile__("lda [%1] %2, %0\n\t"
"=r" (regval) : : "=r" (regval)
"r" (0x600), : "r" (0x600), "i" (ASI_M_MMUREGS));
"i" (ASI_M_MMUREGS));
return regval; return regval;
} }
......
...@@ -108,27 +108,29 @@ struct sun4c_vac_props { ...@@ -108,27 +108,29 @@ struct sun4c_vac_props {
extern struct sun4c_vac_props sun4c_vacinfo; extern struct sun4c_vac_props sun4c_vacinfo;
/* sun4c_enable_vac() enables the sun4c virtual address cache. */ /* sun4c_enable_vac() enables the sun4c virtual address cache. */
extern __inline__ void sun4c_enable_vac(void) static inline void sun4c_enable_vac(void)
{ {
__asm__ __volatile__("lduba [%0] %1, %%g1\n\t" __asm__ __volatile__("lduba [%0] %1, %%g1\n\t"
"or %%g1, %2, %%g1\n\t" "or %%g1, %2, %%g1\n\t"
"stba %%g1, [%0] %1\n\t" : : "stba %%g1, [%0] %1\n\t"
"r" ((unsigned int) AC_SENABLE), : /* no outputs */
"i" (ASI_CONTROL), "i" (SENABLE_CACHE) : : "r" ((unsigned int) AC_SENABLE),
"g1"); "i" (ASI_CONTROL), "i" (SENABLE_CACHE)
sun4c_vacinfo.on = 1; : "g1", "memory");
sun4c_vacinfo.on = 1;
} }
/* sun4c_disable_vac() disables the virtual address cache. */ /* sun4c_disable_vac() disables the virtual address cache. */
extern __inline__ void sun4c_disable_vac(void) static inline void sun4c_disable_vac(void)
{ {
__asm__ __volatile__("lduba [%0] %1, %%g1\n\t" __asm__ __volatile__("lduba [%0] %1, %%g1\n\t"
"andn %%g1, %2, %%g1\n\t" "andn %%g1, %2, %%g1\n\t"
"stba %%g1, [%0] %1\n\t" : : "stba %%g1, [%0] %1\n\t"
"r" ((unsigned int) AC_SENABLE), : /* no outputs */
"i" (ASI_CONTROL), "i" (SENABLE_CACHE) : : "r" ((unsigned int) AC_SENABLE),
"g1"); "i" (ASI_CONTROL), "i" (SENABLE_CACHE)
sun4c_vacinfo.on = 0; : "g1", "memory");
sun4c_vacinfo.on = 0;
} }
#endif /* !(_SPARC_VAC_OPS_H) */ #endif /* !(_SPARC_VAC_OPS_H) */
...@@ -110,48 +110,57 @@ ...@@ -110,48 +110,57 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern __inline__ void viking_flush_icache(void) static inline void viking_flush_icache(void)
{ {
__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : : __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"
"i" (ASI_M_IC_FLCLEAR)); : /* no outputs */
: "i" (ASI_M_IC_FLCLEAR)
: "memory");
} }
extern __inline__ void viking_flush_dcache(void) static inline void viking_flush_dcache(void)
{ {
__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : : __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"
"i" (ASI_M_DC_FLCLEAR)); : /* no outputs */
: "i" (ASI_M_DC_FLCLEAR)
: "memory");
} }
extern __inline__ void viking_unlock_icache(void) static inline void viking_unlock_icache(void)
{ {
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
"r" (0x80000000), "i" (ASI_M_IC_FLCLEAR)); : /* no outputs */
: "r" (0x80000000), "i" (ASI_M_IC_FLCLEAR)
: "memory");
} }
extern __inline__ void viking_unlock_dcache(void) static inline void viking_unlock_dcache(void)
{ {
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
"r" (0x80000000), "i" (ASI_M_DC_FLCLEAR)); : /* no outputs */
: "r" (0x80000000), "i" (ASI_M_DC_FLCLEAR)
: "memory");
} }
extern __inline__ void viking_set_bpreg(unsigned long regval) static inline void viking_set_bpreg(unsigned long regval)
{ {
__asm__ __volatile__("sta %0, [%%g0] %1\n\t" : : __asm__ __volatile__("sta %0, [%%g0] %1\n\t"
"r" (regval), : /* no outputs */
"i" (ASI_M_ACTION)); : "r" (regval), "i" (ASI_M_ACTION)
: "memory");
} }
extern __inline__ unsigned long viking_get_bpreg(void) static inline unsigned long viking_get_bpreg(void)
{ {
unsigned long regval; unsigned long regval;
__asm__ __volatile__("lda [%%g0] %1, %0\n\t" : __asm__ __volatile__("lda [%%g0] %1, %0\n\t"
"=r" (regval) : : "=r" (regval)
"i" (ASI_M_ACTION)); : "i" (ASI_M_ACTION));
return regval; return regval;
} }
extern __inline__ void viking_get_dcache_ptag(int set, int block, static inline void viking_get_dcache_ptag(int set, int block,
unsigned long *data) unsigned long *data)
{ {
unsigned long ptag = ((set & 0x7f) << 5) | ((block & 0x3) << 26) | unsigned long ptag = ((set & 0x7f) << 5) | ((block & 0x3) << 26) |
...@@ -160,15 +169,15 @@ extern __inline__ void viking_get_dcache_ptag(int set, int block, ...@@ -160,15 +169,15 @@ extern __inline__ void viking_get_dcache_ptag(int set, int block,
__asm__ __volatile__ ("ldda [%2] %3, %%g2\n\t" __asm__ __volatile__ ("ldda [%2] %3, %%g2\n\t"
"or %%g0, %%g2, %0\n\t" "or %%g0, %%g2, %0\n\t"
"or %%g0, %%g3, %1\n\t" : "or %%g0, %%g3, %1\n\t"
"=r" (info), "=r" (page) : : "=r" (info), "=r" (page)
"r" (ptag), "i" (ASI_M_DATAC_TAG) : : "r" (ptag), "i" (ASI_M_DATAC_TAG)
"g2", "g3"); : "g2", "g3");
data[0] = info; data[0] = info;
data[1] = page; data[1] = page;
} }
extern __inline__ void viking_mxcc_turn_off_parity(unsigned long *mregp, static inline void viking_mxcc_turn_off_parity(unsigned long *mregp,
unsigned long *mxcc_cregp) unsigned long *mxcc_cregp)
{ {
unsigned long mreg = *mregp; unsigned long mreg = *mregp;
...@@ -190,30 +199,32 @@ extern __inline__ void viking_mxcc_turn_off_parity(unsigned long *mregp, ...@@ -190,30 +199,32 @@ extern __inline__ void viking_mxcc_turn_off_parity(unsigned long *mregp,
"2:\n\t" "2:\n\t"
"sta %0, [%%g0] %3\n\t" "sta %0, [%%g0] %3\n\t"
"sta %1, [%2] %4\n" "sta %1, [%2] %4\n"
"1:\n\t" : : "1:\n\t"
"r" (mreg), "r" (mxcc_creg), : /* no output */
"r" (MXCC_CREG), "i" (ASI_M_MMUREGS), : "r" (mreg), "r" (mxcc_creg),
"i" (ASI_M_MXCC) : "g2", "cc"); "r" (MXCC_CREG), "i" (ASI_M_MMUREGS),
"i" (ASI_M_MXCC)
: "g2", "memory", "cc");
*mregp = mreg; *mregp = mreg;
*mxcc_cregp = mxcc_creg; *mxcc_cregp = mxcc_creg;
} }
extern __inline__ unsigned long viking_hwprobe(unsigned long vaddr) static inline unsigned long viking_hwprobe(unsigned long vaddr)
{ {
unsigned long val; unsigned long val;
vaddr &= PAGE_MASK; vaddr &= PAGE_MASK;
/* Probe all MMU entries. */ /* Probe all MMU entries. */
__asm__ __volatile__("lda [%1] %2, %0\n\t" : __asm__ __volatile__("lda [%1] %2, %0\n\t"
"=r" (val) : : "=r" (val)
"r" (vaddr | 0x400), "i" (ASI_M_FLUSH_PROBE)); : "r" (vaddr | 0x400), "i" (ASI_M_FLUSH_PROBE));
if (!val) if (!val)
return 0; return 0;
/* Probe region. */ /* Probe region. */
__asm__ __volatile__("lda [%1] %2, %0\n\t" : __asm__ __volatile__("lda [%1] %2, %0\n\t"
"=r" (val) : : "=r" (val)
"r" (vaddr | 0x200), "i" (ASI_M_FLUSH_PROBE)); : "r" (vaddr | 0x200), "i" (ASI_M_FLUSH_PROBE));
if ((val & SRMMU_ET_MASK) == SRMMU_ET_PTE) { if ((val & SRMMU_ET_MASK) == SRMMU_ET_PTE) {
vaddr &= ~SRMMU_PGDIR_MASK; vaddr &= ~SRMMU_PGDIR_MASK;
vaddr >>= PAGE_SHIFT; vaddr >>= PAGE_SHIFT;
...@@ -221,9 +232,9 @@ extern __inline__ unsigned long viking_hwprobe(unsigned long vaddr) ...@@ -221,9 +232,9 @@ extern __inline__ unsigned long viking_hwprobe(unsigned long vaddr)
} }
/* Probe segment. */ /* Probe segment. */
__asm__ __volatile__("lda [%1] %2, %0\n\t" : __asm__ __volatile__("lda [%1] %2, %0\n\t"
"=r" (val) : : "=r" (val)
"r" (vaddr | 0x100), "i" (ASI_M_FLUSH_PROBE)); : "r" (vaddr | 0x100), "i" (ASI_M_FLUSH_PROBE));
if ((val & SRMMU_ET_MASK) == SRMMU_ET_PTE) { if ((val & SRMMU_ET_MASK) == SRMMU_ET_PTE) {
vaddr &= ~SRMMU_PMD_MASK; vaddr &= ~SRMMU_PMD_MASK;
vaddr >>= PAGE_SHIFT; vaddr >>= PAGE_SHIFT;
...@@ -231,9 +242,9 @@ extern __inline__ unsigned long viking_hwprobe(unsigned long vaddr) ...@@ -231,9 +242,9 @@ extern __inline__ unsigned long viking_hwprobe(unsigned long vaddr)
} }
/* Probe page. */ /* Probe page. */
__asm__ __volatile__("lda [%1] %2, %0\n\t" : __asm__ __volatile__("lda [%1] %2, %0\n\t"
"=r" (val) : : "=r" (val)
"r" (vaddr), "i" (ASI_M_FLUSH_PROBE)); : "r" (vaddr), "i" (ASI_M_FLUSH_PROBE));
return val; return val;
} }
......
...@@ -511,7 +511,11 @@ extern struct net_device *__dev_get_by_flags(unsigned short flags, ...@@ -511,7 +511,11 @@ extern struct net_device *__dev_get_by_flags(unsigned short flags,
unsigned short mask); unsigned short mask);
extern struct net_device *dev_get_by_name(const char *name); extern struct net_device *dev_get_by_name(const char *name);
extern struct net_device *__dev_get_by_name(const char *name); extern struct net_device *__dev_get_by_name(const char *name);
extern struct net_device *dev_alloc(const char *name, int *err); extern struct net_device *__dev_alloc(const char *name, int *err);
static inline __deprecated struct net_device *dev_alloc(const char *name, int *err)
{
return __dev_alloc(name, err);
}
extern int dev_alloc_name(struct net_device *dev, const char *name); extern int dev_alloc_name(struct net_device *dev, const char *name);
extern int dev_open(struct net_device *dev); extern int dev_open(struct net_device *dev);
extern int dev_close(struct net_device *dev); extern int dev_close(struct net_device *dev);
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include "do_mounts.h" #include "do_mounts.h"
unsigned long initrd_start, initrd_end;
int initrd_below_start_ok;
unsigned int real_root_dev; /* do_proc_dointvec cannot handle kdev_t */ unsigned int real_root_dev; /* do_proc_dointvec cannot handle kdev_t */
static int __initdata old_fd, root_fd; static int __initdata old_fd, root_fd;
static int __initdata mount_initrd = 1; static int __initdata mount_initrd = 1;
...@@ -99,18 +101,20 @@ static void __init handle_initrd(void) ...@@ -99,18 +101,20 @@ static void __init handle_initrd(void)
int __init initrd_load(void) int __init initrd_load(void)
{ {
if (!mount_initrd) if (mount_initrd) {
return 0; create_dev("/dev/ram", Root_RAM0, NULL);
/*
create_dev("/dev/ram", MKDEV(RAMDISK_MAJOR, 0), NULL); * Load the initrd data into /dev/ram0. Execute it as initrd
create_dev("/dev/initrd", MKDEV(RAMDISK_MAJOR, INITRD_MINOR), NULL); * unless /dev/ram0 is supposed to be our actual root device,
/* Load the initrd data into /dev/ram0. Execute it as initrd unless * in that case the ram disk is just set up here, and gets
* /dev/ram0 is supposed to be our actual root device, in * mounted in the normal path.
* that case the ram disk is just set up here, and gets */
* mounted in the normal path. */ if (rd_load_image("/dev/initrd") && ROOT_DEV != Root_RAM0) {
if (rd_load_image("/dev/initrd") && ROOT_DEV != Root_RAM0) { sys_unlink("/dev/initrd");
handle_initrd(); handle_initrd();
return 1; return 1;
}
} }
sys_unlink("/dev/initrd");
return 0; return 0;
} }
...@@ -8,9 +8,11 @@ ...@@ -8,9 +8,11 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/string.h> #include <linux/string.h>
static __initdata char *message;
static void __init error(char *x) static void __init error(char *x)
{ {
panic("populate_root: %s\n", x); if (!message)
message = x;
} }
static void __init *malloc(int size) static void __init *malloc(int size)
...@@ -63,7 +65,7 @@ static char __init *find_link(int major, int minor, int ino, char *name) ...@@ -63,7 +65,7 @@ static char __init *find_link(int major, int minor, int ino, char *name)
} }
q = (struct hash *)malloc(sizeof(struct hash)); q = (struct hash *)malloc(sizeof(struct hash));
if (!q) if (!q)
error("can't allocate link hash entry"); panic("can't allocate link hash entry");
q->ino = ino; q->ino = ino;
q->minor = minor; q->minor = minor;
q->major = major; q->major = major;
...@@ -119,7 +121,7 @@ static void __init parse_header(char *s) ...@@ -119,7 +121,7 @@ static void __init parse_header(char *s)
/* FSM */ /* FSM */
enum state { static __initdata enum state {
Start, Start,
Collect, Collect,
GotHeader, GotHeader,
...@@ -130,9 +132,11 @@ enum state { ...@@ -130,9 +132,11 @@ enum state {
Reset Reset
} state, next_state; } state, next_state;
char *victim; static __initdata char *victim;
unsigned count; static __initdata unsigned count;
loff_t this_header, next_header; static __initdata loff_t this_header, next_header;
static __initdata int dry_run;
static inline void eat(unsigned n) static inline void eat(unsigned n)
{ {
...@@ -185,23 +189,30 @@ static int __init do_collect(void) ...@@ -185,23 +189,30 @@ static int __init do_collect(void)
static int __init do_header(void) static int __init do_header(void)
{ {
if (memcmp(collected, "070701", 6)) {
error("no cpio magic");
return 1;
}
parse_header(collected); parse_header(collected);
next_header = this_header + N_ALIGN(name_len) + body_len; next_header = this_header + N_ALIGN(name_len) + body_len;
next_header = (next_header + 3) & ~3; next_header = (next_header + 3) & ~3;
if (dry_run) {
read_into(name_buf, N_ALIGN(name_len), GotName);
return 0;
}
state = SkipIt;
if (name_len <= 0 || name_len > PATH_MAX) if (name_len <= 0 || name_len > PATH_MAX)
state = SkipIt; return 0;
else if (S_ISLNK(mode)) { if (S_ISLNK(mode)) {
if (body_len > PATH_MAX) if (body_len > PATH_MAX)
state = SkipIt; return 0;
else { collect = collected = symlink_buf;
collect = collected = symlink_buf; remains = N_ALIGN(name_len) + body_len;
remains = N_ALIGN(name_len) + body_len; next_state = GotSymlink;
next_state = GotSymlink; state = Collect;
state = Collect; return 0;
} }
} else if (body_len && !S_ISREG(mode)) if (S_ISREG(mode) || !body_len)
state = SkipIt;
else
read_into(name_buf, N_ALIGN(name_len), GotName); read_into(name_buf, N_ALIGN(name_len), GotName);
return 0; return 0;
} }
...@@ -248,6 +259,8 @@ static int __init do_name(void) ...@@ -248,6 +259,8 @@ static int __init do_name(void)
next_state = Reset; next_state = Reset;
return 0; return 0;
} }
if (dry_run)
return 0;
if (S_ISREG(mode)) { if (S_ISREG(mode)) {
if (maybe_link() >= 0) { if (maybe_link() >= 0) {
wfd = sys_open(collected, O_WRONLY|O_CREAT, mode); wfd = sys_open(collected, O_WRONLY|O_CREAT, mode);
...@@ -268,8 +281,7 @@ static int __init do_name(void) ...@@ -268,8 +281,7 @@ static int __init do_name(void)
sys_chown(collected, uid, gid); sys_chown(collected, uid, gid);
sys_chmod(collected, mode); sys_chmod(collected, mode);
} }
} else }
panic("populate_root: bogus mode: %o\n", mode);
return 0; return 0;
} }
...@@ -323,13 +335,14 @@ static int __init write_buffer(char *buf, unsigned len) ...@@ -323,13 +335,14 @@ static int __init write_buffer(char *buf, unsigned len)
static void __init flush_buffer(char *buf, unsigned len) static void __init flush_buffer(char *buf, unsigned len)
{ {
int written; int written;
while ((written = write_buffer(buf, len)) < len) { if (message)
return;
while ((written = write_buffer(buf, len)) < len && !message) {
char c = buf[written]; char c = buf[written];
if (c == '0') { if (c == '0') {
buf += written; buf += written;
len -= written; len -= written;
state = Start; state = Start;
continue;
} else } else
error("junk in compressed archive"); error("junk in compressed archive");
} }
...@@ -408,18 +421,20 @@ static void __init flush_window(void) ...@@ -408,18 +421,20 @@ static void __init flush_window(void)
outcnt = 0; outcnt = 0;
} }
static void __init unpack_to_rootfs(char *buf, unsigned len) char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only)
{ {
int written; int written;
dry_run = check_only;
header_buf = malloc(110); header_buf = malloc(110);
symlink_buf = malloc(PATH_MAX + N_ALIGN(PATH_MAX) + 1); symlink_buf = malloc(PATH_MAX + N_ALIGN(PATH_MAX) + 1);
name_buf = malloc(N_ALIGN(PATH_MAX)); name_buf = malloc(N_ALIGN(PATH_MAX));
window = malloc(WSIZE); window = malloc(WSIZE);
if (!window || !header_buf || !symlink_buf || !name_buf) if (!window || !header_buf || !symlink_buf || !name_buf)
error("can't allocate buffers"); panic("can't allocate buffers");
state = Start; state = Start;
this_header = 0; this_header = 0;
while (len) { message = NULL;
while (!message && len) {
loff_t saved_offset = this_header; loff_t saved_offset = this_header;
if (*buf == '0' && !(this_header & 3)) { if (*buf == '0' && !(this_header & 3)) {
state = Start; state = Start;
...@@ -427,7 +442,8 @@ static void __init unpack_to_rootfs(char *buf, unsigned len) ...@@ -427,7 +442,8 @@ static void __init unpack_to_rootfs(char *buf, unsigned len)
buf += written; buf += written;
len -= written; len -= written;
continue; continue;
} else if (!*buf) { }
if (!*buf) {
buf++; buf++;
len--; len--;
this_header++; this_header++;
...@@ -442,7 +458,7 @@ static void __init unpack_to_rootfs(char *buf, unsigned len) ...@@ -442,7 +458,7 @@ static void __init unpack_to_rootfs(char *buf, unsigned len)
crc = (ulg)0xffffffffL; /* shift register contents */ crc = (ulg)0xffffffffL; /* shift register contents */
makecrc(); makecrc();
if (gunzip()) if (gunzip())
error("ungzip failed"); message = "ungzip failed";
if (state != Reset) if (state != Reset)
error("junk in gzipped archive"); error("junk in gzipped archive");
this_header = saved_offset + inptr; this_header = saved_offset + inptr;
...@@ -453,12 +469,41 @@ static void __init unpack_to_rootfs(char *buf, unsigned len) ...@@ -453,12 +469,41 @@ static void __init unpack_to_rootfs(char *buf, unsigned len)
free(name_buf); free(name_buf);
free(symlink_buf); free(symlink_buf);
free(header_buf); free(header_buf);
return message;
} }
extern char __initramfs_start, __initramfs_end; extern char __initramfs_start, __initramfs_end;
#ifdef CONFIG_BLK_DEV_INITRD
#include <linux/initrd.h>
#endif
void __init populate_rootfs(void) void __init populate_rootfs(void)
{ {
unpack_to_rootfs(&__initramfs_start, char *err = unpack_to_rootfs(&__initramfs_start,
&__initramfs_end - &__initramfs_start); &__initramfs_end - &__initramfs_start, 0);
if (err)
panic(err);
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) {
int fd;
printk(KERN_INFO "checking if image is initramfs...");
err = unpack_to_rootfs((char *)initrd_start,
initrd_end - initrd_start, 1);
if (!err) {
printk(" it is\n");
unpack_to_rootfs((char *)initrd_start,
initrd_end - initrd_start, 0);
free_initrd_mem(initrd_start, initrd_end);
return;
}
printk("it isn't (%s); looks like an initrd\n", err);
fd = sys_open("/dev/initrd", O_WRONLY|O_CREAT, 700);
if (fd >= 0) {
sys_write(fd, (char *)initrd_start,
initrd_end - initrd_start);
sys_close(fd);
free_initrd_mem(initrd_start, initrd_end);
}
}
#endif
} }
...@@ -2849,7 +2849,7 @@ void __might_sleep(char *file, int line) ...@@ -2849,7 +2849,7 @@ void __might_sleep(char *file, int line)
static unsigned long prev_jiffy; /* ratelimiting */ static unsigned long prev_jiffy; /* ratelimiting */
if (in_atomic() || irqs_disabled()) { if (in_atomic() || irqs_disabled()) {
if (time_before(jiffies, prev_jiffy + HZ)) if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy)
return; return;
prev_jiffy = jiffies; prev_jiffy = jiffies;
printk(KERN_ERR "Debug: sleeping function called from invalid" printk(KERN_ERR "Debug: sleeping function called from invalid"
......
...@@ -1318,6 +1318,10 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags) ...@@ -1318,6 +1318,10 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
/* /*
* Read the swap header. * Read the swap header.
*/ */
if (!mapping->a_ops->readpage) {
error = -EINVAL;
goto bad_swap;
}
page = read_cache_page(mapping, 0, page = read_cache_page(mapping, 0,
(filler_t *)mapping->a_ops->readpage, swap_file); (filler_t *)mapping->a_ops->readpage, swap_file);
if (IS_ERR(page)) { if (IS_ERR(page)) {
......
...@@ -175,7 +175,7 @@ static int ebt_among_check(const char *tablename, unsigned int hookmask, ...@@ -175,7 +175,7 @@ static int ebt_among_check(const char *tablename, unsigned int hookmask,
if (datalen != EBT_ALIGN(expected_length)) { if (datalen != EBT_ALIGN(expected_length)) {
printk(KERN_WARNING printk(KERN_WARNING
"ebtables: among: wrong size: %d" "ebtables: among: wrong size: %d"
"against expected %d, rounded to %d\n", "against expected %d, rounded to %Zd\n",
datalen, expected_length, datalen, expected_length,
EBT_ALIGN(expected_length)); EBT_ALIGN(expected_length));
return -EINVAL; return -EINVAL;
......
...@@ -646,11 +646,12 @@ int dev_alloc_name(struct net_device *dev, const char *name) ...@@ -646,11 +646,12 @@ int dev_alloc_name(struct net_device *dev, const char *name)
* failed. The cause of an error is returned as a negative errno code * failed. The cause of an error is returned as a negative errno code
* in the variable @err points to. * in the variable @err points to.
* *
* The caller must hold the @dev_base or RTNL locks when doing this in * This call is deprecated in favor of alloc_netdev because
* the caller must hold the @dev_base or RTNL locks when doing this in
* order to avoid duplicate name allocations. * order to avoid duplicate name allocations.
*/ */
struct net_device *dev_alloc(const char *name, int *err) struct net_device *__dev_alloc(const char *name, int *err)
{ {
struct net_device *dev = kmalloc(sizeof(*dev), GFP_KERNEL); struct net_device *dev = kmalloc(sizeof(*dev), GFP_KERNEL);
...@@ -2997,7 +2998,7 @@ EXPORT_SYMBOL(__dev_remove_pack); ...@@ -2997,7 +2998,7 @@ EXPORT_SYMBOL(__dev_remove_pack);
EXPORT_SYMBOL(__skb_linearize); EXPORT_SYMBOL(__skb_linearize);
EXPORT_SYMBOL(call_netdevice_notifiers); EXPORT_SYMBOL(call_netdevice_notifiers);
EXPORT_SYMBOL(dev_add_pack); EXPORT_SYMBOL(dev_add_pack);
EXPORT_SYMBOL(dev_alloc); EXPORT_SYMBOL(__dev_alloc);
EXPORT_SYMBOL(dev_alloc_name); EXPORT_SYMBOL(dev_alloc_name);
EXPORT_SYMBOL(dev_close); EXPORT_SYMBOL(dev_close);
EXPORT_SYMBOL(dev_get_by_flags); EXPORT_SYMBOL(dev_get_by_flags);
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <net/arp.h> #include <net/arp.h>
#include <net/checksum.h> #include <net/checksum.h>
#include <net/inet_ecn.h> #include <net/inet_ecn.h>
#include <net/xfrm.h>
#ifdef CONFIG_IPV6 #ifdef CONFIG_IPV6
#include <net/ipv6.h> #include <net/ipv6.h>
...@@ -600,6 +601,9 @@ int ipgre_rcv(struct sk_buff *skb) ...@@ -600,6 +601,9 @@ int ipgre_rcv(struct sk_buff *skb)
read_lock(&ipgre_lock); read_lock(&ipgre_lock);
if ((tunnel = ipgre_tunnel_lookup(iph->saddr, iph->daddr, key)) != NULL) { if ((tunnel = ipgre_tunnel_lookup(iph->saddr, iph->daddr, key)) != NULL) {
secpath_put(skb->sp);
skb->sp = NULL;
skb->mac.raw = skb->nh.raw; skb->mac.raw = skb->nh.raw;
skb->nh.raw = __pskb_pull(skb, offset); skb->nh.raw = __pskb_pull(skb, offset);
memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
......
...@@ -493,7 +493,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*)) ...@@ -493,7 +493,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
goto slow_path; goto slow_path;
/* Correct socket ownership. */ /* Correct socket ownership. */
if (frag->sk == NULL) if (frag->sk == NULL && skb->sk)
goto slow_path; goto slow_path;
/* Partially cloned skb? */ /* Partially cloned skb? */
......
...@@ -483,6 +483,9 @@ static int ipip_rcv(struct sk_buff *skb) ...@@ -483,6 +483,9 @@ static int ipip_rcv(struct sk_buff *skb)
return 0; return 0;
} }
secpath_put(skb->sp);
skb->sp = NULL;
skb->mac.raw = skb->nh.raw; skb->mac.raw = skb->nh.raw;
skb->nh.raw = skb->data; skb->nh.raw = skb->data;
memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
......
...@@ -178,9 +178,15 @@ void tcp_bind_hash(struct sock *sk, struct tcp_bind_bucket *tb, ...@@ -178,9 +178,15 @@ void tcp_bind_hash(struct sock *sk, struct tcp_bind_bucket *tb,
tcp_sk(sk)->bind_hash = tb; tcp_sk(sk)->bind_hash = tb;
} }
static inline const u32 tcp_v4_rcv_saddr(const struct sock *sk)
{
return likely(sk->sk_state != TCP_TIME_WAIT) ?
inet_sk(sk)->rcv_saddr : tcptw_sk(sk)->tw_rcv_saddr;
}
static inline int tcp_bind_conflict(struct sock *sk, struct tcp_bind_bucket *tb) static inline int tcp_bind_conflict(struct sock *sk, struct tcp_bind_bucket *tb)
{ {
struct inet_opt *inet = inet_sk(sk); const u32 sk_rcv_saddr = tcp_v4_rcv_saddr(sk);
struct sock *sk2; struct sock *sk2;
struct hlist_node *node; struct hlist_node *node;
int reuse = sk->sk_reuse; int reuse = sk->sk_reuse;
...@@ -193,9 +199,9 @@ static inline int tcp_bind_conflict(struct sock *sk, struct tcp_bind_bucket *tb) ...@@ -193,9 +199,9 @@ static inline int tcp_bind_conflict(struct sock *sk, struct tcp_bind_bucket *tb)
sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) { sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
if (!reuse || !sk2->sk_reuse || if (!reuse || !sk2->sk_reuse ||
sk2->sk_state == TCP_LISTEN) { sk2->sk_state == TCP_LISTEN) {
struct inet_opt *inet2 = inet_sk(sk2); const u32 sk2_rcv_saddr = tcp_v4_rcv_saddr(sk2);
if (!inet2->rcv_saddr || !inet->rcv_saddr || if (!sk2_rcv_saddr || !sk_rcv_saddr ||
inet2->rcv_saddr == inet->rcv_saddr) sk2_rcv_saddr == sk_rcv_saddr)
break; break;
} }
} }
...@@ -2145,7 +2151,6 @@ static void *listening_get_first(struct seq_file *seq) ...@@ -2145,7 +2151,6 @@ static void *listening_get_first(struct seq_file *seq)
if (!sk) if (!sk)
continue; continue;
++st->num;
if (sk->sk_family == st->family) { if (sk->sk_family == st->family) {
rc = sk; rc = sk;
goto out; goto out;
...@@ -2159,7 +2164,7 @@ static void *listening_get_first(struct seq_file *seq) ...@@ -2159,7 +2164,7 @@ static void *listening_get_first(struct seq_file *seq)
for (st->sbucket = 0; st->sbucket < TCP_SYNQ_HSIZE; for (st->sbucket = 0; st->sbucket < TCP_SYNQ_HSIZE;
++st->sbucket) { ++st->sbucket) {
for (req = tp->listen_opt->syn_table[st->sbucket]; for (req = tp->listen_opt->syn_table[st->sbucket];
req; req = req->dl_next, ++st->num) { req; req = req->dl_next) {
if (req->class->family != st->family) if (req->class->family != st->family)
continue; continue;
rc = req; rc = req;
...@@ -2181,6 +2186,8 @@ static void *listening_get_next(struct seq_file *seq, void *cur) ...@@ -2181,6 +2186,8 @@ static void *listening_get_next(struct seq_file *seq, void *cur)
struct sock *sk = cur; struct sock *sk = cur;
struct tcp_iter_state* st = seq->private; struct tcp_iter_state* st = seq->private;
++st->num;
if (st->state == TCP_SEQ_STATE_OPENREQ) { if (st->state == TCP_SEQ_STATE_OPENREQ) {
struct open_request *req = cur; struct open_request *req = cur;
...@@ -2188,7 +2195,6 @@ static void *listening_get_next(struct seq_file *seq, void *cur) ...@@ -2188,7 +2195,6 @@ static void *listening_get_next(struct seq_file *seq, void *cur)
req = req->dl_next; req = req->dl_next;
while (1) { while (1) {
while (req) { while (req) {
++st->num;
if (req->class->family == st->family) { if (req->class->family == st->family) {
cur = req; cur = req;
goto out; goto out;
...@@ -2235,10 +2241,11 @@ static void *listening_get_idx(struct seq_file *seq, loff_t *pos) ...@@ -2235,10 +2241,11 @@ static void *listening_get_idx(struct seq_file *seq, loff_t *pos)
{ {
void *rc = listening_get_first(seq); void *rc = listening_get_first(seq);
if (rc) while (rc && *pos) {
while (*pos && (rc = listening_get_next(seq, rc))) rc = listening_get_next(seq, rc);
--*pos; --*pos;
return *pos ? NULL : rc; }
return rc;
} }
static void *established_get_first(struct seq_file *seq) static void *established_get_first(struct seq_file *seq)
...@@ -2254,7 +2261,6 @@ static void *established_get_first(struct seq_file *seq) ...@@ -2254,7 +2261,6 @@ static void *established_get_first(struct seq_file *seq)
read_lock(&tcp_ehash[st->bucket].lock); read_lock(&tcp_ehash[st->bucket].lock);
sk_for_each(sk, node, &tcp_ehash[st->bucket].chain) { sk_for_each(sk, node, &tcp_ehash[st->bucket].chain) {
if (sk->sk_family != st->family) { if (sk->sk_family != st->family) {
++st->num;
continue; continue;
} }
rc = sk; rc = sk;
...@@ -2264,7 +2270,6 @@ static void *established_get_first(struct seq_file *seq) ...@@ -2264,7 +2270,6 @@ static void *established_get_first(struct seq_file *seq)
tw_for_each(tw, node, tw_for_each(tw, node,
&tcp_ehash[st->bucket + tcp_ehash_size].chain) { &tcp_ehash[st->bucket + tcp_ehash_size].chain) {
if (tw->tw_family != st->family) { if (tw->tw_family != st->family) {
++st->num;
continue; continue;
} }
rc = tw; rc = tw;
...@@ -2284,12 +2289,13 @@ static void *established_get_next(struct seq_file *seq, void *cur) ...@@ -2284,12 +2289,13 @@ static void *established_get_next(struct seq_file *seq, void *cur)
struct hlist_node *node; struct hlist_node *node;
struct tcp_iter_state* st = seq->private; struct tcp_iter_state* st = seq->private;
++st->num;
if (st->state == TCP_SEQ_STATE_TIME_WAIT) { if (st->state == TCP_SEQ_STATE_TIME_WAIT) {
tw = cur; tw = cur;
tw = tw_next(tw); tw = tw_next(tw);
get_tw: get_tw:
while (tw && tw->tw_family != st->family) { while (tw && tw->tw_family != st->family) {
++st->num;
tw = tw_next(tw); tw = tw_next(tw);
} }
if (tw) { if (tw) {
...@@ -2311,7 +2317,6 @@ static void *established_get_next(struct seq_file *seq, void *cur) ...@@ -2311,7 +2317,6 @@ static void *established_get_next(struct seq_file *seq, void *cur)
sk_for_each_from(sk, node) { sk_for_each_from(sk, node) {
if (sk->sk_family == st->family) if (sk->sk_family == st->family)
goto found; goto found;
++st->num;
} }
st->state = TCP_SEQ_STATE_TIME_WAIT; st->state = TCP_SEQ_STATE_TIME_WAIT;
...@@ -2327,10 +2332,11 @@ static void *established_get_idx(struct seq_file *seq, loff_t pos) ...@@ -2327,10 +2332,11 @@ static void *established_get_idx(struct seq_file *seq, loff_t pos)
{ {
void *rc = established_get_first(seq); void *rc = established_get_first(seq);
if (rc) while (rc && pos) {
while (pos && (rc = established_get_next(seq, rc))) rc = established_get_next(seq, rc);
--pos; --pos;
return pos ? NULL : rc; }
return rc;
} }
static void *tcp_get_idx(struct seq_file *seq, loff_t pos) static void *tcp_get_idx(struct seq_file *seq, loff_t pos)
...@@ -2354,6 +2360,8 @@ static void *tcp_get_idx(struct seq_file *seq, loff_t pos) ...@@ -2354,6 +2360,8 @@ static void *tcp_get_idx(struct seq_file *seq, loff_t pos)
static void *tcp_seq_start(struct seq_file *seq, loff_t *pos) static void *tcp_seq_start(struct seq_file *seq, loff_t *pos)
{ {
struct tcp_iter_state* st = seq->private;
st->num = 0;
return *pos ? tcp_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; return *pos ? tcp_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
} }
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <net/ip6_route.h> #include <net/ip6_route.h>
#include <net/addrconf.h> #include <net/addrconf.h>
#include <net/ip6_tunnel.h> #include <net/ip6_tunnel.h>
#include <net/xfrm.h>
MODULE_AUTHOR("Ville Nuorvala"); MODULE_AUTHOR("Ville Nuorvala");
MODULE_DESCRIPTION("IPv6-in-IPv6 tunnel"); MODULE_DESCRIPTION("IPv6-in-IPv6 tunnel");
...@@ -514,6 +515,8 @@ int ip6ip6_rcv(struct sk_buff **pskb, unsigned int *nhoffp) ...@@ -514,6 +515,8 @@ int ip6ip6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
read_unlock(&ip6ip6_lock); read_unlock(&ip6ip6_lock);
goto discard; goto discard;
} }
secpath_put(skb->sp);
skb->sp = NULL;
skb->mac.raw = skb->nh.raw; skb->mac.raw = skb->nh.raw;
skb->nh.raw = skb->data; skb->nh.raw = skb->data;
skb->protocol = htons(ETH_P_IPV6); skb->protocol = htons(ETH_P_IPV6);
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include <net/icmp.h> #include <net/icmp.h>
#include <net/ipip.h> #include <net/ipip.h>
#include <net/inet_ecn.h> #include <net/inet_ecn.h>
#include <net/xfrm.h>
/* /*
This version of net/ipv6/sit.c is cloned of net/ipv4/ip_gre.c This version of net/ipv6/sit.c is cloned of net/ipv4/ip_gre.c
...@@ -376,6 +377,8 @@ static int ipip6_rcv(struct sk_buff *skb) ...@@ -376,6 +377,8 @@ static int ipip6_rcv(struct sk_buff *skb)
read_lock(&ipip6_lock); read_lock(&ipip6_lock);
if ((tunnel = ipip6_tunnel_lookup(iph->saddr, iph->daddr)) != NULL) { if ((tunnel = ipip6_tunnel_lookup(iph->saddr, iph->daddr)) != NULL) {
secpath_put(skb->sp);
skb->sp = NULL;
skb->mac.raw = skb->nh.raw; skb->mac.raw = skb->nh.raw;
skb->nh.raw = skb->data; skb->nh.raw = skb->data;
memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
......
...@@ -12,7 +12,7 @@ use strict; ...@@ -12,7 +12,7 @@ use strict;
## $3 -- the filename which contained the sgmldoc output ## $3 -- the filename which contained the sgmldoc output
## (I need this so I know which manpages to convert) ## (I need this so I know which manpages to convert)
my($LISTING, $GENERATED, $INPUT, $OUTPUT, $front, $mode, $filename); my($LISTING, $GENERATED, $INPUT, $OUTPUT, $front, $mode, $filename, $tmpdir);
if($ARGV[0] eq ""){ if($ARGV[0] eq ""){
die "Usage: makeman [convert | install] <dir> <file>\n"; die "Usage: makeman [convert | install] <dir> <file>\n";
...@@ -22,6 +22,13 @@ if( ! -d "$ARGV[1]" ){ ...@@ -22,6 +22,13 @@ if( ! -d "$ARGV[1]" ){
die "Output directory \"$ARGV[1]\" does not exist\n"; die "Output directory \"$ARGV[1]\" does not exist\n";
} }
if($ENV{"TMPDIR"} ne ""){
$tmpdir = $ENV{"TMPDIR"};
}
else{
$tmpdir = "/tmp";
}
if($ARGV[0] eq "convert"){ if($ARGV[0] eq "convert"){
open LISTING, "grep \"<refentrytitle>\" $ARGV[2] |"; open LISTING, "grep \"<refentrytitle>\" $ARGV[2] |";
while(<LISTING>){ while(<LISTING>){
...@@ -40,29 +47,38 @@ if($ARGV[0] eq "convert"){ ...@@ -40,29 +47,38 @@ if($ARGV[0] eq "convert"){
open INPUT, "< $ARGV[1]/$filename.sgml"; open INPUT, "< $ARGV[1]/$filename.sgml";
$front = ""; $front = "";
$mode = 0; $mode = 0;
while(<INPUT>){
if(/.*ENDFRONTTAG.*/){
$mode = 0;
}
# The modes used here are:
# mode = 0
# <!-- BEGINFRONTTAG -->
# <!-- <bookinfo> mode = 1
# <!-- <legalnotice> mode = 2
# <!-- ...GPL or whatever...
# <!-- </legalnotice> mode = 4
# <!-- </bookinfo> mode = 3
# <!-- ENDFRONTTAG -->
#
# ...doco...
# I know that some of the if statements in this while loop are in a funny
# order, but that is deliberate...
while(<INPUT>){
if($mode > 0){ if($mode > 0){
s/<!-- //; s/<!-- //;
s/ -->//; s/ -->//;
s/<bookinfo>//; s/<docinfo>//i;
s/<\/bookinfo>//; s<\/docinfo>//i;
s/<docinfo>//; s/^[ \t]*//i;
s<\/docinfo>//;
s/^[ \t]*//;
} }
if($mode == 2){ if($mode == 2){
if(/<para>/){ if(/<para>/i){
} }
elsif(/<\/para>/){ elsif(/<\/para>/i){
$front = "$front.\\\" \n"; $front = "$front.\\\" \n";
} }
elsif(/<\/legalnotice>/){ elsif(/<\/legalnotice>/i){
$mode = 1; $mode = 4;
} }
elsif(/^[ \t]*$/){ elsif(/^[ \t]*$/){
} }
...@@ -72,69 +88,79 @@ if($ARGV[0] eq "convert"){ ...@@ -72,69 +88,79 @@ if($ARGV[0] eq "convert"){
} }
if($mode == 1){ if($mode == 1){
if(/<title>(.*)<\/title>/){ if(/<title>(.*)<\/title>/i){
$front = "$front.\\\" This documentation was generated from the book titled \"$1\", which is part of the Linux kernel source.\n.\\\" \n"; $front = "$front.\\\" This documentation was generated from the book titled \"$1\", which is part of the Linux kernel source.\n.\\\" \n";
} }
elsif(/<legalnotice>/){ elsif(/<legalnotice>/i){
$front = "$front.\\\" This documentation comes with the following legal notice:\n.\\\" \n"; $front = "$front.\\\" This documentation comes with the following legal notice:\n.\\\" \n";
$mode = 2; $mode = 2;
} }
elsif(/<author>/){ elsif(/<author>/i){
$front = "$front.\\\" Documentation by: "; $front = "$front.\\\" Documentation by: ";
} }
elsif(/<firstname>(.*)<\/firstname>/){ elsif(/<firstname>(.*)<\/firstname>/i){
$front = "$front$1 "; $front = "$front$1 ";
} }
elsif(/<surname>(.*)<\/surname>/){ elsif(/<surname>(.*)<\/surname>/i){
$front = "$front$1 "; $front = "$front$1 ";
} }
elsif(/<email>(.*)<\/email>/){ elsif(/<email>(.*)<\/email>/i){
$front = "$front($1)"; $front = "$front($1)";
} }
elsif(/\/author>/){ elsif(/\/author>/i){
$front = "$front\n"; $front = "$front\n";
} }
elsif(/<copyright>/){ elsif(/<copyright>/i){
$front = "$front.\\\" Documentation copyright: "; $front = "$front.\\\" Documentation copyright: ";
} }
elsif(/<holder>(.*)<\/holder>/){ elsif(/<holder>(.*)<\/holder>/i){
$front = "$front$1 "; $front = "$front$1 ";
} }
elsif(/<year>(.*)<\/year>/){ elsif(/<year>(.*)<\/year>/i){
$front = "$front$1 "; $front = "$front$1 ";
} }
elsif(/\/copyright>/){ elsif(/\/copyright>/i){
$front = "$front\n"; $front = "$front\n";
} }
elsif(/^[ \t]*$/ elsif(/^[ \t]*$/
|| /<affiliation>/ || /<affiliation>/i
|| /<\/affiliation>/ || /<\/affiliation>/i
|| /<address>/ || /<address>/i
|| /<\/address>/ || /<\/address>/i
|| /<authorgroup>/ || /<authorgroup>/i
|| /<\/authorgroup>/ || /<\/authorgroup>/i
|| /<\/legalnotice>/ || /<\/legalnotice>/i
|| /<date>/ || /<date>/i
|| /<\/date>/ || /<\/date>/i
|| /<edition>/ || /<edition>/i
|| /<\/edition>/){ || /<\/edition>/i
|| /<pubdate>/i
|| /<\/pubdate>/i){
} }
else{ else{
print "Unknown tag in manpage conversion: $_"; print "Unknown tag in manpage conversion: $_";
} }
} }
if(/.*BEGINFRONTTAG.*/){ if($mode == 0){
$mode = 1; if(/<bookinfo>/i){
$mode = 1;
}
}
if($mode == 4){
if(/<\/bookinfo>/i){
$mode = 3;
}
} }
} }
close INPUT; close INPUT;
system("cd $ARGV[1]; docbook2man $filename.sgml; mv $filename.9 /tmp/$$.9\n"); system("cd $ARGV[1]; docbook2man $filename.sgml; mv $filename.9 $tmpdir/$$.9\n");
open GENERATED, "< /tmp/$$.9"; open GENERATED, "< $tmpdir/$$.9";
open OUTPUT, "> $ARGV[1]/$filename.9"; open OUTPUT, "> $ARGV[1]/$filename.9";
print OUTPUT "$front"; print OUTPUT "$front";
...@@ -146,7 +172,7 @@ if($ARGV[0] eq "convert"){ ...@@ -146,7 +172,7 @@ if($ARGV[0] eq "convert"){
close GENERATED; close GENERATED;
system("gzip -f $ARGV[1]/$filename.9\n"); system("gzip -f $ARGV[1]/$filename.9\n");
unlink("/tmp/$filename.9"); unlink("$tmpdir/$$.9");
} }
} }
elsif($ARGV[0] eq "install"){ elsif($ARGV[0] eq "install"){
......
...@@ -52,7 +52,7 @@ while(<SGML>){ ...@@ -52,7 +52,7 @@ while(<SGML>){
open REF, "> $ARGV[1]/$filename.sgml" or open REF, "> $ARGV[1]/$filename.sgml" or
die "Couldn't open output file \"$ARGV[1]/$filename.sgml\": $!\n"; die "Couldn't open output file \"$ARGV[1]/$filename.sgml\": $!\n";
print REF <<EOF; print REF <<EOF;
<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN"> <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
<!-- BEGINFRONTTAG: The following is front matter for the parent book --> <!-- BEGINFRONTTAG: The following is front matter for the parent book -->
$front $front
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#define SECCLASS_NULL 0x0000 /* no class */ #define SECCLASS_NULL 0x0000 /* no class */
#define SELINUX_MAGIC 0xf97cff8c #define SELINUX_MAGIC 0xf97cff8c
#define POLICYDB_VERSION 15
#ifdef CONFIG_SECURITY_SELINUX_BOOTPARAM #ifdef CONFIG_SECURITY_SELINUX_BOOTPARAM
extern int selinux_enabled; extern int selinux_enabled;
......
...@@ -37,7 +37,8 @@ enum sel_inos { ...@@ -37,7 +37,8 @@ enum sel_inos {
SEL_ACCESS, /* compute access decision */ SEL_ACCESS, /* compute access decision */
SEL_CREATE, /* compute create labeling decision */ SEL_CREATE, /* compute create labeling decision */
SEL_RELABEL, /* compute relabeling decision */ SEL_RELABEL, /* compute relabeling decision */
SEL_USER /* compute reachable user contexts */ SEL_USER, /* compute reachable user contexts */
SEL_POLICYVERS /* return policy version for this kernel */
}; };
static ssize_t sel_read_enforce(struct file *filp, char *buf, static ssize_t sel_read_enforce(struct file *filp, char *buf,
...@@ -125,6 +126,46 @@ static struct file_operations sel_enforce_ops = { ...@@ -125,6 +126,46 @@ static struct file_operations sel_enforce_ops = {
.write = sel_write_enforce, .write = sel_write_enforce,
}; };
static ssize_t sel_read_policyvers(struct file *filp, char *buf,
size_t count, loff_t *ppos)
{
char *page;
ssize_t length;
ssize_t end;
if (count < 0 || count > PAGE_SIZE)
return -EINVAL;
if (!(page = (char*)__get_free_page(GFP_KERNEL)))
return -ENOMEM;
memset(page, 0, PAGE_SIZE);
length = snprintf(page, PAGE_SIZE, "%u", POLICYDB_VERSION);
if (length < 0) {
free_page((unsigned long)page);
return length;
}
if (*ppos >= length) {
free_page((unsigned long)page);
return 0;
}
if (count + *ppos > length)
count = length - *ppos;
end = count + *ppos;
if (copy_to_user(buf, (char *) page + *ppos, count)) {
count = -EFAULT;
goto out;
}
*ppos = end;
out:
free_page((unsigned long)page);
return count;
}
static struct file_operations sel_policyvers_ops = {
.read = sel_read_policyvers,
};
static ssize_t sel_write_load(struct file * file, const char * buf, static ssize_t sel_write_load(struct file * file, const char * buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
...@@ -568,6 +609,7 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent) ...@@ -568,6 +609,7 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent)
[SEL_CREATE] = {"create", &transaction_ops, S_IRUGO|S_IWUGO}, [SEL_CREATE] = {"create", &transaction_ops, S_IRUGO|S_IWUGO},
[SEL_RELABEL] = {"relabel", &transaction_ops, S_IRUGO|S_IWUGO}, [SEL_RELABEL] = {"relabel", &transaction_ops, S_IRUGO|S_IWUGO},
[SEL_USER] = {"user", &transaction_ops, S_IRUGO|S_IWUGO}, [SEL_USER] = {"user", &transaction_ops, S_IRUGO|S_IWUGO},
[SEL_POLICYVERS] = {"policyvers", &sel_policyvers_ops, S_IRUGO},
/* last one */ {""} /* last one */ {""}
}; };
return simple_fill_super(sb, SELINUX_MAGIC, selinux_files); return simple_fill_super(sb, SELINUX_MAGIC, selinux_files);
......
...@@ -225,7 +225,6 @@ extern int policydb_read(struct policydb *p, void *fp); ...@@ -225,7 +225,6 @@ extern int policydb_read(struct policydb *p, void *fp);
#define PERM_SYMTAB_SIZE 32 #define PERM_SYMTAB_SIZE 32
#define POLICYDB_VERSION 15
#define POLICYDB_CONFIG_MLS 1 #define POLICYDB_CONFIG_MLS 1
#define OBJECT_R "object_r" #define OBJECT_R "object_r"
......
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