mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-23 09:34:42 +08:00
C++ compatibility for some kernel-space headers
This commit is contained in:
parent
0dbc4e269b
commit
c352e6979d
@ -152,7 +152,7 @@ ck_stack_batch_pop_upmc(struct ck_stack *target)
|
|||||||
{
|
{
|
||||||
struct ck_stack_entry *entry;
|
struct ck_stack_entry *entry;
|
||||||
|
|
||||||
entry = ck_pr_fas_ptr(&target->head, NULL);
|
entry = (struct ck_stack_entry *)ck_pr_fas_ptr(&target->head, NULL);
|
||||||
ck_pr_fence_load();
|
ck_pr_fence_load();
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
@ -276,7 +276,7 @@ ck_stack_push_mpnc(struct ck_stack *target, struct ck_stack_entry *entry)
|
|||||||
|
|
||||||
entry->next = NULL;
|
entry->next = NULL;
|
||||||
ck_pr_fence_store_atomic();
|
ck_pr_fence_store_atomic();
|
||||||
stack = ck_pr_fas_ptr(&target->head, entry);
|
stack = (struct ck_stack_entry *)ck_pr_fas_ptr(&target->head, entry);
|
||||||
ck_pr_store_ptr(&entry->next, stack);
|
ck_pr_store_ptr(&entry->next, stack);
|
||||||
ck_pr_fence_store();
|
ck_pr_fence_store();
|
||||||
|
|
||||||
|
@ -336,7 +336,7 @@ drbr_enqueue(struct ifnet *ifp, struct buf_ring *br, struct mbuf *m)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static __inline void
|
static __inline void
|
||||||
drbr_putback(struct ifnet *ifp, struct buf_ring *br, struct mbuf *new)
|
drbr_putback(struct ifnet *ifp, struct buf_ring *br, struct mbuf *m)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* The top of the list needs to be swapped
|
* The top of the list needs to be swapped
|
||||||
@ -348,11 +348,11 @@ drbr_putback(struct ifnet *ifp, struct buf_ring *br, struct mbuf *new)
|
|||||||
* Peek in altq case dequeued it
|
* Peek in altq case dequeued it
|
||||||
* so put it back.
|
* so put it back.
|
||||||
*/
|
*/
|
||||||
IFQ_DRV_PREPEND(&ifp->if_snd, new);
|
IFQ_DRV_PREPEND(&ifp->if_snd, m);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
buf_ring_putback_sc(br, new);
|
buf_ring_putback_sc(br, m);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline struct mbuf *
|
static __inline struct mbuf *
|
||||||
@ -371,7 +371,7 @@ drbr_peek(struct ifnet *ifp, struct buf_ring *br)
|
|||||||
return (m);
|
return (m);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return(buf_ring_peek_clear_sc(br));
|
return ((struct mbuf *)buf_ring_peek_clear_sc(br));
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void
|
static __inline void
|
||||||
@ -383,7 +383,7 @@ drbr_flush(struct ifnet *ifp, struct buf_ring *br)
|
|||||||
if (ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd))
|
if (ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd))
|
||||||
IFQ_PURGE(&ifp->if_snd);
|
IFQ_PURGE(&ifp->if_snd);
|
||||||
#endif
|
#endif
|
||||||
while ((m = buf_ring_dequeue_sc(br)) != NULL)
|
while ((m = (struct mbuf *)buf_ring_dequeue_sc(br)) != NULL)
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,7 +406,7 @@ drbr_dequeue(struct ifnet *ifp, struct buf_ring *br)
|
|||||||
return (m);
|
return (m);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return (buf_ring_dequeue_sc(br));
|
return ((struct mbuf *)buf_ring_dequeue_sc(br));
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline void
|
static __inline void
|
||||||
@ -439,11 +439,11 @@ drbr_dequeue_cond(struct ifnet *ifp, struct buf_ring *br,
|
|||||||
return (m);
|
return (m);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
m = buf_ring_peek(br);
|
m = (struct mbuf *)buf_ring_peek(br);
|
||||||
if (m == NULL || func(m, arg) == 0)
|
if (m == NULL || func(m, arg) == 0)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
return (buf_ring_dequeue_sc(br));
|
return ((struct mbuf *)buf_ring_dequeue_sc(br));
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline int
|
static __inline int
|
||||||
|
@ -776,7 +776,7 @@ m_get(int how, short type)
|
|||||||
|
|
||||||
args.flags = 0;
|
args.flags = 0;
|
||||||
args.type = type;
|
args.type = type;
|
||||||
m = uma_zalloc_arg(zone_mbuf, &args, how);
|
m = (struct mbuf *)uma_zalloc_arg(zone_mbuf, &args, how);
|
||||||
MBUF_PROBE3(m__get, how, type, m);
|
MBUF_PROBE3(m__get, how, type, m);
|
||||||
return (m);
|
return (m);
|
||||||
}
|
}
|
||||||
@ -789,7 +789,7 @@ m_gethdr(int how, short type)
|
|||||||
|
|
||||||
args.flags = M_PKTHDR;
|
args.flags = M_PKTHDR;
|
||||||
args.type = type;
|
args.type = type;
|
||||||
m = uma_zalloc_arg(zone_mbuf, &args, how);
|
m = (struct mbuf *)uma_zalloc_arg(zone_mbuf, &args, how);
|
||||||
MBUF_PROBE3(m__gethdr, how, type, m);
|
MBUF_PROBE3(m__gethdr, how, type, m);
|
||||||
return (m);
|
return (m);
|
||||||
}
|
}
|
||||||
@ -802,7 +802,7 @@ m_getcl(int how, short type, int flags)
|
|||||||
|
|
||||||
args.flags = flags;
|
args.flags = flags;
|
||||||
args.type = type;
|
args.type = type;
|
||||||
m = uma_zalloc_arg(zone_pack, &args, how);
|
m = (struct mbuf *)uma_zalloc_arg(zone_pack, &args, how);
|
||||||
MBUF_PROBE4(m__getcl, how, type, flags, m);
|
MBUF_PROBE4(m__getcl, how, type, flags, m);
|
||||||
return (m);
|
return (m);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user