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

#ifndef ASM_X86_IO_H_
#define ASM_X86_IO_H_

#include <types.h>

static inline uint8_t in8(unsigned long port) {
	uint8_t tmp;
	__asm__ __volatile__(
		"inb %w1, %b0"
		: "=a"(tmp)
		: "Nd"(port)
	);
	return tmp;
}

static inline uint8_t in16(unsigned long port) {
	uint16_t tmp;
	__asm__ __volatile__(
		"inw %w1, %w0"
		: "=a"(tmp)
		: "Nd"(port)
	);
	return tmp;
}

static inline uint8_t in32(unsigned long port) {
	uint32_t tmp;
	__asm__ __volatile__(
		"in %w1, %0"
		: "=a"(tmp)
		: "Nd"(port)
	);
	return tmp;
}

#define inb(port) in8(port)

#define out8(val, port)                  \
	__asm__ __volatile__(            \
		"outb %b0, %w1"          \
		: : "a"(val), "Nd"(port) \
	)

#define out16(val, port)                 \
	__asm__ __volatile__(            \
		"outw %w0, %w1"          \
		: : "a"(val), "Nd"(port) \
	)
<commit_msg>Small fix with types in in.h<commit_after>/**
 * @file
 *
 * @brief
 *
 * @date 12.12.2010
 * @author <NAME>
 */

#ifndef ASM_X86_IO_H_
#define ASM_X86_IO_H_

#include <types.h>

static inline uint8_t in8(unsigned long port) {
	uint8_t tmp;
	__asm__ __volatile__(
		"inb %w1, %b0"
		: "=a"(tmp)
		: "Nd"(port)
	);
	return tmp;
}

static inline uint16_t in16(unsigned long port) {
	uint16_t tmp;
	__asm__ __volatile__(
		"inw %w1, %w0"
		: "=a"(tmp)
		: "Nd"(port)
	);
	return tmp;
}

static inline uint32_t in32(unsigned long port) {
	uint32_t tmp;
	__asm__ __volatile__(
		"in %w1, %0"
		: "=a"(tmp)
		: "Nd"(port)
	);
	return tmp;
}

#define inb(port) in8(port)

#define out8(val, port)                  \
	__asm__ __volatile__(            \
		"outb %b0, %w1"          \
		: : "a"(val), "Nd"(port) \
	)

#define out16(val, port)                 \
	__asm__ __volatile__(            \
		"outw %w0, %w1"          \
		: : "a"(val), "Nd"(port) \
	)

{'fraction_non_alphanumeric': 0.1712, 'fraction_numerical': 0.042666666666666665, 'mean_word_length': 2.4805194805194803, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6486074', 'n_tokens_mistral': 926, 'n_tokens_neox': 839, 'n_words': 179}