Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83199
b: refs/heads/master
c: bf8fde7
h: refs/heads/master
i:
  83197: 8228591
  83195: abd9529
  83191: 2b3c4e9
  83183: bd36881
  83167: b54e5e8
  83135: 546cc6d
  83071: 6fc1dad
  82943: 2f1e9e6
v: v3
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Feb 5, 2008
1 parent 4500183 commit c9fbca1
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 41 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b5cc6ee6cf9001775c348bac09814a45f1276b7
refs/heads/master: bf8fde785b872282e7e86d9ea8a9c4e543985bb3
1 change: 0 additions & 1 deletion trunk/arch/um/include/irq_user.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ struct irq_fd {
int fd;
int type;
int irq;
int pid;
int events;
int current_events;
};
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/um/include/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ static inline struct openflags of_cloexec(struct openflags flags)
extern int os_stat_file(const char *file_name, struct uml_stat *buf);
extern int os_stat_fd(const int fd, struct uml_stat *buf);
extern int os_access(const char *file, int mode);
extern int os_get_exec_close(int fd, int *close_on_exec);
extern int os_set_exec_close(int fd);
extern int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg);
extern int os_get_ifname(int fd, char *namebuf);
Expand All @@ -142,7 +141,7 @@ extern int os_write_file(int fd, const void *buf, int count);
extern int os_file_size(const char *file, unsigned long long *size_out);
extern int os_file_modtime(const char *file, unsigned long *modtime);
extern int os_pipe(int *fd, int stream, int close_on_exec);
extern int os_set_fd_async(int fd, int owner);
extern int os_set_fd_async(int fd);
extern int os_clear_fd_async(int fd);
extern int os_set_fd_block(int fd, int blocking);
extern int os_accept_connection(int fd);
Expand Down
6 changes: 2 additions & 4 deletions trunk/arch/um/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,9 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
struct pollfd *tmp_pfd;
struct irq_fd *new_fd, *irq_fd;
unsigned long flags;
int pid, events, err, n;
int events, err, n;

pid = os_getpid();
err = os_set_fd_async(fd, pid);
err = os_set_fd_async(fd);
if (err < 0)
goto out;

Expand All @@ -127,7 +126,6 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
.fd = fd,
.type = type,
.irq = irq,
.pid = pid,
.events = events,
.current_events = 0 } );

Expand Down
1 change: 0 additions & 1 deletion trunk/arch/um/kernel/ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ EXPORT_SYMBOL(uml_strdup);
EXPORT_SYMBOL(os_stat_fd);
EXPORT_SYMBOL(os_stat_file);
EXPORT_SYMBOL(os_access);
EXPORT_SYMBOL(os_get_exec_close);
EXPORT_SYMBOL(os_set_exec_close);
EXPORT_SYMBOL(os_getpid);
EXPORT_SYMBOL(os_open_file);
Expand Down
6 changes: 2 additions & 4 deletions trunk/arch/um/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ static int idle_proc(void *cpup)
if (err < 0)
panic("CPU#%d failed to create IPI pipe, err = %d", cpu, -err);

os_set_fd_async(cpu_data[cpu].ipi_pipe[0],
current->thread.mode.tt.extern_pid);
os_set_fd_async(cpu_data[cpu].ipi_pipe[0]);

wmb();
if (cpu_test_and_set(cpu, cpu_callin_map)) {
Expand Down Expand Up @@ -128,8 +127,7 @@ void smp_prepare_cpus(unsigned int maxcpus)
if (err < 0)
panic("CPU#0 failed to create IPI pipe, errno = %d", -err);

os_set_fd_async(cpu_data[me].ipi_pipe[0],
current->thread.mode.tt.extern_pid);
os_set_fd_async(cpu_data[me].ipi_pipe[0]);

for (cpu = 1; cpu < ncpus; cpu++) {
printk(KERN_INFO "Booting processor %d...\n", cpu);
Expand Down
38 changes: 11 additions & 27 deletions trunk/arch/um/os-Linux/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,19 +328,6 @@ int os_file_modtime(const char *file, unsigned long *modtime)
return 0;
}

int os_get_exec_close(int fd, int *close_on_exec)
{
int ret;

CATCH_EINTR(ret = fcntl(fd, F_GETFD));

if(ret < 0)
return -errno;

*close_on_exec = (ret & FD_CLOEXEC) ? 1 : 0;
return ret;
}

int os_set_exec_close(int fd)
{
int err;
Expand Down Expand Up @@ -380,30 +367,27 @@ int os_pipe(int *fds, int stream, int close_on_exec)
return err;
}

int os_set_fd_async(int fd, int owner)
int os_set_fd_async(int fd)
{
int err;
int err, flags;

flags = fcntl(fd, F_GETFL);
if (flags < 0)
return -errno;

/* XXX This should do F_GETFL first */
if(fcntl(fd, F_SETFL, O_ASYNC | O_NONBLOCK) < 0){
flags |= O_ASYNC | O_NONBLOCK;
if (fcntl(fd, F_SETFL, flags) < 0) {
err = -errno;
printk("os_set_fd_async : failed to set O_ASYNC and "
"O_NONBLOCK on fd # %d, errno = %d\n", fd, errno);
return err;
}
#ifdef notdef
if(fcntl(fd, F_SETFD, 1) < 0){
printk("os_set_fd_async : Setting FD_CLOEXEC failed, "
"errno = %d\n", errno);
}
#endif

if((fcntl(fd, F_SETSIG, SIGIO) < 0) ||
(fcntl(fd, F_SETOWN, owner) < 0)){
if ((fcntl(fd, F_SETSIG, SIGIO) < 0) ||
(fcntl(fd, F_SETOWN, os_getpid()) < 0)) {
err = -errno;
printk("os_set_fd_async : Failed to fcntl F_SETOWN "
"(or F_SETSIG) fd %d to pid %d, errno = %d\n", fd,
owner, errno);
"(or F_SETSIG) fd %d, errno = %d\n", fd, errno);
return err;
}

Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/um/os-Linux/start_up.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ static int ptrace_child(void)
* the UML code itself.
*/
ret = 2;
_exit(ret);

exit(ret);
}

static void fatal_perror(const char *str)
Expand Down

0 comments on commit c9fbca1

Please sign in to comment.