patches 149{2,3,4} from Marc

This commit is contained in:
jani 2003-05-19 14:45:02 +00:00
parent daa6d0fa51
commit cab5828518
4 changed files with 10 additions and 11 deletions

View File

@ -111,7 +111,7 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **data, u32_t timeout)
end_time = cyg_current_time();
if (d == NULL)
return 0xffffffff;
return SYS_ARCH_TIMEOUT;
} else {
d = cyg_mbox_get(mbox);
}
@ -165,7 +165,7 @@ u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t timeout)
end_time = cyg_current_time();
if (r == false) {
return 0xffffffff;
return SYS_ARCH_TIMEOUT;
}
} else {
cyg_semaphore_wait(sem);

View File

@ -82,7 +82,7 @@ send_data(struct tcp_pcb *pcb, struct http_state *hs)
err_t err;
u16_t len;
/* We cannot send more data than space avaliable in the send
/* We cannot send more data than space available in the send
buffer. */
if(tcp_sndbuf(pcb) < hs->left) {
len = tcp_sndbuf(pcb);

View File

@ -265,9 +265,8 @@ sys_arch_mbox_fetch(struct sys_mbox *mbox, void **msg, u32_t timeout)
if (timeout != 0) {
time = sys_arch_sem_wait(mbox->mail, timeout);
/* If time == 0, the sem_wait timed out, and we return 0. */
if (time == 0xffffffff) {
return 0xffffffff;
if (time == SYS_ARCH_TIMEOUT) {
return SYS_ARCH_TIMEOUT;
}
} else {
sys_arch_sem_wait(mbox->mail, 0);
@ -345,7 +344,7 @@ cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex, u32_t timeout)
retval = pthread_cond_timedwait(cond, mutex, &ts);
if (retval == ETIMEDOUT) {
return 0xffffffff;
return SYS_ARCH_TIMEOUT;
} else {
/* Calculate for how long we waited for the cond. */
gettimeofday(&rtime2, &tz);
@ -360,7 +359,7 @@ cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex, u32_t timeout)
}
} else {
pthread_cond_wait(cond, mutex);
return 0xffffffff;
return SYS_ARCH_TIMEOUT;
}
}
/*-----------------------------------------------------------------------------------*/
@ -374,9 +373,9 @@ sys_arch_sem_wait(struct sys_sem *sem, u32_t timeout)
if (timeout > 0) {
time = cond_wait(&(sem->cond), &(sem->mutex), timeout);
if (time == 0xffffffff) {
if (time == SYS_ARCH_TIMEOUT) {
pthread_mutex_unlock(&(sem->mutex));
return 0xffffffff;
return SYS_ARCH_TIMEOUT;
}
/* pthread_mutex_unlock(&(sem->mutex));
return time; */

View File

@ -356,7 +356,7 @@ static struct pbuf * low_level_input(struct xemacif *xemacif_ptr)
* read the entire packet into the pbuf. */
for(q = p; q != NULL; q = q->next) {
/* Read enough bytes to fill this pbuf
* in the chain. The avaliable data in
* in the chain. The available data in
* the pbuf is given by the q->len variable. */
for (i = 0 ; i < q->len ; i++) {
((u8_t *)q->payload)[i] = *(frame_bytes++);