<commit_before>#include <fudge.h>
#include <kernel.h>
#include "cpu.h"
#include "arch.h"
#include "kmi.h"
#include "pic.h"
#include "reg.h"
#include "uart.h"

#define CONTAINERS                      8
#define TASKS                           64
#define TASKVSTACKLIMIT                 0x80000000

extern void halt();

struct atag_header
{

    unsigned int size;
    unsigned int tag;

};

static struct arch_container
{

    struct container base;

} containers[CONTAINERS];

static struct arch_task
{

    struct task base;

} tasks[TASKS];

static struct
{

    struct container *container;
    struct task *task;

} current;

static struct vfs_backend backend;

static unsigned int backend_read(struct vfs_backend *self, unsigned int offset, unsigned int count, void *buffer)
{

    return 0;

}

static unsigned int backend_write(struct vfs_backend *self, unsigned int offset, unsigned int count, void *buffer)
{

    return 0;

}

static unsigned long backend_getphysical(struct vfs_backend *self)
{

    return 0;

}

static unsigned int spawn(struct container *container, struct task *task, void *stack)
{

    return 0;

}

static unsigned int despawn(struct container *container, struct task *task, void *stack)
{

    return 0;

}

/*
static void debugnum(unsigned int value, unsigned int base)
{

    char num[32];

    memory_clear(num, 32);
    ascii_wvalue(num, 32, value, base, 0);
    uart_puts(num);
    uart_puts("\n");

}
*/

void arch_undefined()
{

    uart_puts("ISR UNDEFINED\n");

    for (;;);

}

void arch_reset()
{

    uart_puts("ISR RESET\n");

    for (;;);

}

__attribute__ ((interrupt ("SWI"))) void arch_swi()
{

    uart_puts("ISR SYSCALL\n");

}

__attribute__ ((interrupt ("IRQ"))) void arch_irq()
{

    uart_puts("ISR IRQ\n");

}

__attribute__ ((interrupt ("FIQ"))) void arch_fiq()
{

    uart_puts("ISR FIQ\n");

}

static void setupcontainer(struct arch_container *container, unsigned int i)
{

    container_init(&container->base);

}

static struct container *setupcontainers()
{<commit_msg>more arm work<commit_after>#include <fudge.h>
#include <kernel.h>
#include "cpu.h"
#include "arch.h"
#include "kmi.h"
#include "pic.h"
#include "reg.h"
#include "uart.h"

#define CONTAINERS                      8
#define TASKS                           64
#define TASKVSTACKLIMIT                 0x80000000

extern void halt();

struct atag_header
{

    unsigned int size;
    unsigned int tag;

};

static struct arch_container
{

    struct container base;

} containers[CONTAINERS];

static struct arch_task
{

    struct task base;

} tasks[TASKS];

static struct
{

    struct container *container;
    struct task *task;

} current;

static struct vfs_backend backend;

static unsigned int backend_read(struct vfs_backend *self, unsigned int offset, unsigned int count, void *buffer)
{

    return 0;

}

static unsigned int backend_write(struct vfs_backend *self, unsigned int offset, unsigned int count, void *buffer)
{

    return 0;

}

static unsigned long backend_getphysical(struct vfs_backend *self)
{

    return 0;

}

static unsigned int spawn(struct container *container, struct task *task, void *stack)
{

    return 0;

}

static unsigned int despawn(struct container *container, struct task *task, void *stack)
{

    return 0;

}

static void debugnum(unsigned int value, unsigned int base)
{

    char num[32];

    memory_clear(num, 32);
    ascii_wvalue(num, 32, value, base, 0);
    uart_puts(num);
    uart_puts("\n");

}

void arch_undefined()
{

    uart_puts("ISR UNDEFINED\n");

    for (;;);

}

void arch_reset()
{

    uart_puts("ISR RESET\n");

    for (;;);

}

__attribute__ ((interrupt("SWI"))) void arch_swi()
{

    register unsigned int addr __asm__ ("r14");

    addr -= 4;

    uart_puts("ISR SWI: ");
    debugnum(*((unsigned int *)(addr)) & 0x00FFFFFF, 10);

}

__attribute__ ((interrupt("IRQ"))) void arch_irq()
{

    uart_puts("ISR IRQ\n");

}

__attribute__ ((interrupt("FIQ"))) void arch_fiq()
{

    uart_puts("ISR FIQ\n");

}

static void setupcontainer(struct arch_container *container, unsigned int i)
{

    container_init(&container->base);

}

static struct container *setupcontainers()
{
{'fraction_non_alphanumeric': 0.1207556193208991, 'fraction_numerical': 0.013390722142515544, 'mean_word_length': 3.4311440677966103, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '2840804', 'n_tokens_mistral': 1517, 'n_tokens_neox': 1406, 'n_words': 396}