xref: /haiku/src/tools/fs_shell/kernel_export.cpp (revision 206846d0f5f6d2fd018befde776223d12fcc2c00)
1 /*
2  * Copyright 2007, Ingo Weinhold, bonefish@cs.tu-berlin.de.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 #include "fssh_kernel_export.h"
7 
8 #include <stdarg.h>
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <string.h>
12 
13 #include "fssh_errors.h"
14 
15 
16 fssh_thread_id
fssh_spawn_kernel_thread(fssh_thread_func function,const char * threadName,int32_t priority,void * arg)17 fssh_spawn_kernel_thread(fssh_thread_func function, const char *threadName,
18 	int32_t priority, void *arg)
19 {
20 	return FSSH_B_ERROR;
21 }
22 
23 
24 fssh_status_t
fssh_wait_for_thread(fssh_thread_id thread,fssh_status_t * _returnCode)25 fssh_wait_for_thread(fssh_thread_id thread, fssh_status_t *_returnCode)
26 {
27 	return FSSH_B_ERROR;
28 }
29 
30 
31 fssh_status_t
fssh_user_memcpy(void * dest,const void * source,fssh_size_t length)32 fssh_user_memcpy(void *dest, const void *source, fssh_size_t length)
33 {
34 	memcpy(dest, source, length);
35 	return FSSH_B_OK;
36 }
37 
38 
39 void
fssh_dprintf(const char * format,...)40 fssh_dprintf(const char *format, ...)
41 {
42 	va_list args;
43 	va_start(args, format);
44 
45 	vprintf(format, args);
46 
47 	va_end(args);
48 }
49 
50 
51 void
fssh_kprintf(const char * format,...)52 fssh_kprintf(const char *format, ...)
53 {
54 	va_list args;
55 	va_start(args, format);
56 
57 	vprintf(format, args);
58 
59 	va_end(args);
60 }
61 
62 
63 void
fssh_dump_block(const char * buffer,int size,const char * prefix)64 fssh_dump_block(const char *buffer, int size, const char *prefix)
65 {
66 }
67 
68 
69 void
fssh_panic(const char * format,...)70 fssh_panic(const char *format, ...)
71 {
72 	va_list args;
73 	va_start(args, format);
74 
75 	vfprintf(stderr, format, args);
76 
77 	va_end(args);
78 
79 //	exit(1);
80 	int* badAddress = 0;
81 	*badAddress = 42;
82 }
83 
84 
85 void
fssh_kernel_debugger(const char * message)86 fssh_kernel_debugger(const char *message)
87 {
88 	fssh_panic("%s", message);
89 }
90 
91 
92 uint32_t
fssh_parse_expression(const char * string)93 fssh_parse_expression(const char *string)
94 {
95 	return 0;
96 }
97 
98 
99 int
fssh_add_debugger_command(const char * name,fssh_debugger_command_hook hook,const char * help)100 fssh_add_debugger_command(const char *name, fssh_debugger_command_hook hook,
101 	const char *help)
102 {
103 	return 0;
104 }
105 
106 
107 int
fssh_remove_debugger_command(char * name,fssh_debugger_command_hook hook)108 fssh_remove_debugger_command(char *name, fssh_debugger_command_hook hook)
109 {
110 	return 0;
111 }
112 
113