mirror of https://github.com/F-Stack/f-stack.git
fix some issues.
This commit is contained in:
parent
e7b7fb6cc9
commit
63f0426fdf
|
@ -80,9 +80,11 @@ int64_t counter_ratecheck(struct counter_rate *, int64_t);
|
|||
SYSUNINIT(c##_counter_sysuninit, SI_SUB_COUNTER, \
|
||||
SI_ORDER_ANY, counter_u64_sysuninit, &c)
|
||||
|
||||
#ifndef FSTACK
|
||||
#define COUNTER_U64_DEFINE_EARLY(c) \
|
||||
counter_u64_t __read_mostly c = EARLY_COUNTER; \
|
||||
COUNTER_U64_SYSINIT(c)
|
||||
#endif
|
||||
|
||||
void counter_u64_sysinit(void *);
|
||||
void counter_u64_sysuninit(void *);
|
||||
|
|
|
@ -96,6 +96,7 @@ ff_freebsd_init(void)
|
|||
|
||||
pcpup = malloc(sizeof(struct pcpu), M_DEVBUF, M_ZERO);
|
||||
pcpu_init(pcpup, 0, sizeof(struct pcpu));
|
||||
PCPU_SET(prvspace, pcpup);
|
||||
CPU_SET(0, &all_cpus);
|
||||
|
||||
ff_init_thread0();
|
||||
|
|
|
@ -29,7 +29,11 @@
|
|||
|
||||
#include <sys/pcpu.h>
|
||||
|
||||
#define EARLY_COUNTER (void *)__offsetof(struct pcpu, pc_early_dummy_counter)
|
||||
#define EARLY_COUNTER &pcpup->pc_early_dummy_counter
|
||||
|
||||
#define COUNTER_U64_DEFINE_EARLY(c) \
|
||||
counter_u64_t __read_mostly c = (void *)__offsetof(struct pcpu, pc_early_dummy_counter); \
|
||||
COUNTER_U64_SYSINIT(c)
|
||||
|
||||
#define counter_enter() do {} while (0)
|
||||
#define counter_exit() do {} while (0)
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include_next <machine/pcpu.h>
|
||||
|
||||
#undef __curthread
|
||||
#undef get_pcpu
|
||||
#undef PCPU_GET
|
||||
#undef PCPU_ADD
|
||||
#undef PCPU_INC
|
||||
|
@ -40,6 +41,8 @@
|
|||
extern __thread struct thread *pcurthread;
|
||||
extern struct pcpu *pcpup;
|
||||
|
||||
#define get_pcpu() (pcpup->pc_ ## prvspace)
|
||||
|
||||
#define PCPU_GET(member) (pcpup->pc_ ## member)
|
||||
#define PCPU_ADD(member, val) (pcpup->pc_ ## member += (val))
|
||||
#define PCPU_INC(member) PCPU_ADD(member, 1)
|
||||
|
|
|
@ -51,6 +51,9 @@
|
|||
#undef mtx_destroy
|
||||
#undef mtx_owned
|
||||
|
||||
#undef DROP_GIANT
|
||||
#undef PICKUP_GIANT
|
||||
|
||||
#define DO_NOTHING do {} while(0)
|
||||
|
||||
#define __mtx_lock(mp, tid, opts, file, line) DO_NOTHING
|
||||
|
@ -81,4 +84,7 @@ void ff_mtx_init(struct lock_object *lo, const char *name, const char *type, int
|
|||
|
||||
#define mtx_owned(m) (1)
|
||||
|
||||
#define DROP_GIANT() DO_NOTHING
|
||||
#define PICKUP_GIANT() DO_NOTHING
|
||||
|
||||
#endif /* _FSTACK_SYS_MUTEX_H_ */
|
||||
|
|
Loading…
Reference in New Issue