<commit_before>/**
 * @file
 *
 * @brief
 *
 * @date 17.10.2012
 * @author <NAME>
 */

#ifndef KERNEL_TASK_IO_SYNC_H_
#define KERNEL_TASK_IO_SYNC_H_

#include <kernel/task.h>
#include <kernel/task/idx.h>
#include <kernel/softirq_lock.h>
#include <kernel/thread/event.h>
#include <assert.h>

struct event;
struct idx_desc;

/* I/O operations */
#define IDX_IO_READING 0x01
#define IDX_IO_WRITING 0x10

static inline void idx_io_set_monitor(struct idx_desc *desc, int op) {
	assert(desc->data);
	desc->data->io_state.io_monitoring |= op;
}

static inline void idx_io_unset_monitor(struct idx_desc *desc, int op) {
	assert(desc->data);
	desc->data->io_state.io_monitoring &= ~op;
}

static inline void idx_io_disable(struct idx_desc *desc, int op) {
	softirq_lock();
	assert(desc->data);
	desc->data->io_state.io_ready &= ~op;
	softirq_unlock();
}
<commit_msg>io_sync extra header removed (not needed, prevented stm32_vl build)<commit_after>/**
 * @file
 *
 * @brief
 *
 * @date 17.10.2012
 * @author <NAME>
 */

#ifndef KERNEL_TASK_IO_SYNC_H_
#define KERNEL_TASK_IO_SYNC_H_

#include <kernel/task.h>
#include <kernel/task/idx.h>
#include <kernel/softirq_lock.h>
#include <assert.h>

struct event;
struct idx_desc;

/* I/O operations */
#define IDX_IO_READING 0x01
#define IDX_IO_WRITING 0x10

static inline void idx_io_set_monitor(struct idx_desc *desc, int op) {
	assert(desc->data);
	desc->data->io_state.io_monitoring |= op;
}

static inline void idx_io_unset_monitor(struct idx_desc *desc, int op) {
	assert(desc->data);
	desc->data->io_state.io_monitoring &= ~op;
}

static inline void idx_io_disable(struct idx_desc *desc, int op) {
	softirq_lock();
	assert(desc->data);
	desc->data->io_state.io_ready &= ~op;
	softirq_unlock();
}

{'fraction_non_alphanumeric': 0.14121037463976946, 'fraction_numerical': 0.01729106628242075, 'mean_word_length': 5.2, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6119661', 'n_tokens_mistral': 711, 'n_tokens_neox': 692, 'n_words': 142}