Separated the team functions from the thread.h header into the new team.h.

Fixed fd.h to include that file.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6995 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-03-16 02:40:03 +00:00
parent 8131e02c55
commit 14f5ad8ce4
3 changed files with 53 additions and 26 deletions

View File

@ -9,6 +9,7 @@
#include <lock.h>
#include <memheap.h>
#include <sys/stat.h>
#include <team.h>
#ifdef __cplusplus

View File

@ -0,0 +1,48 @@
/*
** Copyright 2004, The OpenBeOS Team. All rights reserved.
** Distributed under the terms of the OpenBeOS License.
*/
#ifndef _TEAM_H
#define _TEAM_H
#include <OS.h>
#include <thread_types.h>
#ifdef __cplusplus
extern "C" {
#endif
int team_init(kernel_args *ka);
team_id team_create_team(const char *path, const char *name, char **args, int argc,
char **envp, int envc, int priority);
status_t wait_for_team(team_id id, status_t *returnCode);
void team_remove_team(struct team *team);
void team_delete_team(struct team *team);
struct team *team_get_kernel_team(void);
team_id team_get_kernel_team_id(void);
team_id team_get_current_team_id(void);
char **user_team_get_arguments(void);
int user_team_get_arg_count(void);
bool team_is_valid(team_id id);
struct team *team_get_team_struct_locked(team_id id);
// used in syscalls.c
team_id _user_create_team(const char *path, const char *name, char **args, int argc, char **envp, int envc, int priority);
status_t _user_wait_for_team(team_id id, status_t *_returnCode);
status_t _user_kill_team(thread_id thread);
team_id _user_get_current_team(void);
status_t _user_get_team_info(team_id id, team_info *info);
status_t _user_get_next_team_info(int32 *cookie, team_info *info);
// ToDo: please move the "env" setter/getter out of the kernel!
int user_setenv(const char *name, const char *value, int overwrite);
int user_getenv(const char *name, char **value);
#ifdef __cplusplus
}
#endif
#endif /* _TIME_H */

View File

@ -8,15 +8,16 @@
#ifndef _THREAD_H
#define _THREAD_H
#ifdef __cplusplus
extern "C" {
#endif
#include <OS.h>
#include <thread_types.h>
#include <arch/thread.h>
#ifdef __cplusplus
extern "C" {
#endif
void scheduler_reschedule(void);
void start_scheduler(void);
@ -53,24 +54,7 @@ thread_get_current_thread_id(void)
thread_id spawn_kernel_thread_etc(thread_func, const char *name, int32 priority, void *args, team_id team);
int team_init(kernel_args *ka);
struct team *team_get_kernel_team(void);
team_id team_create_team(const char *path, const char *name, char **args, int argc, char **envp, int envc, int priority);
status_t wait_for_team(team_id id, status_t *returnCode);
void team_remove_team_from_hash(struct team *team);
team_id team_get_kernel_team_id(void);
team_id team_get_current_team_id(void);
char **user_team_get_arguments(void);
int user_team_get_arg_count(void);
bool team_is_valid(team_id id);
struct team *team_get_team_struct_locked(team_id id);
// used in syscalls.c
team_id _user_create_team(const char *path, const char *name, char **args, int argc, char **envp, int envc, int priority);
status_t _user_wait_for_team(team_id id, status_t *_returnCode);
status_t _user_kill_team(thread_id thread);
team_id _user_get_current_team(void);
status_t _user_set_thread_priority(thread_id thread, int32 newPriority);
status_t _user_suspend_thread(thread_id thread);
status_t _user_resume_thread(thread_id thread);
@ -85,17 +69,11 @@ status_t _user_receive_data(thread_id *_sender, void *buffer, size_t buffer_size
thread_id _user_find_thread(const char *name);
status_t _user_get_thread_info(thread_id id, thread_info *info);
status_t _user_get_next_thread_info(team_id team, int32 *cookie, thread_info *info);
status_t _user_get_team_info(team_id id, team_info *info);
status_t _user_get_next_team_info(int32 *cookie, team_info *info);
// ToDo: these don't belong here
int _user_getrlimit(int resource, struct rlimit * rlp);
int _user_setrlimit(int resource, const struct rlimit * rlp);
// ToDo: please move the "env" setter/getter out of the kernel!
int user_setenv(const char *name, const char *value, int overwrite);
int user_getenv(const char *name, char **value);
#if 1
// XXX remove later
int thread_test(void);