<commit_before>/*
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * arch/sh64/kernel/setup.c
 *
 * sh64 Arch Support
 *
 * This file handles the architecture-dependent parts of initialization
 *
 * Copyright (C) 2000, 2001  <NAME>
 * Copyright (C) 2003, 2004  <NAME>
 *
 * <EMAIL>:   2nd May 2002
 *    Modified to use the empty_zero_page to pass command line arguments.
 *
 * <EMAIL>:	 3rd May 2002
 *    Added support for ramdisk, removing statically linked romfs at the same time.
 *
 * <EMAIL>:          15th May 2003
 *    Added generic procfs cpuinfo reporting. Make boards just export their name.
 *
 * <EMAIL>:          25th May 2003
 *    Added generic get_cpu_subtype() for subtype reporting from cpu_data->type.
 *
 */
#include <linux/errno.h>
#include <linux/rwsem.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/stddef.h>
#include <linux/unistd.h>
#include <linux/ptrace.h>
#include <linux/slab.h>
#include <linux/user.h>
#include <linux/a.out.h>
#include <linux/screen_info.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/seq_file.h>
#include <linux/blkdev.h>
#include <linux/bootmem.h>
#include <linux/console.h>
#include <linux/root_dev.h>
#include <linux/cpu.h>
#include <linux/initrd.h>
#include <linux/pfn.h>
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/platform.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/sections.h>
#include <asm/setup.h>
#include <asm/smp.h>

#ifdef CONFIG_VT
#include <linux/console.h>
#endif

struct screen_info screen_info;

#ifdef CONFIG_BLK_DEV_RAM
extern int rd_doload;		/* 1 = load ramdisk, 0 = don't load */
extern int rd_prompt;		/* 1 = prompt for ramdisk, 0 = don't prompt */
extern int rd_image_start;	/* starting block # of image */
#endif

extern int root_mountflags;
extern char *get_system_type(void);
extern void platform_setup(void);
extern void platform_monitor(void);
extern void platform_reserve(void);
extern int sh64_cache_init(void);
extern int sh64_tlb_init(void);

#define RAMDISK_IMAGE_START_MASK	0x07FF
#define RAMDISK_PROMPT_FLAG		0x8000
#define RAMDISK_LOAD_FLAG		0x4000

static char command_line[COMMAND_LINE_SIZE] = { 0, };
unsigned long long memory_start = CONFIG_MEMORY_START;
unsigned long long memory_end = CONFIG_MEMORY_START + (CONFIG_MEMORY_SIZE_IN_MB * 1024 * 1024);

struct sh_cpuinfo boot_cpu_data;

static inline void parse_mem_cmdline (char ** cmdline_p)
{
        char c = ' ', *to = command_line, *from = COMMAND_LINE;
	int len = 0;

	/* Save unparsed command line copy for /proc/cmdline */
	memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE);
	saved_command_line[COMMAND_LINE_SIZE-1] = '\0';

	for (;;) {
	  /*
	   * "mem=XXX[kKmM]" defines a size of memory.
	   */
	        if (c == ' ' && !memcmp(from, "mem=", 4)) {
		      if (to != command_line)
			to--;
		      {
			unsigned long mem_size;

			mem_size = memparse(from+4, &from);
			memory_end = memory_start + mem_size;
		      }
		}
		c = *(from++);
		if (!c)
		  break;<commit_msg>[PATCH] Dynamic kernel command-line: sh64<commit_after>/*
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * arch/sh64/kernel/setup.c
 *
 * sh64 Arch Support
 *
 * This file handles the architecture-dependent parts of initialization
 *
 * Copyright (C) 2000, 2001  <NAME>
 * Copyright (C) 2003, 2004  <NAME>
 *
 * <EMAIL>:   2nd May 2002
 *    Modified to use the empty_zero_page to pass command line arguments.
 *
 * <EMAIL>:	 3rd May 2002
 *    Added support for ramdisk, removing statically linked romfs at the same time.
 *
 * <EMAIL>:          15th May 2003
 *    Added generic procfs cpuinfo reporting. Make boards just export their name.
 *
 * <EMAIL>:          25th May 2003
 *    Added generic get_cpu_subtype() for subtype reporting from cpu_data->type.
 *
 */
#include <linux/errno.h>
#include <linux/rwsem.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/stddef.h>
#include <linux/unistd.h>
#include <linux/ptrace.h>
#include <linux/slab.h>
#include <linux/user.h>
#include <linux/a.out.h>
#include <linux/screen_info.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/seq_file.h>
#include <linux/blkdev.h>
#include <linux/bootmem.h>
#include <linux/console.h>
#include <linux/root_dev.h>
#include <linux/cpu.h>
#include <linux/initrd.h>
#include <linux/pfn.h>
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/platform.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/sections.h>
#include <asm/setup.h>
#include <asm/smp.h>

#ifdef CONFIG_VT
#include <linux/console.h>
#endif

struct screen_info screen_info;

#ifdef CONFIG_BLK_DEV_RAM
extern int rd_doload;		/* 1 = load ramdisk, 0 = don't load */
extern int rd_prompt;		/* 1 = prompt for ramdisk, 0 = don't prompt */
extern int rd_image_start;	/* starting block # of image */
#endif

extern int root_mountflags;
extern char *get_system_type(void);
extern void platform_setup(void);
extern void platform_monitor(void);
extern void platform_reserve(void);
extern int sh64_cache_init(void);
extern int sh64_tlb_init(void);

#define RAMDISK_IMAGE_START_MASK	0x07FF
#define RAMDISK_PROMPT_FLAG		0x8000
#define RAMDISK_LOAD_FLAG		0x4000

static char __initdata command_line[COMMAND_LINE_SIZE] = { 0, };
unsigned long long memory_start = CONFIG_MEMORY_START;
unsigned long long memory_end = CONFIG_MEMORY_START + (CONFIG_MEMORY_SIZE_IN_MB * 1024 * 1024);

struct sh_cpuinfo boot_cpu_data;

static inline void parse_mem_cmdline (char ** cmdline_p)
{
        char c = ' ', *to = command_line, *from = COMMAND_LINE;
	int len = 0;

	/* Save unparsed command line copy for /proc/cmdline */
	memcpy(boot_command_line, COMMAND_LINE, COMMAND_LINE_SIZE);
	boot_command_line[COMMAND_LINE_SIZE-1] = '\0';

	for (;;) {
	  /*
	   * "mem=XXX[kKmM]" defines a size of memory.
	   */
	        if (c == ' ' && !memcmp(from, "mem=", 4)) {
		      if (to != command_line)
			to--;
		      {
			unsigned long mem_size;

			mem_size = memparse(from+4, &from);
			memory_end = memory_start + mem_size;
		      }
		}
		c = *(from++);
		if (!c)
		  break;
{'fraction_non_alphanumeric': 0.1276661040355992, 'fraction_numerical': 0.023937394506674852, 'mean_word_length': 3.9946360153256704, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 85, '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': '7625053', 'n_tokens_mistral': 2549, 'n_tokens_neox': 2312, 'n_words': 642}