Commit eccb5ce4 authored by Jeff Garzik's avatar Jeff Garzik

Merge redhat.com:/home/jgarzik/repo/linus-2.5

into redhat.com:/home/jgarzik/repo/misc-2.5
parents f1d4b51f 810408f0
......@@ -88,6 +88,8 @@ pci_max_busnr(void)
* %PCI_CAP_ID_MSI Message Signalled Interrupts
*
* %PCI_CAP_ID_CHSWP CompactPCI HotSwap
*
* %PCI_CAP_ID_PCIX PCI-X
*/
int
pci_find_capability(struct pci_dev *dev, int cap)
......
......@@ -75,8 +75,8 @@ static int expand_files(struct files_struct *files, int nr)
/*
* locate_fd finds a free file descriptor in the open_fds fdset,
* expanding the fd arrays if necessary. The files write lock will be
* held on exit to ensure that the fd can be entered atomically.
* expanding the fd arrays if necessary. Must be called with the
* file_lock held for write.
*/
static int locate_fd(struct files_struct *files,
......@@ -86,8 +86,6 @@ static int locate_fd(struct files_struct *files,
int error;
int start;
write_lock(&files->file_lock);
error = -EINVAL;
if (orig_start >= current->rlim[RLIMIT_NOFILE].rlim_cur)
goto out;
......@@ -131,30 +129,24 @@ static int locate_fd(struct files_struct *files,
return error;
}
static inline void allocate_fd(struct files_struct *files,
struct file *file, int fd)
{
FD_SET(fd, files->open_fds);
FD_CLR(fd, files->close_on_exec);
write_unlock(&files->file_lock);
fd_install(fd, file);
}
static int dupfd(struct file *file, int start)
{
struct files_struct * files = current->files;
int ret;
int fd;
ret = locate_fd(files, file, start);
if (ret < 0)
goto out_putf;
allocate_fd(files, file, ret);
return ret;
write_lock(&files->file_lock);
fd = locate_fd(files, file, start);
if (fd >= 0) {
FD_SET(fd, files->open_fds);
FD_CLR(fd, files->close_on_exec);
write_unlock(&files->file_lock);
fd_install(fd, file);
} else {
write_unlock(&files->file_lock);
fput(file);
}
out_putf:
write_unlock(&files->file_lock);
fput(file);
return ret;
return fd;
}
asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd)
......
......@@ -488,7 +488,11 @@ struct proc_dir_entry *proc_symlink(const char *name,
ent->data = kmalloc((ent->size=strlen(dest))+1, GFP_KERNEL);
if (ent->data) {
strcpy((char*)ent->data,dest);
proc_register(parent, ent);
if (proc_register(parent, ent) < 0) {
kfree(ent->data);
kfree(ent);
ent = NULL;
}
} else {
kfree(ent);
ent = NULL;
......@@ -505,7 +509,10 @@ struct proc_dir_entry *proc_mknod(const char *name, mode_t mode,
ent = proc_create(&parent,name,mode,1);
if (ent) {
ent->rdev = rdev;
proc_register(parent, ent);
if (proc_register(parent, ent) < 0) {
kfree(ent);
ent = NULL;
}
}
return ent;
}
......@@ -520,7 +527,10 @@ struct proc_dir_entry *proc_mkdir(const char *name, struct proc_dir_entry *paren
ent->proc_fops = &proc_dir_operations;
ent->proc_iops = &proc_dir_inode_operations;
proc_register(parent, ent);
if (proc_register(parent, ent) < 0) {
kfree(ent);
ent = NULL;
}
}
return ent;
}
......@@ -549,7 +559,10 @@ struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
ent->proc_fops = &proc_dir_operations;
ent->proc_iops = &proc_dir_inode_operations;
}
proc_register(parent, ent);
if (proc_register(parent, ent) < 0) {
kfree(ent);
ent = NULL;
}
}
return ent;
}
......
......@@ -65,9 +65,9 @@
#define PCI_HEADER_TYPE_CARDBUS 2
#define PCI_BIST 0x0f /* 8 bits */
#define PCI_BIST_CODE_MASK 0x0f /* Return result */
#define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */
#define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */
#define PCI_BIST_CODE_MASK 0x0f /* Return result */
#define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */
#define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */
/*
* Base addresses specify locations in memory or I/O space.
......@@ -195,6 +195,7 @@
#define PCI_CAP_ID_SLOTID 0x04 /* Slot Identification */
#define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */
#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */
#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */
#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */
#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */
#define PCI_CAP_SIZEOF 4
......@@ -251,6 +252,13 @@
#define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate */
#define PCI_AGP_SIZEOF 12
/* Vital Product Data */
#define PCI_VPD_ADDR 2 /* Address to access (15 bits!) */
#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */
#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */
#define PCI_VPD_DATA 4 /* 32-bits of data returned here */
/* Slot Identification */
#define PCI_SID_ESR 2 /* Expansion Slot Register */
......@@ -271,6 +279,37 @@
#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */
#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
/* CompactPCI Hotswap Register */
#define PCI_CHSWP_CSR 2 /* Control and Status Register */
#define PCI_CHSWP_DHA 0x01 /* Device Hiding Arm */
#define PCI_CHSWP_EIM 0x02 /* ENUM# Signal Mask */
#define PCI_CHSWP_PIE 0x04 /* Pending Insert or Extract */
#define PCI_CHSWP_LOO 0x08 /* LED On / Off */
#define PCI_CHSWP_PI 0x30 /* Programming Interface */
#define PCI_CHSWP_EXT 0x40 /* ENUM# status - extraction */
#define PCI_CHSWP_INS 0x80 /* ENUM# status - insertion */
/* PCI-X registers */
#define PCI_X_CMD 2 /* Modes & Features */
#define PCI_X_CMD_DPERR_E 0x0001 /* Data Parity Error Recovery Enable */
#define PCI_X_CMD_ERO 0x0002 /* Enable Relaxed Ordering */
#define PCI_X_CMD_MAX_READ 0x000c /* Max Memory Read Byte Count */
#define PCI_X_CMD_MAX_SPLIT 0x0070 /* Max Outstanding Split Transactions */
#define PCI_X_DEVFN 4 /* A copy of devfn. */
#define PCI_X_BUSNR 5 /* Bus segment number */
#define PCI_X_STATUS 6 /* PCI-X capabilities */
#define PCI_X_STATUS_64BIT 0x0001 /* 64-bit device */
#define PCI_X_STATUS_133MHZ 0x0002 /* 133 MHz capable */
#define PCI_X_STATUS_SPL_DISC 0x0004 /* Split Completion Discarded */
#define PCI_X_STATUS_UNX_SPL 0x0008 /* Unexpected Split Completion */
#define PCI_X_STATUS_COMPLEX 0x0010 /* Device Complexity */
#define PCI_X_STATUS_MAX_READ 0x0060 /* Designed Maximum Memory Read Count */
#define PCI_X_STATUS_MAX_SPLIT 0x0380 /* Design Max Outstanding Split Trans */
#define PCI_X_STATUS_MAX_CUM 0x1c00 /* Designed Max Cumulative Read Size */
#define PCI_X_STATUS_SPL_ERR 0x2000 /* Rcvd Split Completion Error Msg */
/* Include the ID list */
#include <linux/pci_ids.h>
......
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