diff options
| author | Matt Fleming <matt.fleming@intel.com> | 2013-09-30 13:22:36 +0100 |
|---|---|---|
| committer | Matt Fleming <matt.fleming@intel.com> | 2013-09-30 13:33:26 +0100 |
| commit | 47179ebc03dcb3177312d97cd912605704c40686 (patch) | |
| tree | e766d15f3153fcabfccbb5e4a6e318d6c7c50478 /core/include | |
| parent | 3e86c0e35b96fef58dbfbb96e3ef509ea4047d2e (diff) | |
| parent | 2fe3a7bdd20d6fada21bd455a902c2b02f46a02d (diff) | |
| download | syslinux-47179ebc03dcb3177312d97cd912605704c40686.tar.gz | |
Merge branch 'elflink-pxe-fixes-for-mfleming-2' of git://github.com/geneC/syslinux into firmware
Pull various network stack fixes from Gene Cumm and adapt to the 6.xx
core_udp_* API,
* 'elflink-pxe-fixes-for-mfleming-2' of git://github.com/geneC/syslinux:
PXE ISR: Force polling on select hardware WORKAROUND
core/lwip: Fix NULL pointer check
PXE: use ddprintf macro
com32: Define ddprintf() macro
PXELINUX: specify PXE/lwIP
undiif: show thread of execution on UNDIIF_ID_DEBUG
core: dprintf() the banner.
PXELINUX: Use sendto() instead of connect()/send()/disconnect()
core: make mbox_post()/__sem_down_slow() check if valid
core: mbox/semaphore NULL checks
core/lwip/undi: Improve UNDIIF_ID_DEBUG messages
Conflicts:
core/fs/pxe/pxe.c
core/fs/pxe/tftp.c
core/init.c
Diffstat (limited to 'core/include')
| -rw-r--r-- | core/include/mbox.h | 5 | ||||
| -rw-r--r-- | core/include/net.h | 3 | ||||
| -rw-r--r-- | core/include/thread.h | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/core/include/mbox.h b/core/include/mbox.h index 3c35ce4e..6fec267c 100644 --- a/core/include/mbox.h +++ b/core/include/mbox.h @@ -45,7 +45,8 @@ mstime_t mbox_fetch(struct mailbox *mbox, void **msg, mstime_t timeout); */ static inline void mbox_set_invalid(struct mailbox *mbox) { - sem_set_invalid(&mbox->prod_sem); + if (!!mbox) + sem_set_invalid(&mbox->prod_sem); } /* @@ -53,7 +54,7 @@ static inline void mbox_set_invalid(struct mailbox *mbox) */ static inline bool mbox_is_valid(struct mailbox *mbox) { - return sem_is_valid(&mbox->prod_sem); + return ((!!mbox) && sem_is_valid(&mbox->prod_sem)); } #endif /* _MBOX_H */ diff --git a/core/include/net.h b/core/include/net.h index a5dcd724..c64191d8 100644 --- a/core/include/net.h +++ b/core/include/net.h @@ -23,6 +23,9 @@ int core_udp_recv(struct pxe_pvt_inode *socket, void *buf, uint16_t *buf_len, void core_udp_send(struct pxe_pvt_inode *socket, const void *data, size_t len); +void core_udp_sendto(struct pxe_pvt_inode *socket, const void *data, size_t len, + uint32_t ip, uint16_t port); + void probe_undi(void); void pxe_init_isr(void); diff --git a/core/include/thread.h b/core/include/thread.h index 6bfdfaa7..8ec4a267 100644 --- a/core/include/thread.h +++ b/core/include/thread.h @@ -93,7 +93,8 @@ void sem_init(struct semaphore *, int); */ static inline void sem_set_invalid(struct semaphore *sem) { - sem->list.next = NULL; + if (!!sem) + sem->list.next = NULL; } /* @@ -101,7 +102,7 @@ static inline void sem_set_invalid(struct semaphore *sem) */ static inline bool sem_is_valid(struct semaphore *sem) { - return !!sem->list.next; + return ((!!sem) && (!!sem->list.next)); } struct thread *start_thread(const char *name, size_t stack_size, int prio, |
