A little more clean-up of poll() error handling
This commit is contained in:
parent
a05107e7fe
commit
79eeb9f1b5
2 changed files with 19 additions and 19 deletions
|
|
@ -69,18 +69,18 @@
|
|||
|
||||
.type gdt_flush, @function
|
||||
gdt_flush:
|
||||
movl %eax, 4(%esp) /* Get the pointer to the GDT, passed as a parameter */
|
||||
lgdt (%eax) /* Load the new GDT pointer */
|
||||
movl %eax, 4(%esp) /* Get the pointer to the GDT, passed as a parameter */
|
||||
lgdt (%eax) /* Load the new GDT pointer */
|
||||
|
||||
mov $KSEG, %ax /* KSEG is the offset in the GDT to our data segment */
|
||||
mov %ax, %ds /* Load all data segment selectors */
|
||||
mov %ax, %es
|
||||
mov %ax, %fs
|
||||
mov %ax, %gs
|
||||
mov %ax, %ss
|
||||
jmp $0x08, $.Lgflush /* 0x08 is the offset to our code segment: Far jump! */
|
||||
mov $KSEG, %ax /* KSEG is the offset in the GDT to our data segment */
|
||||
mov %ax, %ds /* Load all data segment selectors */
|
||||
mov %ax, %es
|
||||
mov %ax, %fs
|
||||
mov %ax, %gs
|
||||
mov %ax, %ss
|
||||
jmp $0x08, $.Lgflush /* 0x08 is the offset to our code segment: Far jump! */
|
||||
.Lgflush:
|
||||
ret
|
||||
ret
|
||||
.size gdt_flush, . - gdt_flush
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -89,8 +89,8 @@ gdt_flush:
|
|||
|
||||
.type idt_flush, @function
|
||||
idt_flush:
|
||||
movl %eax, 4(%esp) /* Get the pointer to the IDT, passed as a parameter */
|
||||
lidt (%eax) /* Load the IDT pointer */
|
||||
ret
|
||||
movl %eax, 4(%esp) /* Get the pointer to the IDT, passed as a parameter */
|
||||
lidt (%eax) /* Load the IDT pointer */
|
||||
ret
|
||||
.size idt_flush, . - idt_flush
|
||||
.end
|
||||
|
|
|
|||
12
fs/fs_poll.c
12
fs/fs_poll.c
|
|
@ -267,9 +267,9 @@ static inline int poll_teardown(FAR struct pollfd *fds, nfds_t nfds, int *count)
|
|||
* A value of 0 indicates that the call timed out and no file descriptors
|
||||
* were ready. On error, -1 is returned, and errno is set appropriately:
|
||||
*
|
||||
* EBADF - An invalid file descriptor was given in one of the sets.
|
||||
* EBADF - An invalid file descriptor was given in one of the sets.
|
||||
* EFAULT - The fds address is invalid
|
||||
* EINTR - A signal occurred before any requested event.
|
||||
* EINTR - A signal occurred before any requested event.
|
||||
* EINVAL - The nfds value exceeds a system limit.
|
||||
* ENOMEM - There was no space to allocate internal data structures.
|
||||
* ENOSYS - One or more of the drivers supporting the file descriptor
|
||||
|
|
@ -292,8 +292,6 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
|
|||
if (timeout == 0)
|
||||
{
|
||||
/* Poll returns immediately whether we have a poll event or not. */
|
||||
|
||||
ret = sem_trywait(&sem);
|
||||
}
|
||||
else if (timeout > 0)
|
||||
{
|
||||
|
|
@ -326,7 +324,7 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
|
|||
abstime.tv_nsec -= NSEC_PER_SEC;
|
||||
}
|
||||
|
||||
ret = sem_timedwait(&sem, &abstime);
|
||||
(void)sem_timedwait(&sem, &abstime);
|
||||
irqrestore(flags);
|
||||
}
|
||||
else
|
||||
|
|
@ -336,7 +334,9 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
|
|||
poll_semtake(&sem);
|
||||
}
|
||||
|
||||
/* Teardown the poll operation and get the count of events */
|
||||
/* Teardown the poll operation and get the count of events. Zero will be
|
||||
* returned in the case of a timeout.
|
||||
*/
|
||||
|
||||
ret = poll_teardown(fds, nfds, &count);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue