~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to erts/emulator/beam/erl_cpu_topology.h

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * %CopyrightBegin%
 
3
 *
 
4
 * Copyright Ericsson AB 2010. All Rights Reserved.
 
5
 *
 
6
 * The contents of this file are subject to the Erlang Public License,
 
7
 * Version 1.1, (the "License"); you may not use this file except in
 
8
 * compliance with the License. You should have received a copy of the
 
9
 * Erlang Public License along with this software. If not, it can be
 
10
 * retrieved online at http://www.erlang.org/.
 
11
 *
 
12
 * Software distributed under the License is distributed on an "AS IS"
 
13
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
14
 * the License for the specific language governing rights and limitations
 
15
 * under the License.
 
16
 *
 
17
 * %CopyrightEnd%
 
18
 */
 
19
 
 
20
/*
 
21
 * Description: CPU topology and related functionality
 
22
 *
 
23
 * Author:      Rickard Green
 
24
 */
 
25
 
 
26
#ifndef ERL_CPU_TOPOLOGY_H__
 
27
#define ERL_CPU_TOPOLOGY_H__
 
28
 
 
29
void erts_pre_early_init_cpu_topology(int *max_rg_p,
 
30
                                      int *conf_p,
 
31
                                      int *onln_p,
 
32
                                      int *avail_p);
 
33
void erts_early_init_cpu_topology(int no_schedulers,
 
34
                                  int *max_main_threads_p,
 
35
                                  int max_reader_groups,
 
36
                                  int *reader_groups_p);
 
37
void erts_init_cpu_topology(void);
 
38
 
 
39
 
 
40
#define ERTS_INIT_SCHED_BIND_TYPE_SUCCESS               0
 
41
#define ERTS_INIT_SCHED_BIND_TYPE_NOT_SUPPORTED         1
 
42
#define ERTS_INIT_SCHED_BIND_TYPE_ERROR_NO_CPU_TOPOLOGY 2
 
43
#define ERTS_INIT_SCHED_BIND_TYPE_ERROR_NO_BAD_TYPE     3
 
44
 
 
45
int erts_init_scheduler_bind_type_string(char *how);
 
46
 
 
47
 
 
48
#define ERTS_INIT_CPU_TOPOLOGY_OK                       0
 
49
#define ERTS_INIT_CPU_TOPOLOGY_INVALID_ID               1
 
50
#define ERTS_INIT_CPU_TOPOLOGY_INVALID_ID_RANGE         2
 
51
#define ERTS_INIT_CPU_TOPOLOGY_INVALID_HIERARCHY        3
 
52
#define ERTS_INIT_CPU_TOPOLOGY_INVALID_ID_TYPE          4
 
53
#define ERTS_INIT_CPU_TOPOLOGY_INVALID_NODES            5
 
54
#define ERTS_INIT_CPU_TOPOLOGY_MISSING_LID              6
 
55
#define ERTS_INIT_CPU_TOPOLOGY_NOT_UNIQUE_LIDS          7
 
56
#define ERTS_INIT_CPU_TOPOLOGY_NOT_UNIQUE_ENTITIES      8
 
57
#define ERTS_INIT_CPU_TOPOLOGY_MISSING                  9
 
58
 
 
59
int erts_init_cpu_topology_string(char *topology_str);
 
60
 
 
61
void erts_sched_check_cpu_bind(ErtsSchedulerData *esdp);
 
62
#ifdef ERTS_SMP
 
63
void erts_sched_init_check_cpu_bind(ErtsSchedulerData *esdp);
 
64
void erts_sched_check_cpu_bind_prep_suspend(ErtsSchedulerData *esdp);
 
65
void erts_sched_check_cpu_bind_post_suspend(ErtsSchedulerData *esdp);
 
66
#endif
 
67
 
 
68
int erts_update_cpu_info(void);
 
69
 
 
70
Eterm erts_bind_schedulers(Process *c_p, Eterm how);
 
71
Eterm erts_get_schedulers_binds(Process *c_p);
 
72
 
 
73
Eterm erts_get_reader_groups_map(Process *c_p);
 
74
 
 
75
Eterm erts_set_cpu_topology(Process *c_p, Eterm term);
 
76
Eterm erts_get_cpu_topology_term(Process *c_p, Eterm which);
 
77
 
 
78
int erts_update_cpu_info(void);
 
79
void erts_get_logical_processors(int *conf, int *onln, int *avail);
 
80
 
 
81
int erts_sched_bind_atthrcreate_prepare(void);
 
82
int erts_sched_bind_atthrcreate_child(int unbind);
 
83
void erts_sched_bind_atthrcreate_parent(int unbind);
 
84
 
 
85
int erts_sched_bind_atfork_prepare(void);
 
86
int erts_sched_bind_atfork_child(int unbind);
 
87
char *erts_sched_bind_atvfork_child(int unbind);
 
88
void erts_sched_bind_atfork_parent(int unbind);
 
89
 
 
90
Eterm erts_fake_scheduler_bindings(Process *p, Eterm how);
 
91
Eterm erts_debug_cpu_groups_map(Process *c_p, int groups);
 
92
 
 
93
 
 
94
typedef void (*erts_cpu_groups_callback_t)(int,
 
95
                                           ErtsSchedulerData *,
 
96
                                           int,
 
97
                                           void *);
 
98
 
 
99
void erts_add_cpu_groups(int groups,
 
100
                         erts_cpu_groups_callback_t callback,
 
101
                         void *arg);
 
102
void erts_remove_cpu_groups(erts_cpu_groups_callback_t callback,
 
103
                            void *arg);
 
104
 
 
105
#endif