diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-08-09 13:04:41 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-09-21 10:29:37 +0200 |
commit | e4a8065910cd6b2e7e0448cc6431ca2906322389 (patch) | |
tree | 73492991cfa40f994c20d761d476e6bc16304536 /freebsd/sys/sys | |
parent | Update to FreeBSD head 2017-08-01 (diff) | |
download | rtems-libbsd-e4a8065910cd6b2e7e0448cc6431ca2906322389.tar.bz2 |
Update to FreeBSD head 2017-10-01
Git mirror commit b2f0376b45428f13151d229c5ae9d4d8f74acbd1.
Update #3472.
Diffstat (limited to 'freebsd/sys/sys')
-rw-r--r-- | freebsd/sys/sys/_task.h | 3 | ||||
-rw-r--r-- | freebsd/sys/sys/blist.h | 6 | ||||
-rw-r--r-- | freebsd/sys/sys/buf.h | 22 | ||||
-rw-r--r-- | freebsd/sys/sys/conf.h | 11 | ||||
-rw-r--r-- | freebsd/sys/sys/gpio.h | 69 | ||||
-rw-r--r-- | freebsd/sys/sys/gtaskqueue.h | 18 | ||||
-rw-r--r-- | freebsd/sys/sys/kernel.h | 8 | ||||
-rw-r--r-- | freebsd/sys/sys/mbuf.h | 13 | ||||
-rw-r--r-- | freebsd/sys/sys/module.h | 6 | ||||
-rw-r--r-- | freebsd/sys/sys/mutex.h | 16 | ||||
-rw-r--r-- | freebsd/sys/sys/sbuf.h | 2 | ||||
-rw-r--r-- | freebsd/sys/sys/smp.h | 21 | ||||
-rw-r--r-- | freebsd/sys/sys/systm.h | 7 | ||||
-rw-r--r-- | freebsd/sys/sys/taskqueue.h | 4 | ||||
-rw-r--r-- | freebsd/sys/sys/vmmeter.h | 15 | ||||
-rw-r--r-- | freebsd/sys/sys/vnode.h | 2 |
16 files changed, 168 insertions, 55 deletions
diff --git a/freebsd/sys/sys/_task.h b/freebsd/sys/sys/_task.h index d3be7198..d46659f4 100644 --- a/freebsd/sys/sys/_task.h +++ b/freebsd/sys/sys/_task.h @@ -65,7 +65,8 @@ struct grouptask { void *gt_taskqueue; LIST_ENTRY(grouptask) gt_list; void *gt_uniq; - char *gt_name; +#define GROUPTASK_NAMELEN 32 + char gt_name[GROUPTASK_NAMELEN]; int16_t gt_irq; int16_t gt_cpu; }; diff --git a/freebsd/sys/sys/blist.h b/freebsd/sys/sys/blist.h index 292f9b97..486e04eb 100644 --- a/freebsd/sys/sys/blist.h +++ b/freebsd/sys/sys/blist.h @@ -80,8 +80,7 @@ typedef struct blmeta { typedef struct blist { daddr_t bl_blocks; /* area of coverage */ - daddr_t bl_radix; /* coverage radix */ - daddr_t bl_skip; /* starting skip */ + u_daddr_t bl_radix; /* coverage radix */ daddr_t bl_cursor; /* next-fit search starts at */ blmeta_t *bl_root; /* root of radix tree */ } *blist_t; @@ -91,6 +90,8 @@ typedef struct blist { #define BLIST_MAX_ALLOC BLIST_BMAP_RADIX +struct sbuf; + daddr_t blist_alloc(blist_t blist, daddr_t count); daddr_t blist_avail(blist_t blist); blist_t blist_create(daddr_t blocks, int flags); @@ -99,6 +100,7 @@ daddr_t blist_fill(blist_t bl, daddr_t blkno, daddr_t count); void blist_free(blist_t blist, daddr_t blkno, daddr_t count); void blist_print(blist_t blist); void blist_resize(blist_t *pblist, daddr_t count, int freenew, int flags); +void blist_stats(blist_t blist, struct sbuf *s); #endif /* _SYS_BLIST_H_ */ diff --git a/freebsd/sys/sys/buf.h b/freebsd/sys/sys/buf.h index 58bd91e3..5d4f0dc6 100644 --- a/freebsd/sys/sys/buf.h +++ b/freebsd/sys/sys/buf.h @@ -70,7 +70,7 @@ extern struct bio_ops { struct vm_object; struct vm_page; -typedef unsigned char b_xflags_t; +typedef uint32_t b_xflags_t; /* * The buffer header describes an I/O operation in the kernel. @@ -104,6 +104,8 @@ struct buf { off_t b_iooffset; long b_resid; void (*b_iodone)(struct buf *); + void (*b_ckhashcalc)(struct buf *); + uint64_t b_ckhash; /* B_CKHASH requested check-hash */ daddr_t b_blkno; /* Underlying physical block number. */ off_t b_offset; /* Offset into file. */ TAILQ_ENTRY(buf) b_bobufs; /* (V) Buffer's associated vnode. */ @@ -209,7 +211,7 @@ struct buf { #define B_CACHE 0x00000020 /* Bread found us in the cache. */ #define B_VALIDSUSPWRT 0x00000040 /* Valid write during suspension. */ #define B_DELWRI 0x00000080 /* Delay I/O until buffer reused. */ -#define B_00000100 0x00000100 /* Available flag. */ +#define B_CKHASH 0x00000100 /* checksum hash calculated on read */ #define B_DONE 0x00000200 /* I/O completed. */ #define B_EINTR 0x00000400 /* I/O was interrupted */ #define B_NOREUSE 0x00000800 /* Contents not reused once released. */ @@ -242,12 +244,17 @@ struct buf { /* * These flags are kept in b_xflags. + * + * BX_FSPRIV reserves a set of eight flags that may be used by individual + * filesystems for their own purpose. Their specific definitions are + * found in the header files for each filesystem that uses them. */ #define BX_VNDIRTY 0x00000001 /* On vnode dirty list */ #define BX_VNCLEAN 0x00000002 /* On vnode clean list */ #define BX_BKGRDWRITE 0x00000010 /* Do writes in background */ #define BX_BKGRDMARKER 0x00000020 /* Mark buffer for splay tree */ #define BX_ALTDATA 0x00000040 /* Holds extended data */ +#define BX_FSPRIV 0x00FF0000 /* filesystem-specific flags mask */ #define PRINT_BUF_XFLAGS "\20\7altdata\6bkgrdmarker\5bkgrdwrite\2clean\1dirty" @@ -467,6 +474,7 @@ buf_track(struct buf *bp, const char *location) #define GB_NOWAIT_BD 0x0004 /* Do not wait for bufdaemon. */ #define GB_UNMAPPED 0x0008 /* Do not mmap buffer pages. */ #define GB_KVAALLOC 0x0010 /* But allocate KVA. */ +#define GB_CKHASH 0x0020 /* If reading, calc checksum hash */ #ifdef _KERNEL extern int nbuf; /* The number of buffer headers */ @@ -504,15 +512,15 @@ int buf_dirty_count_severe(void); void bremfree(struct buf *); void bremfreef(struct buf *); /* XXX Force bremfree, only for nfs. */ #define bread(vp, blkno, size, cred, bpp) \ - breadn_flags(vp, blkno, size, NULL, NULL, 0, cred, 0, bpp) + breadn_flags(vp, blkno, size, NULL, NULL, 0, cred, 0, NULL, bpp) #define bread_gb(vp, blkno, size, cred, gbflags, bpp) \ breadn_flags(vp, blkno, size, NULL, NULL, 0, cred, \ - gbflags, bpp) + gbflags, NULL, bpp) #define breadn(vp, blkno, size, rablkno, rabsize, cnt, cred, bpp) \ - breadn_flags(vp, blkno, size, rablkno, rabsize, cnt, cred, 0, bpp) + breadn_flags(vp, blkno, size, rablkno, rabsize, cnt, cred, \ + 0, NULL, bpp) int breadn_flags(struct vnode *, daddr_t, int, daddr_t *, int *, int, - struct ucred *, int, struct buf **); -void breada(struct vnode *, daddr_t *, int *, int, struct ucred *); + struct ucred *, int, void (*)(struct buf *), struct buf **); void bdwrite(struct buf *); void bawrite(struct buf *); void babarrierwrite(struct buf *); diff --git a/freebsd/sys/sys/conf.h b/freebsd/sys/sys/conf.h index a49b6d60..8bf6a3ed 100644 --- a/freebsd/sys/sys/conf.h +++ b/freebsd/sys/sys/conf.h @@ -370,12 +370,13 @@ struct dumperinfo { int set_dumper(struct dumperinfo *di, const char *devname, struct thread *td, uint8_t encrypt, const uint8_t *key, uint32_t encryptedkeysize, const uint8_t *encryptedkey); +void dump_init_header(const struct dumperinfo *di, struct kerneldumpheader *kdh, + char *magic, uint32_t archver, uint64_t dumplen); +int dump_start(struct dumperinfo *di, struct kerneldumpheader *kdh, + off_t *dumplop); +int dump_finish(struct dumperinfo *di, struct kerneldumpheader *kdh, + off_t dumplo); int dump_write(struct dumperinfo *, void *, vm_offset_t, off_t, size_t); -int dump_write_pad(struct dumperinfo *, void *, vm_offset_t, off_t, size_t, - size_t *); -int dump_write_header(struct dumperinfo *di, struct kerneldumpheader *kdh, - vm_offset_t physical, off_t offset); -int dump_write_key(struct dumperinfo *di, vm_offset_t physical, off_t offset); int doadump(boolean_t); #ifndef __rtems__ extern int dumping; /* system is dumping */ diff --git a/freebsd/sys/sys/gpio.h b/freebsd/sys/sys/gpio.h index 9b0a1b55..dbe55872 100644 --- a/freebsd/sys/sys/gpio.h +++ b/freebsd/sys/sys/gpio.h @@ -70,6 +70,8 @@ #define GPIO_PIN_INVIN 0x00000080 /* invert input */ #define GPIO_PIN_INVOUT 0x00000100 /* invert output */ #define GPIO_PIN_PULSATE 0x00000200 /* pulsate in hardware */ +#define GPIO_PIN_PRESET_LOW 0x00000400 /* preset pin to high or */ +#define GPIO_PIN_PRESET_HIGH 0x00000800 /* low before enabling output */ /* GPIO interrupt capabilities */ #define GPIO_INTR_NONE 0x00000000 /* no interrupt support */ #define GPIO_INTR_LEVEL_LOW 0x00010000 /* level trigger, low */ @@ -95,6 +97,71 @@ struct gpio_req { }; /* + * gpio_access_32 / GPIOACCESS32 + * + * Simultaneously read and/or change up to 32 adjacent pins. + * If the device cannot change the pins simultaneously, returns EOPNOTSUPP. + * + * This accesses an adjacent set of up to 32 pins starting at first_pin within + * the device's collection of pins. How the hardware pins are mapped to the 32 + * bits in the arguments is device-specific. It is expected that lower-numbered + * pins in the device's number space map linearly to lower-ordered bits within + * the 32-bit words (i.e., bit 0 is first_pin, bit 1 is first_pin+1, etc). + * Other mappings are possible; know your device. + * + * Some devices may limit the value of first_pin to 0, or to multiples of 16 or + * 32 or some other hardware-specific number; to access pin 2 would require + * first_pin to be zero and then manipulate bit (1 << 2) in the 32-bit word. + * Invalid values in first_pin result in an EINVAL error return. + * + * The starting state of the pins is captured and stored in orig_pins, then the + * pins are set to ((starting_state & ~clear_pins) ^ change_pins). + * + * Clear Change Hardware pin after call + * 0 0 No change + * 0 1 Opposite of current value + * 1 0 Cleared + * 1 1 Set + */ +struct gpio_access_32 { + uint32_t first_pin; /* First pin in group of 32 adjacent */ + uint32_t clear_pins; /* Pins are changed using: */ + uint32_t change_pins; /* ((hwstate & ~clear_pins) ^ change_pins) */ + uint32_t orig_pins; /* Returned hwstate of pins before change. */ +}; + +/* + * gpio_config_32 / GPIOCONFIG32 + * + * Simultaneously configure up to 32 adjacent pins. This is intended to change + * the configuration of all the pins simultaneously, such that pins configured + * for output all begin to drive the configured values simultaneously, but not + * all hardware can do that, so the driver "does the best it can" in this + * regard. Notably unlike pin_access_32(), this does NOT fail if the pins + * cannot be atomically configured; it is expected that callers understand the + * hardware and have decided to live with any such limitations it may have. + * + * The pin_flags argument is an array of GPIO_PIN_xxxx flags. If the array + * contains any GPIO_PIN_OUTPUT flags, the driver will manipulate the hardware + * such that all output pins become driven with the proper initial values + * simultaneously if it can. The elements in the array map to pins in the same + * way that bits are mapped by pin_acces_32(), and the same restrictions may + * apply. For example, to configure pins 2 and 3 it may be necessary to set + * first_pin to zero and only populate pin_flags[2] and pin_flags[3]. If a + * given array entry doesn't contain GPIO_PIN_INPUT or GPIO_PIN_OUTPUT then no + * configuration is done for that pin. + * + * Some devices may limit the value of first_pin to 0, or to multiples of 16 or + * 32 or some other hardware-specific number. Invalid values in first_pin or + * num_pins result in an error return with errno set to EINVAL. + */ +struct gpio_config_32 { + uint32_t first_pin; + uint32_t num_pins; + uint32_t pin_flags[32]; +}; + +/* * ioctls */ #define GPIOMAXPIN _IOR('G', 0, int) @@ -104,5 +171,7 @@ struct gpio_req { #define GPIOSET _IOW('G', 4, struct gpio_req) #define GPIOTOGGLE _IOWR('G', 5, struct gpio_req) #define GPIOSETNAME _IOW('G', 6, struct gpio_pin) +#define GPIOACCESS32 _IOWR('G', 7, struct gpio_access_32) +#define GPIOCONFIG32 _IOW('G', 8, struct gpio_config_32) #endif /* __GPIO_H__ */ diff --git a/freebsd/sys/sys/gtaskqueue.h b/freebsd/sys/sys/gtaskqueue.h index c9b34e4f..e8519637 100644 --- a/freebsd/sys/sys/gtaskqueue.h +++ b/freebsd/sys/sys/gtaskqueue.h @@ -80,21 +80,6 @@ int taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, int stride); #define TASKQGROUP_DECLARE(name) \ extern struct taskqgroup *qgroup_##name -#ifdef EARLY_AP_STARTUP -#define TASKQGROUP_DEFINE(name, cnt, stride) \ - \ -struct taskqgroup *qgroup_##name; \ - \ -static void \ -taskqgroup_define_##name(void *arg) \ -{ \ - qgroup_##name = taskqgroup_create(#name); \ - taskqgroup_adjust(qgroup_##name, (cnt), (stride)); \ -} \ - \ -SYSINIT(taskqgroup_##name, SI_SUB_INIT_IF, SI_ORDER_FIRST, \ - taskqgroup_define_##name, NULL) -#else /* !EARLY_AP_STARTUP */ #define TASKQGROUP_DEFINE(name, cnt, stride) \ \ struct taskqgroup *qgroup_##name; \ @@ -105,7 +90,7 @@ taskqgroup_define_##name(void *arg) \ qgroup_##name = taskqgroup_create(#name); \ } \ \ -SYSINIT(taskqgroup_##name, SI_SUB_INIT_IF, SI_ORDER_FIRST, \ +SYSINIT(taskqgroup_##name, SI_SUB_TASKQ, SI_ORDER_FIRST, \ taskqgroup_define_##name, NULL); \ \ static void \ @@ -116,7 +101,6 @@ taskqgroup_adjust_##name(void *arg) \ \ SYSINIT(taskqgroup_adj_##name, SI_SUB_SMP, SI_ORDER_ANY, \ taskqgroup_adjust_##name, NULL) -#endif /* EARLY_AP_STARTUP */ TASKQGROUP_DECLARE(net); TASKQGROUP_DECLARE(softirq); diff --git a/freebsd/sys/sys/kernel.h b/freebsd/sys/sys/kernel.h index 3ca8af6e..051173f7 100644 --- a/freebsd/sys/sys/kernel.h +++ b/freebsd/sys/sys/kernel.h @@ -129,6 +129,7 @@ enum sysinit_sub_id { SI_SUB_SCHED_IDLE = 0x2600000, /* required idle procs */ SI_SUB_MBUF = 0x2700000, /* mbuf subsystem */ SI_SUB_INTR = 0x2800000, /* interrupt threads */ + SI_SUB_TASKQ = 0x2880000, /* task queues */ #ifdef EARLY_AP_STARTUP SI_SUB_SMP = 0x2900000, /* start the APs*/ #endif @@ -454,13 +455,16 @@ struct tunable_str { #define TUNABLE_STR_FETCH(path, var, size) #endif /* __rtems__ */ +typedef void (*ich_func_t)(void *_arg); + struct intr_config_hook { TAILQ_ENTRY(intr_config_hook) ich_links; - void (*ich_func)(void *arg); - void *ich_arg; + ich_func_t ich_func; + void *ich_arg; }; int config_intrhook_establish(struct intr_config_hook *hook); void config_intrhook_disestablish(struct intr_config_hook *hook); +void config_intrhook_oneshot(ich_func_t _func, void *_arg); #endif /* !_SYS_KERNEL_H_*/ diff --git a/freebsd/sys/sys/mbuf.h b/freebsd/sys/sys/mbuf.h index 60670697..ec98aaec 100644 --- a/freebsd/sys/sys/mbuf.h +++ b/freebsd/sys/sys/mbuf.h @@ -335,6 +335,16 @@ struct mbuf { * for ordering and distribution without explicit affinity. Additionally, * M_HASHTYPE_OPAQUE_HASH indicates that the flow identifier has hash * properties. + * + * The meaning of the IPV6_EX suffix: + * "o Home address from the home address option in the IPv6 destination + * options header. If the extension header is not present, use the Source + * IPv6 Address. + * o IPv6 address that is contained in the Routing-Header-Type-2 from the + * associated extension header. If the extension header is not present, + * use the Destination IPv6 Address." + * Quoted from: + * https://docs.microsoft.com/en-us/windows-hardware/drivers/network/rss-hashing-types#ndishashipv6ex */ #define M_HASHTYPE_HASHPROP 0x80 /* has hash properties */ #define M_HASHTYPE_HASH(t) (M_HASHTYPE_HASHPROP | (t)) @@ -348,10 +358,7 @@ struct mbuf { * ext hdrs */ #define M_HASHTYPE_RSS_TCP_IPV6_EX M_HASHTYPE_HASH(6) /* TCPv6 4-tuple + * ext hdrs */ -/* Non-standard RSS hash types */ #define M_HASHTYPE_RSS_UDP_IPV4 M_HASHTYPE_HASH(7) /* IPv4 UDP 4-tuple*/ -#define M_HASHTYPE_RSS_UDP_IPV4_EX M_HASHTYPE_HASH(8) /* IPv4 UDP 4-tuple + - * ext hdrs */ #define M_HASHTYPE_RSS_UDP_IPV6 M_HASHTYPE_HASH(9) /* IPv6 UDP 4-tuple*/ #define M_HASHTYPE_RSS_UDP_IPV6_EX M_HASHTYPE_HASH(10)/* IPv6 UDP 4-tuple + * ext hdrs */ diff --git a/freebsd/sys/sys/module.h b/freebsd/sys/sys/module.h index 5a268fc1..75471611 100644 --- a/freebsd/sys/sys/module.h +++ b/freebsd/sys/sys/module.h @@ -183,7 +183,7 @@ struct mod_pnp_match_info &_module_pnp_##b##_##unique, #b); /** * descr is a string that describes each entry in the table. The general - * form is (TYPE:pnp_name[/pnp_name];)* + * form is the grammar (TYPE:pnp_name[/pnp_name];)* * where TYPE is one of the following: * U8 uint8_t element * V8 like U8 and 0xff means match any @@ -196,12 +196,14 @@ struct mod_pnp_match_info * V32 like U32 and 0xffffffff means match any * W32 Two 16-bit values with first pnp_name in LSW and second in MSW. * Z pointer to a string to match exactly - * D like Z, but is the string passed to device_set_descr() + * D pointer to a string to human readable description for device * P A pointer that should be ignored * E EISA PNP Identifier (in binary, but bus publishes string) * K Key for whole table. pnp_name=value. must be last, if present. * * The pnp_name "#" is reserved for other fields that should be ignored. + * Otherwise pnp_name must match the name from the parent device's pnpinfo + * output. The second pnp_name is used for the W32 type. */ extern struct sx modules_sx; diff --git a/freebsd/sys/sys/mutex.h b/freebsd/sys/sys/mutex.h index 5325b363..bd773b58 100644 --- a/freebsd/sys/sys/mutex.h +++ b/freebsd/sys/sys/mutex.h @@ -107,12 +107,12 @@ int _mtx_trylock_flags_(volatile uintptr_t *c, int opts, const char *file, void mutex_init(void); #ifndef __rtems__ #if LOCK_DEBUG > 0 -void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, - int opts, const char *file, int line); +void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, int opts, + const char *file, int line); void __mtx_unlock_sleep(volatile uintptr_t *c, int opts, const char *file, int line); #else -void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid); +void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v); void __mtx_unlock_sleep(volatile uintptr_t *c); #endif @@ -176,13 +176,13 @@ void thread_lock_flags_(struct thread *, int, const char *, int); #define mtx_trylock_flags_(m, o, f, l) \ _mtx_trylock_flags_(&(m)->mtx_lock, o, f, l) #if LOCK_DEBUG > 0 -#define _mtx_lock_sleep(m, v, t, o, f, l) \ - __mtx_lock_sleep(&(m)->mtx_lock, v, t, o, f, l) +#define _mtx_lock_sleep(m, v, o, f, l) \ + __mtx_lock_sleep(&(m)->mtx_lock, v, o, f, l) #define _mtx_unlock_sleep(m, o, f, l) \ __mtx_unlock_sleep(&(m)->mtx_lock, o, f, l) #else -#define _mtx_lock_sleep(m, v, t, o, f, l) \ - __mtx_lock_sleep(&(m)->mtx_lock, v, t) +#define _mtx_lock_sleep(m, v, o, f, l) \ + __mtx_lock_sleep(&(m)->mtx_lock, v) #define _mtx_unlock_sleep(m, o, f, l) \ __mtx_unlock_sleep(&(m)->mtx_lock) #endif @@ -238,7 +238,7 @@ void thread_lock_flags_(struct thread *, int, const char *, int); \ if (__predict_false(LOCKSTAT_PROFILE_ENABLED(adaptive__acquire) ||\ !_mtx_obtain_lock_fetch((mp), &_v, _tid))) \ - _mtx_lock_sleep((mp), _v, _tid, (opts), (file), (line));\ + _mtx_lock_sleep((mp), _v, (opts), (file), (line)); \ } while (0) /* diff --git a/freebsd/sys/sys/sbuf.h b/freebsd/sys/sys/sbuf.h index c05bafd1..d0f908be 100644 --- a/freebsd/sys/sys/sbuf.h +++ b/freebsd/sys/sys/sbuf.h @@ -49,6 +49,7 @@ struct sbuf { #define SBUF_FIXEDLEN 0x00000000 /* fixed length buffer (default) */ #define SBUF_AUTOEXTEND 0x00000001 /* automatically extend buffer */ #define SBUF_INCLUDENUL 0x00000002 /* nulterm byte is counted in len */ +#define SBUF_DRAINTOEOR 0x00000004 /* use section 0 as drain EOR marker */ #define SBUF_USRFLAGMSK 0x0000ffff /* mask of flags the user may specify */ #define SBUF_DYNAMIC 0x00010000 /* s_buf must be freed */ #define SBUF_FINISHED 0x00020000 /* set by sbuf_finish() */ @@ -56,6 +57,7 @@ struct sbuf { #define SBUF_INSECTION 0x00100000 /* set by sbuf_start_section() */ int s_flags; /* flags */ ssize_t s_sect_len; /* current length of section */ + ssize_t s_rec_off; /* current record start offset */ }; #ifndef HD_COLUMN_MASK diff --git a/freebsd/sys/sys/smp.h b/freebsd/sys/sys/smp.h index 9101bd76..9253304f 100644 --- a/freebsd/sys/sys/smp.h +++ b/freebsd/sys/sys/smp.h @@ -120,8 +120,25 @@ struct topo_node * topo_next_node(struct topo_node *top, struct topo_node * topo_next_nonchild_node(struct topo_node *top, struct topo_node *node); void topo_set_pu_id(struct topo_node *node, cpuid_t id); -int topo_analyze(struct topo_node *topo_root, int all, int *pkg_count, - int *cores_per_pkg, int *thrs_per_core); + +enum topo_level { + TOPO_LEVEL_PKG = 0, + /* + * Some systems have useful sub-package core organizations. On these, + * a package has one or more subgroups. Each subgroup contains one or + * more cache groups (cores that share a last level cache). + */ + TOPO_LEVEL_GROUP, + TOPO_LEVEL_CACHEGROUP, + TOPO_LEVEL_CORE, + TOPO_LEVEL_THREAD, + TOPO_LEVEL_COUNT /* Must be last */ +}; +struct topo_analysis { + int entities[TOPO_LEVEL_COUNT]; +}; +int topo_analyze(struct topo_node *topo_root, int all, + struct topo_analysis *results); #define TOPO_FOREACH(i, root) \ for (i = root; i != NULL; i = topo_next_node(root, i)) diff --git a/freebsd/sys/sys/systm.h b/freebsd/sys/sys/systm.h index 4488c7cd..92be461b 100644 --- a/freebsd/sys/sys/systm.h +++ b/freebsd/sys/sys/systm.h @@ -172,6 +172,7 @@ void kassert_panic(const char *fmt, ...) __printflike(1, 2); * Align variables. */ #define __read_mostly __section(".data.read_mostly") +#define __read_frequently __section(".data.read_frequently") #define __exclusive_cache_line __aligned(CACHE_LINE_SIZE) \ __section(".data.exclusive_cache_line") /* @@ -329,6 +330,12 @@ void hexdump(const void *ptr, int length, const char *hdr, int flags); #ifndef __rtems__ void bcopy(const void * _Nonnull from, void * _Nonnull to, size_t len); void bzero(void * _Nonnull buf, size_t len); +#define bzero(buf, len) ({ \ + if (__builtin_constant_p(len) && (len) <= 64) \ + __builtin_memset((buf), 0, (len)); \ + else \ + bzero((buf), (len)); \ +}) #else /* __rtems__ */ #define bcopy(src, dst, len) memmove((dst), (src), (len)) #define bzero(buf, size) memset((buf), 0, (size)) diff --git a/freebsd/sys/sys/taskqueue.h b/freebsd/sys/sys/taskqueue.h index 7db75c6d..b5091d32 100644 --- a/freebsd/sys/sys/taskqueue.h +++ b/freebsd/sys/sys/taskqueue.h @@ -149,7 +149,7 @@ taskqueue_define_##name(void *arg) \ init; \ } \ \ -SYSINIT(taskqueue_##name, SI_SUB_INIT_IF, SI_ORDER_SECOND, \ +SYSINIT(taskqueue_##name, SI_SUB_TASKQ, SI_ORDER_SECOND, \ taskqueue_define_##name, NULL); \ \ struct __hack @@ -174,7 +174,7 @@ taskqueue_define_##name(void *arg) \ init; \ } \ \ -SYSINIT(taskqueue_##name, SI_SUB_INIT_IF, SI_ORDER_SECOND, \ +SYSINIT(taskqueue_##name, SI_SUB_TASKQ, SI_ORDER_SECOND, \ taskqueue_define_##name, NULL); \ \ struct __hack diff --git a/freebsd/sys/sys/vmmeter.h b/freebsd/sys/sys/vmmeter.h index d7692583..bc536f71 100644 --- a/freebsd/sys/sys/vmmeter.h +++ b/freebsd/sys/sys/vmmeter.h @@ -60,6 +60,12 @@ struct vmtotal { #if defined(_KERNEL) || defined(_WANT_VMMETER) #include <sys/counter.h> +#ifdef _KERNEL +#define VMMETER_ALIGNED __aligned(CACHE_LINE_SIZE) +#else +#define VMMETER_ALIGNED +#endif + /* * System wide statistics counters. * Locking: @@ -126,14 +132,15 @@ struct vmmeter { u_int v_free_target; /* (c) pages desired free */ u_int v_free_min; /* (c) pages desired free */ u_int v_free_count; /* (f) pages free */ - u_int v_wire_count; /* (a) pages wired down */ - u_int v_active_count; /* (q) pages active */ u_int v_inactive_target; /* (c) pages desired inactive */ - u_int v_inactive_count; /* (q) pages inactive */ - u_int v_laundry_count; /* (q) pages eligible for laundering */ u_int v_pageout_free_min; /* (c) min pages reserved for kernel */ u_int v_interrupt_free_min; /* (c) reserved pages for int code */ u_int v_free_severe; /* (c) severe page depletion point */ + u_int v_wire_count VMMETER_ALIGNED; /* (a) pages wired down */ + u_int v_active_count VMMETER_ALIGNED; /* (a) pages active */ + u_int v_inactive_count VMMETER_ALIGNED; /* (a) pages inactive */ + u_int v_laundry_count VMMETER_ALIGNED; /* (a) pages eligible for + laundering */ }; #endif /* _KERNEL || _WANT_VMMETER */ diff --git a/freebsd/sys/sys/vnode.h b/freebsd/sys/sys/vnode.h index 61cbf000..0c533063 100644 --- a/freebsd/sys/sys/vnode.h +++ b/freebsd/sys/sys/vnode.h @@ -251,6 +251,7 @@ struct xvnode { #define VV_DELETED 0x0400 /* should be removed */ #define VV_MD 0x0800 /* vnode backs the md device */ #define VV_FORCEINSMQ 0x1000 /* force the insmntque to succeed */ +#define VV_READLINK 0x2000 /* fdescfs linux vnode */ #define VMP_TMPMNTFREELIST 0x0001 /* Vnode is on mnt's tmp free list */ @@ -399,6 +400,7 @@ extern int vttoif_tab[]; #define V_NORMAL 0x0004 /* vinvalbuf: invalidate only regular bufs */ #define V_CLEANONLY 0x0008 /* vinvalbuf: invalidate only clean bufs */ #define V_VMIO 0x0010 /* vinvalbuf: called during pageout */ +#define V_ALLOWCLEAN 0x0020 /* vinvalbuf: allow clean buffers after flush */ #define REVOKEALL 0x0001 /* vop_revoke: revoke all aliases */ #define V_WAIT 0x0001 /* vn_start_write: sleep for suspend */ #define V_NOWAIT 0x0002 /* vn_start_write: don't sleep for suspend */ |