diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-03-02 02:36:47 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-03-02 02:36:47 +0000 |
commit | 8624512aa908741ba2795200133eae0d7f4557ea (patch) | |
tree | d5d3036fccf2604f4c98dedc11e8adb929d6b52e /kernel | |
parent | 7b8f5d6f1d45d9f9de1d26e7d3c32aa5af11b488 (diff) |
Merge with 2.3.48.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/exit.c | 11 | ||||
-rw-r--r-- | kernel/ksyms.c | 4 | ||||
-rw-r--r-- | kernel/pm.c | 39 | ||||
-rw-r--r-- | kernel/sched.c | 11 | ||||
-rw-r--r-- | kernel/sys.c | 19 | ||||
-rw-r--r-- | kernel/sysctl.c | 59 |
6 files changed, 84 insertions, 59 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 65d72df43..9dd09f050 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -445,7 +445,7 @@ asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struc DECLARE_WAITQUEUE(wait, current); struct task_struct *p; - if (options & ~(WNOHANG|WUNTRACED|__WCLONE)) + if (options & ~(WNOHANG|WUNTRACED|__WCLONE|__WALL)) return -EINVAL; add_wait_queue(¤t->wait_chldexit,&wait); @@ -464,8 +464,13 @@ repeat: if (p->pgrp != -pid) continue; } - /* wait for cloned processes iff the __WCLONE flag is set */ - if ((p->exit_signal != SIGCHLD) ^ ((options & __WCLONE) != 0)) + /* Wait for all children (clone and not) if __WALL is set; + * otherwise, wait for clone children *only* if __WCLONE is + * set; otherwise, wait for non-clone children *only*. (Note: + * A "clone" child here is one that reports to its parent + * using a signal other than SIGCHLD.) */ + if (((p->exit_signal != SIGCHLD) ^ ((options & __WCLONE) != 0)) + && !(options & __WALL)) continue; flag = 1; switch (p->state) { diff --git a/kernel/ksyms.c b/kernel/ksyms.c index 79525ce16..06de40312 100644 --- a/kernel/ksyms.c +++ b/kernel/ksyms.c @@ -159,6 +159,8 @@ EXPORT_SYMBOL(__mark_inode_dirty); EXPORT_SYMBOL(free_kiovec); EXPORT_SYMBOL(brw_kiovec); EXPORT_SYMBOL(alloc_kiovec); +EXPORT_SYMBOL(expand_kiobuf); +EXPORT_SYMBOL(unmap_kiobuf); EXPORT_SYMBOL(get_empty_filp); EXPORT_SYMBOL(init_private_file); EXPORT_SYMBOL(filp_open); @@ -196,6 +198,7 @@ EXPORT_SYMBOL(generic_file_read); EXPORT_SYMBOL(do_generic_file_read); EXPORT_SYMBOL(generic_file_write); EXPORT_SYMBOL(generic_file_mmap); +EXPORT_SYMBOL(generic_ro_fops); EXPORT_SYMBOL(generic_buffer_fdatasync); EXPORT_SYMBOL(page_hash_bits); EXPORT_SYMBOL(page_hash_table); @@ -216,6 +219,7 @@ EXPORT_SYMBOL(get_unused_fd); EXPORT_SYMBOL(vfs_rmdir); EXPORT_SYMBOL(vfs_unlink); EXPORT_SYMBOL(vfs_rename); +EXPORT_SYMBOL(generic_read_dir); EXPORT_SYMBOL(__pollwait); EXPORT_SYMBOL(ROOT_DEV); EXPORT_SYMBOL(__find_get_page); diff --git a/kernel/pm.c b/kernel/pm.c index c35620402..b2f60d65f 100644 --- a/kernel/pm.c +++ b/kernel/pm.c @@ -87,21 +87,27 @@ void pm_unregister_all(pm_callback callback) } /* - * Send request to an individual device + * Send request to a single device */ -static int pm_send(struct pm_dev *dev, pm_request_t rqst, void *data) +int pm_send(struct pm_dev *dev, pm_request_t rqst, void *data) { int status = 0; - int next_state; + int prev_state, next_state; switch (rqst) { case PM_SUSPEND: case PM_RESUME: + prev_state = dev->state; next_state = (int) data; - if (dev->state != next_state) { + if (prev_state != next_state) { if (dev->callback) status = (*dev->callback)(dev, rqst, data); - if (!status) + if (!status) { dev->state = next_state; + dev->prev_state = prev_state; + } + } + else { + dev->prev_state = prev_state; } break; default: @@ -115,13 +121,19 @@ static int pm_send(struct pm_dev *dev, pm_request_t rqst, void *data) /* * Undo incomplete request */ -static void pm_undo_request(struct pm_dev *last, pm_request_t undo, void *data) +static void pm_undo_all(struct pm_dev *last) { struct list_head *entry = last->entry.prev; while (entry != &pm_devs) { struct pm_dev *dev = list_entry(entry, struct pm_dev, entry); - if (dev->callback) - pm_send(dev, undo, data); + if (dev->state != dev->prev_state) { + /* previous state was zero (running) resume or + * previous state was non-zero (suspended) suspend + */ + pm_request_t undo = (dev->prev_state + ? PM_SUSPEND:PM_RESUME); + pm_send(dev, undo, (void*) dev->prev_state); + } entry = entry->prev; } } @@ -129,7 +141,7 @@ static void pm_undo_request(struct pm_dev *last, pm_request_t undo, void *data) /* * Send a request to all devices */ -int pm_send_request(pm_request_t rqst, void *data) +int pm_send_all(pm_request_t rqst, void *data) { struct list_head *entry = pm_devs.next; while (entry != &pm_devs) { @@ -137,9 +149,11 @@ int pm_send_request(pm_request_t rqst, void *data) if (dev->callback) { int status = pm_send(dev, rqst, data); if (status) { - /* resume devices on failed suspend request */ + /* return devices to previous state on + * failed suspend request + */ if (rqst == PM_SUSPEND) - pm_undo_request(dev, PM_RESUME, 0); + pm_undo_all(dev); return status; } } @@ -166,6 +180,7 @@ struct pm_dev *pm_find(pm_dev_t type, struct pm_dev *from) EXPORT_SYMBOL(pm_register); EXPORT_SYMBOL(pm_unregister); EXPORT_SYMBOL(pm_unregister_all); -EXPORT_SYMBOL(pm_send_request); +EXPORT_SYMBOL(pm_send); +EXPORT_SYMBOL(pm_send_all); EXPORT_SYMBOL(pm_find); EXPORT_SYMBOL(pm_active); diff --git a/kernel/sched.c b/kernel/sched.c index 1ccc6826c..bec8a4494 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -497,17 +497,15 @@ repeat_schedule: c = -1000; if (prev->state == TASK_RUNNING) goto still_running; -still_running_back: - tmp = runqueue_head.next; - while (tmp != &runqueue_head) { +still_running_back: + list_for_each(tmp, &runqueue_head) { p = list_entry(tmp, struct task_struct, run_list); if (can_schedule(p)) { int weight = goodness(p, this_cpu, prev->active_mm); if (weight > c) c = weight, next = p; } - tmp = tmp->next; } /* Do we need to re-calculate counters? */ @@ -658,13 +656,10 @@ static inline void __wake_up_common(wait_queue_head_t *q, unsigned int mode, con if (!head->next || !head->prev) WQ_BUG(); #endif - tmp = head->next; - while (tmp != head) { + list_for_each(tmp, head) { unsigned int state; wait_queue_t *curr = list_entry(tmp, wait_queue_t, task_list); - tmp = tmp->next; - #if WAITQUEUE_DEBUG CHECK_MAGIC(curr->__magic); #endif diff --git a/kernel/sys.c b/kernel/sys.c index e3f7c5e2b..550df4db9 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -226,8 +226,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, int cmd, void * arg) default: unlock_kernel(); return -EINVAL; - break; - }; + } unlock_kernel(); return 0; } @@ -1049,6 +1048,22 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, } current->dumpable = arg2; break; + case PR_SET_UNALIGN: +#ifdef SET_UNALIGN_CTL + error = SET_UNALIGN_CTL(current, arg2); +#else + error = -EINVAL; +#endif + break; + + case PR_GET_UNALIGN: +#ifdef GET_UNALIGN_CTL + error = GET_UNALIGN_CTL(current, arg2); +#else + error = -EINVAL; +#endif + break; + default: error = -EINVAL; break; diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 9a6a7a74d..efcda3de4 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -12,6 +12,8 @@ * Horn. * Added proc_doulongvec_ms_jiffies_minmax, 09/08/99, Carlos H. Bauer. * Added proc_doulongvec_minmax, 09/08/99, Carlos H. Bauer. + * Changed linked lists to use list.h instead of lists.h, 02/24/00, Bill + * Wendling. */ #include <linux/config.h> @@ -86,8 +88,7 @@ static int proc_doutsstring(ctl_table *table, int write, struct file *filp, static ctl_table root_table[]; -static struct ctl_table_header root_table_header = - {root_table, DNODE_SINGLE(&root_table_header)}; +static LIST_HEAD(root_table_header); static ctl_table kern_table[]; static ctl_table vm_table[]; @@ -115,23 +116,9 @@ struct file_operations proc_sys_file_operations = write: proc_writesys, }; -struct inode_operations proc_sys_inode_operations = +static struct inode_operations proc_sys_inode_operations = { - &proc_sys_file_operations, - NULL, /* create */ - NULL, /* lookup */ - NULL, /* link */ - NULL, /* unlink */ - NULL, /* symlink */ - NULL, /* mkdir */ - NULL, /* rmdir */ - NULL, /* mknod */ - NULL, /* rename */ - NULL, /* readlink */ - NULL, /* follow_link */ - NULL, /* truncate */ - proc_sys_permission, /* permission */ - NULL /* revalidate */ + permission: proc_sys_permission, }; extern struct proc_dir_entry *proc_sys_root; @@ -305,21 +292,23 @@ static ctl_table dev_table[] = { {0} }; +extern void init_irq_proc (void); void __init sysctl_init(void) { #ifdef CONFIG_PROC_FS register_proc_table(root_table, proc_sys_root); + init_irq_proc(); #endif -} +} int do_sysctl (int *name, int nlen, void *oldval, size_t *oldlenp, void *newval, size_t newlen) { int error; - struct ctl_table_header *tmp; + struct list_head *tmp; void *context; if (nlen == 0 || nlen >= CTL_MAXNAME) @@ -333,17 +322,17 @@ int do_sysctl (int *name, int nlen, if(get_user(old_len, oldlenp)) return -EFAULT; } - tmp = &root_table_header; - do { + list_for_each(tmp, &root_table_header) { + struct ctl_table_header *head = + list_entry(tmp, struct ctl_table_header, ctl_entry); context = NULL; error = parse_table(name, nlen, oldval, oldlenp, - newval, newlen, tmp->ctl_table, &context); + newval, newlen, head->ctl_table, &context); if (context) kfree(context); if (error != -ENOTDIR) return error; - tmp = tmp->DLIST_NEXT(ctl_entry); - } while (tmp != &root_table_header); + } return -ENOTDIR; } @@ -438,7 +427,7 @@ repeat: newval, newlen, context); return error; } - }; + } return -ENOTDIR; } @@ -495,14 +484,15 @@ struct ctl_table_header *register_sysctl_table(ctl_table * table, int insert_at_head) { struct ctl_table_header *tmp; - tmp = kmalloc(sizeof(*tmp), GFP_KERNEL); + tmp = kmalloc(sizeof(struct ctl_table_header), GFP_KERNEL); if (!tmp) return 0; - *tmp = ((struct ctl_table_header) {table, DNODE_NULL}); + tmp->ctl_table = table; + INIT_LIST_HEAD(&tmp->ctl_entry); if (insert_at_head) - DLIST_INSERT_AFTER(&root_table_header, tmp, ctl_entry); + list_add(&tmp->ctl_entry, &root_table_header); else - DLIST_INSERT_BEFORE(&root_table_header, tmp, ctl_entry); + list_add_tail(&tmp->ctl_entry, &root_table_header); #ifdef CONFIG_PROC_FS register_proc_table(table, proc_sys_root); #endif @@ -514,7 +504,7 @@ struct ctl_table_header *register_sysctl_table(ctl_table * table, */ void unregister_sysctl_table(struct ctl_table_header * header) { - DLIST_DELETE(header, ctl_entry); + list_del(&header->ctl_entry); #ifdef CONFIG_PROC_FS unregister_proc_table(header->ctl_table, proc_sys_root); #endif @@ -565,9 +555,10 @@ static void register_proc_table(ctl_table * table, struct proc_dir_entry *root) if (!de) continue; de->data = (void *) table; - if (table->proc_handler) - de->ops = &proc_sys_inode_operations; - + if (table->proc_handler) { + de->proc_fops = &proc_sys_file_operations; + de->proc_iops = &proc_sys_inode_operations; + } } table->de = de; if (de->mode & S_IFDIR) |