summaryrefslogtreecommitdiff
path: root/kernel/framework/osscore/oss_core_services.c
blob: f049b5743f291b884d06fbd431acfd983fb48785 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
 * Purpose: Various global services for OSS.
 *
 * This source file contains some initialization and cleanup code
 * that is called by the OS modules for all operating systems.
 */
/*
 *
 * This file is part of Open Sound System.
 *
 * Copyright (C) 4Front Technologies 1996-2008.
 *
 * This this source file is released under GPL v2 license (no other versions).
 * See the COPYING file included in the main directory of this source
 * distribution for the license terms and conditions.
 *
 */

#include <oss_config.h>
#include "midi_core.h"

#ifdef DO_TIMINGS
extern oss_mutex_t oss_timing_mutex;
#endif

oss_history_t oss_history[OSS_HISTORY_SIZE] = { {0} };
int oss_history_p = 0;

int oss_num_cdevs = 0;
oss_cdev_t **oss_cdevs = NULL;
int oss_max_cdevs = 0;

static int drivers_loaded = 0;

void
oss_unload_drivers (void)
{

  if (!drivers_loaded)
    return;
  drivers_loaded = 0;

#ifdef CONFIG_OSS_VMIX
  vmix_core_uninit ();
#endif

  oss_audio_uninit ();

  /* oss_midi_uninit(); *//* TODO: This causes crashes */
#ifdef DO_TIMINGS
  MUTEX_CLEANUP (oss_timing_mutex);
#endif

  /*
   * Release all global memory
   */
  oss_memblk_unalloc(&oss_global_memblk);
}

/*ARGSUSED*/
void
create_new_card (char *shortname, char *longname)
{
}

void
oss_common_init (oss_device_t * osdev)
{
  if (drivers_loaded)
    return;
#ifdef DO_TIMINGS
  MUTEX_INIT (osdev, oss_timing_mutex, MH_TOP);
#endif
  drivers_loaded = 1;
  oss_audio_init (osdev);
  install_sndstat (osdev);
  install_vdsp (osdev);
  oss_midi_init (osdev);
  install_vmidi (osdev);
  install_dev_mixer (osdev);
#ifdef CONFIG_OSS_VMIX
  vmix_core_init (osdev);
#endif
}