Subversion Repositories HelenOS

Compare Revisions

No changes between revisions

Ignore whitespace Rev 4221 → Rev 4296

/branches/dd/kernel/generic/include/event/event.h
File deleted
/branches/dd/kernel/generic/include/event/event_types.h
File deleted
/branches/dd/kernel/generic/include/symtab.h
26,7 → 26,7
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/** @addtogroup generic
/** @addtogroup generic
* @{
*/
/** @file
48,7 → 48,7
extern char *symtab_fmt_name_lookup(unative_t addr);
extern int symtab_addr_lookup(const char *name, uintptr_t *addr);
extern void symtab_print_search(const char *name);
extern int symtab_compl(char *name);
extern int symtab_compl(char *input, count_t size);
 
#ifdef CONFIG_SYMTAB
 
/branches/dd/kernel/generic/include/sysinfo/sysinfo.h
26,7 → 26,7
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/** @addtogroup generic
/** @addtogroup generic
* @{
*/
/** @file
36,6 → 36,7
#define KERN_SYSINFO_H_
 
#include <arch/types.h>
#include <string.h>
 
typedef union sysinfo_item_val {
unative_t val;
59,13 → 60,13
int subinfo_type;
} sysinfo_item_t;
 
#define SYSINFO_VAL_VAL 0
#define SYSINFO_VAL_FUNCTION 1
#define SYSINFO_VAL_UNDEFINED '?'
#define SYSINFO_VAL_VAL 0
#define SYSINFO_VAL_FUNCTION 1
#define SYSINFO_VAL_UNDEFINED U_SPECIAL
 
#define SYSINFO_SUBINFO_NONE 0
#define SYSINFO_SUBINFO_TABLE 1
#define SYSINFO_SUBINFO_FUNCTION 2
#define SYSINFO_SUBINFO_NONE 0
#define SYSINFO_SUBINFO_TABLE 1
#define SYSINFO_SUBINFO_FUNCTION 2
 
typedef unative_t (*sysinfo_val_fn_t)(sysinfo_item_t *root);
typedef unative_t (*sysinfo_subinfo_fn_t)(const char *subname);
/branches/dd/kernel/generic/include/string.h
37,26 → 37,64
 
#include <typedefs.h>
 
#define UTF8_NO_LIMIT ((size_t) -1)
/**< Common Unicode characters */
#define U_SPECIAL '?'
 
extern char invalch;
#define U_LEFT_ARROW 0x2190
#define U_UP_ARROW 0x2191
#define U_RIGHT_ARROW 0x2192
#define U_DOWN_ARROW 0x2193
 
extern wchar_t chr_decode(const char *, size_t *, size_t);
extern bool chr_encode(const wchar_t, char *, size_t *, size_t);
extern size_t str_lsize(const char *, count_t);
extern bool ascii_check(const wchar_t ch);
extern bool unicode_check(const wchar_t ch);
#define U_PAGE_UP 0x21de
#define U_PAGE_DOWN 0x21df
 
extern size_t strlen(const char *str);
#define U_HOME_ARROW 0x21f1
#define U_END_ARROW 0x21f2
 
#define U_NULL 0x2400
#define U_ESCAPE 0x241b
#define U_DELETE 0x2421
 
#define U_CURSOR 0x2588
 
#define U_BOM 0xfeff
 
/**< No size limit constant */
#define STR_NO_LIMIT ((size_t) -1)
 
/**< Maximum size of a string containing cnt characters */
#define STR_BOUNDS(cnt) (cnt << 2)
 
extern wchar_t str_decode(const char *str, size_t *offset, size_t sz);
extern int chr_encode(wchar_t ch, char *str, size_t *offset, size_t sz);
 
extern size_t str_size(const char *str);
extern size_t wstr_size(const wchar_t *str);
 
extern size_t str_lsize(const char *str, count_t max_len);
extern size_t wstr_lsize(const wchar_t *str, count_t max_len);
 
extern count_t str_length(const char *str);
extern count_t wstr_length(const wchar_t *str);
extern count_t wstr_length(const wchar_t *wstr);
 
extern int strcmp(const char *src, const char *dst);
extern int strncmp(const char *src, const char *dst, size_t len);
extern void strncpy(char *dest, const char *src, size_t len);
extern count_t str_nlength(const char *str, size_t size);
extern count_t wstr_nlength(const wchar_t *str, size_t size);
 
extern char *strchr(const char *s, int i);
extern bool ascii_check(wchar_t ch);
extern bool chr_check(wchar_t ch);
 
extern int str_cmp(const char *s1, const char *s2);
extern int str_lcmp(const char *s1, const char *s2, count_t max_len);
 
extern void str_cpy(char *dest, size_t size, const char *src);
extern void str_ncpy(char *dest, size_t size, const char *src, size_t n);
extern void wstr_nstr(char *dst, const wchar_t *src, size_t size);
 
extern const char *str_chr(const char *str, wchar_t ch);
 
extern bool wstr_linsert(wchar_t *str, wchar_t ch, count_t pos, count_t max_pos);
extern bool wstr_remove(wchar_t *str, count_t pos);
 
#endif
 
/** @}
/branches/dd/kernel/generic/include/console/chardev.h
46,7 → 46,7
/* Input character device operations interface. */
typedef struct {
/** Read character directly from device, assume interrupts disabled. */
char (* poll)(struct indev *);
wchar_t (* poll)(struct indev *);
} indev_operations_t;
 
/** Character input device. */
56,7 → 56,7
/** Protects everything below. */
SPINLOCK_DECLARE(lock);
uint8_t buffer[INDEV_BUFLEN];
wchar_t buffer[INDEV_BUFLEN];
count_t counter;
/** Implementation of indev operations. */
71,7 → 71,7
/* Output character device operations interface. */
typedef struct {
/** Write character to output. */
void (* write)(struct outdev *, wchar_t c, bool silent);
void (* write)(struct outdev *, wchar_t, bool);
} outdev_operations_t;
 
/** Character input device. */
88,7 → 88,7
 
extern void indev_initialize(char *name, indev_t *indev,
indev_operations_t *op);
extern void indev_push_character(indev_t *indev, uint8_t ch);
extern void indev_push_character(indev_t *indev, wchar_t ch);
 
extern void outdev_initialize(char *name, outdev_t *outdev,
outdev_operations_t *op);
/branches/dd/kernel/generic/include/console/kconsole.h
39,8 → 39,8
#include <synch/spinlock.h>
#include <ipc/irq.h>
 
#define MAX_CMDLINE 256
#define KCONSOLE_HISTORY 10
#define MAX_CMDLINE 256
#define KCONSOLE_HISTORY 10
 
typedef enum {
ARG_TYPE_INVALID = 0,
47,7 → 47,7
ARG_TYPE_INT,
ARG_TYPE_STRING,
/** Variable type - either symbol or string. */
ARG_TYPE_VAR
ARG_TYPE_VAR
} cmd_arg_type_t;
 
/** Structure representing one argument of kconsole command line. */
96,7 → 96,7
extern void kconsole(char *prompt, char *msg, bool kcon);
extern void kconsole_thread(void *data);
 
extern int cmd_register(cmd_info_t *cmd);
extern bool cmd_register(cmd_info_t *cmd);
 
#endif
 
/branches/dd/kernel/generic/include/console/console.h
49,10 → 49,10
extern void klog_update(void);
 
extern bool check_poll(indev_t *indev);
extern uint8_t getc(indev_t *indev);
extern uint8_t _getc(indev_t *indev);
extern wchar_t getc(indev_t *indev);
extern wchar_t _getc(indev_t *indev);
extern count_t gets(indev_t *indev, char *buf, size_t buflen);
extern unative_t sys_klog(int fd, const void * buf, size_t count);
extern unative_t sys_klog(int fd, const void *buf, size_t size);
 
extern void grab_console(void);
extern void release_console(void);
/branches/dd/kernel/generic/include/printf/printf_core.h
40,11 → 40,11
 
/** Structure for specifying output methods for different printf clones. */
typedef struct {
/* UTF-8 output function, returns number of printed UTF-8 characters or EOF */
int (*write_utf8)(const char *, size_t, void *);
/* String output function, returns number of printed characters or EOF */
int (*str_write)(const char *, size_t, void *);
/* UTF-32 output function, returns number of printed UTF-32 characters or EOF */
int (*write_utf32)(const wchar_t *, size_t, void *);
/* Wide string output function, returns number of printed characters or EOF */
int (*wstr_write)(const wchar_t *, size_t, void *);
/* User data - output stream specification, state, locks, etc. */
void *data;
/branches/dd/kernel/generic/include/ipc/event.h
0,0 → 1,79
/*
* Copyright (c) 2009 Jakub Jermar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/** @addtogroup generic
* @{
*/
/** @file
*/
 
#ifndef KERN_EVENT_H_
#define KERN_EVENT_H_
 
#include <ipc/event_types.h>
#include <arch/types.h>
#include <synch/spinlock.h>
#include <ipc/ipc.h>
 
/** Event notification structure. */
typedef struct {
SPINLOCK_DECLARE(lock);
/** Answerbox for notifications. */
answerbox_t *answerbox;
/** Method to be used for the notification. */
unative_t method;
/** Counter. */
count_t counter;
} event_t;
 
extern void event_init(void);
extern unative_t sys_event_subscribe(unative_t, unative_t);
extern bool event_is_subscribed(event_type_t);
extern void event_cleanup_answerbox(answerbox_t *);
 
#define event_notify_0(e) \
event_notify((e), 0, 0, 0, 0, 0)
#define event_notify_1(e, a1) \
event_notify((e), (a1), 0, 0, 0, 0)
#define event_notify_2(e, a1, a2) \
event_notify((e), (a1), (a2), 0, 0, 0)
#define event_notify_3(e, a1, a2, a3) \
event_notify((e), (a1), (a2), (a3), 0, 0)
#define event_notify_4(e, a1, a2, a3, a4) \
event_notify((e), (a1), (a2), (a3), (a4), 0)
#define event_notify_5(e, a1, a2, a3, a4, a5) \
event_notify((e), (a1), (a2), (a3), (a4), (a5))
 
extern void event_notify(event_type_t, unative_t, unative_t, unative_t,
unative_t, unative_t);
 
#endif
 
/** @}
*/
Property changes:
Added: svn:mergeinfo
/branches/dd/kernel/generic/include/ipc/event_types.h
0,0 → 1,47
/*
* Copyright (c) 2009 Jakub Jermar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/** @addtogroup generic
* @{
*/
/** @file
*/
 
#ifndef KERN_EVENT_TYPES_H_
#define KERN_EVENT_TYPES_H_
 
typedef enum event_type {
EVENT_KLOG = 0,
EVENT_KCONSOLE,
EVENT_END
} event_type_t;
 
#endif
 
/** @}
*/
Property changes:
Added: svn:mergeinfo