extern int boothowto; /* reboot flags, from console subsystem */
extern int show_space;
extern int minimalboot;
+#if CONFIG_EMBEDDED
+extern int darkboot;
+#endif
-extern int nblkdev; /* number of entries in bdevsw */
-extern int nchrdev; /* number of entries in cdevsw */
+extern const int nblkdev; /* number of entries in bdevsw */
+extern const int nchrdev; /* number of entries in cdevsw */
#endif /* BSD_KERNEL_PRIVATE */
#ifdef KERNEL_PRIVATE
int hzto(struct timeval *tv);
void tablefull(const char *);
int kvprintf(char const *, void (*)(int, void*), void *, int,
- __darwin_va_list);
+ __darwin_va_list) __printflike(1,0);
void uprintf(const char *, ...) __printflike(1,2);
int copywithin(void *saddr, void *daddr, size_t len);
int64_t fulong(user_addr_t addr);
int sulong(user_addr_t addr, int64_t longword);
uint64_t fuulong(user_addr_t addr);
int suulong(user_addr_t addr, uint64_t ulongword);
-int vslock(user_addr_t addr, user_size_t len);
-int vsunlock(user_addr_t addr, user_size_t len, int dirtied);
int clone_system_shared_regions(int shared_regions_active,
int chain_regions,
int base_vnode);
void __pthread_testcancel(int presyscall);
void throttle_info_get_last_io_time(mount_t mp, struct timeval *tv);
void update_last_io_time(mount_t mp);
+void throttle_info_end_io(buf_t bp);
#endif /* BSD_KERNEL_PRIVATE */
#ifdef KERNEL_PRIVATE
void timeout_with_leeway(void (*)(void *), void *arg, int ticks, int leeway_ticks);
void untimeout(void (*)(void *), void *arg);
int bsd_hostname(char *, int, int*);
+int vslock(user_addr_t addr, user_size_t len);
+int vsunlock(user_addr_t addr, user_size_t len, int dirtied);
#endif /* KERNEL_PRIVATE */
int nullop(void);
void bsd_untimeout(void (*)(void *), void *arg);
void set_fsblocksize(struct vnode *);
uint64_t tvtoabstime(struct timeval *);
+uint64_t tstoabstime(struct timespec *);
void *throttle_info_create(void);
void throttle_info_mount_ref(mount_t mp, void * throttle_info);
void throttle_info_mount_rel(mount_t mp);
void throttle_info_update(void *throttle_info, int flags);
uint32_t throttle_lowpri_io(int sleep_amount);
void throttle_set_thread_io_policy(int policy);
+int throttle_get_thread_effective_io_policy(void);
typedef struct __throttle_info_handle *throttle_info_handle_t;
int throttle_info_ref_by_mask(uint64_t throttle_mask, throttle_info_handle_t *throttle_info_handle);
*/
int throttle_info_io_will_be_throttled(void *throttle_info_handle, int policy);
+#ifdef KERNEL_PRIVATE
+
+/* returned by throttle_io_will_be_throttled */
+#define THROTTLE_DISENGAGED 0
+#define THROTTLE_ENGAGED 1
+#define THROTTLE_NOW 2
+
+int throttle_io_will_be_throttled(int lowpri_window_msecs, mount_t mp);
+int throttle_lowpri_window(void) __attribute__((pure));
+struct uthread;
+void throttle_info_reset_window(struct uthread *ut);
+
+#endif
+
#ifdef XNU_KERNEL_PRIVATE
void *exec_spawnattr_getmacpolicyinfo(const void *macextensions, const char *policyname, size_t *lenp);
#endif