net: buf: Use new API for checking if executing from ISR

CC      net/buf.o
zephyr/net/buf.c: In function 'net_buf_get':
zephyr/net/buf.c:103:2: warning: 'sys_execution_context_type_get' is
     deprecated [-Wdeprecated-declarations]
  if (buf || sys_execution_context_type_get() == NANO_CTX_ISR) {
  ^

Change-Id: I580469d4958451cfa05f56c579eae340ec003a3d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
Szymon Janc 2016-11-10 10:45:17 +01:00 committed by Johan Hedberg
parent 619d7bafd9
commit 0a38788c92
3 changed files with 5 additions and 5 deletions

View file

@ -102,7 +102,7 @@ struct net_buf *net_buf_get(struct nano_fifo *fifo, size_t reserve_head)
NET_BUF_DBG("fifo %p reserve %u", fifo, reserve_head);
buf = net_buf_get_timeout(fifo, reserve_head, TICKS_NONE);
if (buf || sys_execution_context_type_get() == NANO_CTX_ISR) {
if (buf || k_is_in_isr()) {
return buf;
}

View file

@ -21,9 +21,9 @@
void nano_fifo_init(struct nano_fifo *fifo) {}
void nano_fifo_put_list(struct nano_fifo *fifo, void *head, void *tail) {}
nano_context_type_t sys_execution_context_type_get(void)
int k_is_in_isr(void)
{
return NANO_CTX_FIBER;
return 0;
}
void *nano_fifo_get(struct nano_fifo *fifo, int32_t timeout)

View file

@ -21,9 +21,9 @@
void nano_fifo_init(struct nano_fifo *fifo) {}
void nano_fifo_put_list(struct nano_fifo *fifo, void *head, void *tail) {}
nano_context_type_t sys_execution_context_type_get(void)
int k_is_in_isr(void)
{
return NANO_CTX_FIBER;
return 0;
}
void *nano_fifo_get(struct nano_fifo *fifo, int32_t timeout)