summaryrefslogtreecommitdiffstats
path: root/sys/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/_pctrie.h10
-rw-r--r--sys/sys/gpio.h21
-rw-r--r--sys/sys/kernel.h7
-rw-r--r--sys/sys/param.h3
-rw-r--r--sys/sys/pctrie.h29
-rw-r--r--sys/sys/proc.h9
-rw-r--r--sys/sys/sysent.h3
7 files changed, 64 insertions, 18 deletions
diff --git a/sys/sys/_pctrie.h b/sys/sys/_pctrie.h
index 45f69b2..c6d13ba 100644
--- a/sys/sys/_pctrie.h
+++ b/sys/sys/_pctrie.h
@@ -38,14 +38,4 @@ struct pctrie {
uintptr_t pt_root;
};
-#ifdef _KERNEL
-
-static __inline boolean_t
-pctrie_is_empty(struct pctrie *ptree)
-{
-
- return (ptree->pt_root == 0);
-}
-
-#endif /* _KERNEL */
#endif /* !__SYS_PCTRIE_H_ */
diff --git a/sys/sys/gpio.h b/sys/sys/gpio.h
index 9b0a1b5..4b63baa 100644
--- a/sys/sys/gpio.h
+++ b/sys/sys/gpio.h
@@ -56,6 +56,11 @@
#define GPIO_PIN_LOW 0x00 /* low level (logical 0) */
#define GPIO_PIN_HIGH 0x01 /* high level (logical 1) */
+/* GPIO PWM settings */
+#define GPIO_PWM_DUTY 0x01 /* PWM duty cycle */
+#define GPIO_PWM_FREQ 0x02 /* PWM frequency */
+#define GPIO_PWM_PERIOD 0x04 /* PWM period */
+
/* Max name length of a pin */
#define GPIOMAXNAME 64
@@ -70,6 +75,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_PWM 0x00000400 /* pwm output */
+#define GPIO_PIN_MUX 0x00000800 /* pin mux */
/* GPIO interrupt capabilities */
#define GPIO_INTR_NONE 0x00000000 /* no interrupt support */
#define GPIO_INTR_LEVEL_LOW 0x00010000 /* level trigger, low */
@@ -86,6 +93,7 @@ struct gpio_pin {
char gp_name[GPIOMAXNAME]; /* human-readable name */
uint32_t gp_caps; /* capabilities */
uint32_t gp_flags; /* current flags */
+ uint32_t gp_pwm_caps; /* pwm capabilities */
};
/* GPIO pin request (read/write/toggle) */
@@ -94,6 +102,15 @@ struct gpio_req {
uint32_t gp_value; /* value */
};
+/* GPIO pwm request (read/write) */
+struct gpio_pwm_req {
+ int32_t gp_pwm; /* pwm number */
+ uint32_t gp_pwm_pin; /* pin number */
+ uint32_t gp_pwm_reg; /* register */
+ uint32_t gp_pwm_value; /* value */
+ uint32_t gp_pwm_caps; /* pwm capabilities */
+};
+
/*
* ioctls
*/
@@ -104,5 +121,9 @@ 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 GPIOMAXPWM _IOR('G', 7, int)
+#define GPIOPWMGETCONFIG _IOWR('G', 8, struct gpio_pwm_req)
+#define GPIOPWMGET _IOWR('G', 9, struct gpio_pwm_req)
+#define GPIOPWMSET _IOW('G', 10, struct gpio_pwm_req)
#endif /* __GPIO_H__ */
diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h
index 7124349..c9478fd 100644
--- a/sys/sys/kernel.h
+++ b/sys/sys/kernel.h
@@ -400,13 +400,16 @@ struct tunable_str {
#define TUNABLE_STR_FETCH(path, var, size) \
getenv_string((path), (var), (size))
+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/sys/sys/param.h b/sys/sys/param.h
index 16d3d6f..ad25a3c 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -85,6 +85,9 @@
#define P_OSREL_MAP_GUARD 1200035
#define P_OSREL_MAP_GUARD_11 1101501
#define P_OSREL_MAP_GUARD_11_1 1101001
+#define P_OSREL_WRFSBASE 1200041
+#define P_OSREL_WRFSBASE_11 1101503
+#define P_OSREL_WRFSBASE_11_1 1101001
#define P_OSREL_MAJOR(x) ((x) / 100000)
#endif
diff --git a/sys/sys/pctrie.h b/sys/sys/pctrie.h
index f736877..1fd0b34 100644
--- a/sys/sys/pctrie.h
+++ b/sys/sys/pctrie.h
@@ -76,7 +76,7 @@ name##_PCTRIE_LOOKUP(struct pctrie *ptree, uint64_t key) \
return name##_PCTRIE_VAL2PTR(pctrie_lookup(ptree, key)); \
} \
\
-static __inline struct type * \
+static __inline __unused struct type * \
name##_PCTRIE_LOOKUP_LE(struct pctrie *ptree, uint64_t key) \
{ \
\
@@ -119,5 +119,32 @@ void pctrie_remove(struct pctrie *ptree, uint64_t key,
size_t pctrie_node_size(void);
int pctrie_zone_init(void *mem, int size, int flags);
+static __inline void
+pctrie_init(struct pctrie *ptree)
+{
+
+ ptree->pt_root = 0;
+}
+
+static __inline boolean_t
+pctrie_is_empty(struct pctrie *ptree)
+{
+
+ return (ptree->pt_root == 0);
+}
+
+/*
+ * These widths should allow the pointers to a node's children to fit within
+ * a single cache line. The extra levels from a narrow width should not be
+ * a problem thanks to path compression.
+ */
+#ifdef __LP64__
+#define PCTRIE_WIDTH 4
+#else
+#define PCTRIE_WIDTH 3
+#endif
+
+#define PCTRIE_COUNT (1 << PCTRIE_WIDTH)
+
#endif /* _KERNEL */
#endif /* !_SYS_PCTRIE_H_ */
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index d32807a..11947db6 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -142,6 +142,7 @@ struct pargs {
* j - locked by proc slock
* k - only accessed by curthread
* k*- only accessed by curthread and from an interrupt
+ * kx- only accessed by curthread and by debugger
* l - the attaching proc or attaching proc parent
* m - Giant
* n - not locked, lazy
@@ -295,8 +296,8 @@ struct thread {
u_char td_pri_class; /* (t) Scheduling class. */
u_char td_user_pri; /* (t) User pri from estcpu and nice. */
u_char td_base_user_pri; /* (t) Base user pri */
- u_int td_dbg_sc_code; /* (c) Syscall code to debugger. */
- u_int td_dbg_sc_narg; /* (c) Syscall arg count to debugger.*/
+ u_int td_padding3;
+ u_int td_padding4;
uintptr_t td_rb_list; /* (k) Robust list head. */
uintptr_t td_rbp_list; /* (k) Robust priv list head. */
uintptr_t td_rb_inact; /* (k) Current in-action mutex loc. */
@@ -343,6 +344,8 @@ struct thread {
sbintime_t td_sleeptimo; /* (t) Sleep timeout. */
sigqueue_t td_sigqueue; /* (c) Sigs arrived, not delivered. */
#define td_siglist td_sigqueue.sq_signals
+ struct syscall_args td_sa; /* (kx) Syscall parameters. Copied on
+ fork for child tracing. */
};
struct thread0_storage {
@@ -1051,7 +1054,7 @@ void userret(struct thread *, struct trapframe *);
void cpu_exit(struct thread *);
void exit1(struct thread *, int, int) __dead2;
void cpu_copy_thread(struct thread *td, struct thread *td0);
-int cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa);
+int cpu_fetch_syscall_args(struct thread *td);
void cpu_fork(struct thread *, struct proc *, struct thread *, int);
void cpu_fork_kthread_handler(struct thread *, void (*)(void *), void *);
void cpu_set_syscall_retval(struct thread *, int);
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h
index 8313fc0..f1f4590 100644
--- a/sys/sys/sysent.h
+++ b/sys/sys/sysent.h
@@ -119,8 +119,7 @@ struct sysentvec {
u_long *sv_maxssiz;
u_int sv_flags;
void (*sv_set_syscall_retval)(struct thread *, int);
- int (*sv_fetch_syscall_args)(struct thread *, struct
- syscall_args *);
+ int (*sv_fetch_syscall_args)(struct thread *);
const char **sv_syscallnames;
vm_offset_t sv_timekeep_base;
vm_offset_t sv_shared_page_base;
OpenPOWER on IntegriCloud