<commit_before>//=======================================================================
// Copyright <NAME> 2013-2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================

#ifndef INTERRUPTS_H
#define INTERRUPTS_H

#include "stl/types.hpp"

namespace interrupt {

constexpr const size_t SYSCALL_FIRST = 50;
constexpr const size_t SYSCALL_MAX = 10;

struct fault_regs {
    uint64_t error_no;
    uint64_t error_code;
    uint64_t rip;
    uint64_t rflags;
    uint64_t cs;
    uint64_t rsp;
    uint64_t ss;
} __attribute__((packed));

struct syscall_regs {
    uint64_t data_segment;
    uint64_t rax;
    uint64_t rbx;
    uint64_t rcx;
    uint64_t rdx;
    uint64_t rsi;
    uint64_t rdi;
    uint64_t r8;
    uint64_t r9;
    uint64_t r10;
    uint64_t r11;
    uint64_t r12;
    uint64_t code;
} __attribute__((packed));

void setup_interrupts();

void register_irq_handler(size_t irq, void (*handler)());
void register_syscall_handler(size_t irq, void (*handler)(const syscall_regs&));

} //end of interrupt namespace

#endif
<commit_msg>Get reference to the values that are pushed on the stack by int<commit_after>//=======================================================================
// Copyright <NAME> 2013-2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================

#ifndef INTERRUPTS_H
#define INTERRUPTS_H

#include "stl/types.hpp"

namespace interrupt {

constexpr const size_t SYSCALL_FIRST = 50;
constexpr const size_t SYSCALL_MAX = 10;

struct fault_regs {
    uint64_t error_no;
    uint64_t error_code;
    uint64_t rip;
    uint64_t rflags;
    uint64_t cs;
    uint64_t rsp;
    uint64_t ss;
} __attribute__((packed));

struct syscall_regs {
    uint64_t data_segment;
    uint64_t rax;
    uint64_t rbx;
    uint64_t rcx;
    uint64_t rdx;
    uint64_t rsi;
    uint64_t rdi;
    uint64_t r8;
    uint64_t r9;
    uint64_t r10;
    uint64_t r11;
    uint64_t r12;
    uint64_t rbp;
    uint64_t rsp;
    uint64_t code;
    uint64_t rip;
    uint64_t cs;
    uint64_t rflags;
    uint64_t rsp;
} __attribute__((packed));

void setup_interrupts();

void register_irq_handler(size_t irq, void (*handler)());
void register_syscall_handler(size_t irq, void (*handler)(const syscall_regs&));

} //end of interrupt namespace

#endif

{'fraction_non_alphanumeric': 0.19080459770114944, 'fraction_numerical': 0.05517241379310345, 'mean_word_length': 4.069902912621359, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6248448', 'n_tokens_mistral': 1001, 'n_tokens_neox': 890, 'n_words': 228}