<commit_before>/*
Copyright 2014 <NAME>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef _CYANURUS_PROCESS_H_
#define _CYANURUS_PROCESS_H_

#include "lib/list.h"
#include "lib/unix.h"

#define USER_ADDRESS_START ((uint8_t*)0x00010000)
#define USER_ADDRESS_END   ((uint8_t*)0x60000000)

#define WAIT_EXIT_CODE(status) (((status) & 0xff) << 8)
#define WAIT_SIGNAL(signal) ((signal) & 0x7f)
#define WAIT_CORE_DUMP(coredump) (((coredump) ? 1 : 0) << 7)

struct process_context {
  uint32_t cpsr;
  uint32_t r[13];
  uint32_t sp;
  uint32_t lr;
  uint32_t pc;
};

struct process_waitq {
  struct list next;
};

extern struct process *current_process;

void process_init(void);
pid_t process_get_id(struct process* process);<commit_msg>define IS_USER_ADDRESSS<commit_after>/*
Copyright 2014 <NAME>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef _CYANURUS_PROCESS_H_
#define _CYANURUS_PROCESS_H_

#include "lib/list.h"
#include "lib/unix.h"

#define USER_ADDRESS_START ((uint8_t*)0x00010000)
#define USER_ADDRESS_END   ((uint8_t*)0x60000000)
#define IS_USER_ADDRESSS(address) ((uint8_t*)(address) >= USER_ADDRESS_START && (uint8_t*)(address) < USER_ADDRESS_END)

#define WAIT_EXIT_CODE(status) (((status) & 0xff) << 8)
#define WAIT_SIGNAL(signal) ((signal) & 0x7f)
#define WAIT_CORE_DUMP(coredump) (((coredump) ? 1 : 0) << 7)

struct process_context {
  uint32_t cpsr;
  uint32_t r[13];
  uint32_t sp;
  uint32_t lr;
  uint32_t pc;
};

struct process_waitq {
  struct list next;
};

extern struct process *current_process;

void process_init(void);
pid_t process_get_id(struct process* process);
{'fraction_non_alphanumeric': 0.09586905689789556, 'fraction_numerical': 0.037412314886983634, 'mean_word_length': 5.401496259351621, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3786801', 'n_tokens_mistral': 931, 'n_tokens_neox': 868, 'n_words': 282}