<commit_before>// Wagtail OS
// (c) <NAME> 2012 <<EMAIL>>
// Report bugs and issues on <http://github.com/skordal/wagtail>

#ifndef WAGTAIL_IO_H
#define WAGTAIL_IO_H

namespace wagtail
{
	namespace io
	{
		// Reads one element of the type T from the register located
		// at (base + offset):
		template<typename T>
		inline T read(const void * base, unsigned int offset = 0)
			{ return *(((volatile T *)((unsigned int) base + offset))); }
		
		// Writes one element of the type T to the register located
		// at (base + offset):
		template<typename T>
		inline void write(T data, const void * base, unsigned int offset = 0)
			{ *(((volatile T *) base) + offset) = data; }
	}
}

#endif

<commit_msg>Added function for or-ing a register value with a parameter<commit_after>// Wagtail OS
// (c) <NAME> 2012 <<EMAIL>>
// Report bugs and issues on <http://github.com/skordal/wagtail>

#ifndef WAGTAIL_IO_H
#define WAGTAIL_IO_H

namespace wagtail
{
	namespace io
	{
		// Reads one element of the type T from the register located
		// at (base + offset):
		template<typename T>
		inline T read(const void * base, unsigned int offset = 0)
			{ return *(((volatile T *)((unsigned int) base + offset))); }
		
		// Writes one element of the type T to the register located
		// at (base + offset):
		template<typename T>
		inline void write(T data, const void * base, unsigned int offset = 0)
			{ *(((volatile T *) base) + offset) = data; }

		// Reads an element of the specified type T from the register located at
		// the specified base + offset, does a bitwise OR of its value and the
		// provided value, and writes it back to the register:
		template<typename T>
		inline void or_register(T data, const void * base, unsigned int offset = 0)
			{ T temp = read<T>(base, offset); temp |= data; write(temp, base, offset); }
	}
}

#endif


{'fraction_non_alphanumeric': 0.12002182214948172, 'fraction_numerical': 0.0070921985815602835, 'mean_word_length': 3.3666666666666667, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '3159325', 'n_tokens_mistral': 635, 'n_tokens_neox': 580, 'n_words': 238}