~ubuntu-branches/ubuntu/oneiric/oss4/oneiric-proposed

« back to all changes in this revision

Viewing changes to kernel/framework/osscore/oss_core_services.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Rivera
  • Date: 2011-06-16 20:37:48 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110616203748-jbrxik6ql33z54co
Tags: 4.2-build2004-1ubuntu1
* Merge from Debian unstable.
  - Supports our current kernel (LP: #746048)
  Remaining changes:
  - debian/oss4-dkms.dkms.in: s/source/build/ in Kernel headers paths.
* ld-as-needed.patch: Re-order CC arguments to enable building with ld
  --as-needed (LP: #770972)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Purpose: Various global services for OSS.
 
3
 *
 
4
 * This source file contains some initialization and cleanup code
 
5
 * that is called by the OS modules for all operating systems.
 
6
 */
 
7
/*
 
8
 *
 
9
 * This file is part of Open Sound System.
 
10
 *
 
11
 * Copyright (C) 4Front Technologies 1996-2008.
 
12
 *
 
13
 * This this source file is released under GPL v2 license (no other versions).
 
14
 * See the COPYING file included in the main directory of this source
 
15
 * distribution for the license terms and conditions.
 
16
 *
 
17
 */
 
18
 
 
19
#include <oss_config.h>
 
20
#include "midi_core.h"
 
21
 
 
22
#ifdef DO_TIMINGS
 
23
extern oss_mutex_t oss_timing_mutex;
 
24
#endif
 
25
 
 
26
oss_history_t oss_history[OSS_HISTORY_SIZE] = { {0} };
 
27
int oss_history_p = 0;
 
28
 
 
29
int oss_num_cdevs = 0;
 
30
oss_cdev_t **oss_cdevs = NULL;
 
31
int oss_max_cdevs = 0;
 
32
 
 
33
static int drivers_loaded = 0;
 
34
 
 
35
void
 
36
oss_unload_drivers (void)
 
37
{
 
38
 
 
39
  if (!drivers_loaded)
 
40
    return;
 
41
  drivers_loaded = 0;
 
42
 
 
43
#ifdef CONFIG_OSS_VMIX
 
44
  vmix_core_uninit ();
 
45
#endif
 
46
 
 
47
  oss_audio_uninit ();
 
48
 
 
49
  /* oss_midi_uninit(); *//* TODO: This causes crashes */
 
50
#ifdef DO_TIMINGS
 
51
  MUTEX_CLEANUP (oss_timing_mutex);
 
52
#endif
 
53
 
 
54
  /*
 
55
   * Release all global memory
 
56
   */
 
57
  oss_memblk_unalloc(&oss_global_memblk);
 
58
}
 
59
 
 
60
/*ARGSUSED*/
 
61
void
 
62
create_new_card (char *shortname, char *longname)
 
63
{
 
64
}
 
65
 
 
66
void
 
67
oss_common_init (oss_device_t * osdev)
 
68
{
 
69
  if (drivers_loaded)
 
70
    return;
 
71
#ifdef DO_TIMINGS
 
72
  MUTEX_INIT (osdev, oss_timing_mutex, MH_TOP);
 
73
#endif
 
74
  drivers_loaded = 1;
 
75
  oss_audio_init (osdev);
 
76
  install_sndstat (osdev);
 
77
  install_vdsp (osdev);
 
78
  oss_midi_init (osdev);
 
79
  install_vmidi (osdev);
 
80
  install_dev_mixer (osdev);
 
81
#ifdef CONFIG_OSS_VMIX
 
82
  vmix_core_init (osdev);
 
83
#endif
 
84
}