1 .\"
2 .\" Mach Operating System
3 .\" Copyright (c) 1991,1990 Carnegie Mellon University
4 .\" All Rights Reserved.
5 .\"
6 .\" Permission to use, copy, modify and distribute this software and its
7 .\" documentation is hereby granted, provided that both the copyright
8 .\" notice and this permission notice appear in all copies of the
9 .\" software, derivative works or modified versions, and any portions
10 .\" thereof, and that both notices appear in supporting documentation.
11 .\"
12 .\" CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 .\" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 .\" ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 .\"
16 .\" Carnegie Mellon requests users of this software to return to
17 .\"
18 .\" Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 .\" School of Computer Science
20 .\" Carnegie Mellon University
21 .\" Pittsburgh PA 15213-3890
22 .\"
23 .\" any improvements or extensions that they make and grant Carnegie Mellon
24 .\" the rights to redistribute these changes.
25 .\"
26 .\" HISTORY
27 .\" $Log: task_ras_control.man,v $
28 .\" Revision 2.2 93/03/18 15:15:15 mrt
29 .\" Created by Brian Bershad
30 .\" [93/03/18 bershad]
31 .\"
32 .\"
33 .TH task_ras_control 2 7/21/92
34 .CM 4
35 .SH NAME
36 .nf
37 task_ras_control \- set pc range of task's restartable atomic sequence
38 .SH SYNOPSIS
39 .nf
40 .ft B
41 #include <mach.h>
42
43 .nf
44 .ft B
45 kern_return_t
46 task_ras_control(
47 task_t target_task,
48 vm_offset_t start_pc,
49 vm_offset_t end_pc,
50 int flavor)
51 .fi
52 .ft P
53 .SH ARGUMENTS
54 .TP 15
55 .B
56 target_task
57 The task for which the sequence should be set.
58 .TP 15
59 .B
60 start_pc
61 The starting address of this restartable atomic sequence.
62 .TP 15
63 .B
64 end_pc
65 The ending address of this restartable atomic sequence.
66 .TP 15
67 .B
68 flavor
69 The particular operation that should be applied to this restartable atomic
70 sequence. Flavor can be one of
71 .B TASK_RAS_CONTROL_PURGE_ALL
72 , which removes all registered sequences for this task,
73 .B TASK_RAS_CONTROL_PURGE_ONE
74 , which removes the named registered sequence for this task, and
75 .B TASK_RAS_CONTROL_PURGE_ALL_AND_INSTALL_ONE
76 , which atomically removes all registered sequences and installs the named
77 sequence,
78 .B TASK_RAS_CONTROL_INSTALL_ONE
79 , which installs this sequence.
80
81
82 .SH DESCRIPTION
83
84 Manipulates a task's set of
85 restartable atomic sequences. If a sequence is installed, and
86 any thread in the task is preempted
87 within the range [start_pc,end_pc], then the thread is resumed at
88 start_pc. This enables applications to build atomic sequences which,
89 when executed to completion, will have executed atomically.
90 Restartable atomic sequences are intended to be used on systems that
91 do not have hardware support for low-overhead atomic primitives.
92
93 As a thread can be rolled-back, the code in the sequence should have
94 no side effects other than a final store at end_pc. The kernel does
95 not guarantee that the sequence is restartable. It assumes the
96 application knows what it's doing.
97
98 A task may have a finite number of atomic sequences that is defined at
99 compile time.
100
101 .SH DIAGNOSTICS
102 .TP 25
103 KERN_SUCCESS
104 The operation has been performed.
105 .TP 25
106 KERN_INVALID_ADDRESS
107 The start_pc or end_pc values are not a valid address for the requested
108 operation. For example, it is invalid to purge a sequence that has not been
109 registered.
110 .TP 25
111 KERN_RESOURCE_SHORTAGE
112 An attempt was made to install more restartable atomic sequences for a task
113 than can be supported by the kernel.
114 .TP 25
115 KERN_INVALID_VALUE
116 A bad flavor was specified.
117 .TP 25
118 KERN_INVALID_ARGUMENT
119 .B target_task
120 is not a task.
121 .TP 25
122 .B
123 KERN_FAILURE
124 The call is not not supported on this configuration.
125
126 .SH SEE ALSO
127 Fast Mutual Exclusion for Uniprocessors (1992 ASPLOS).
128
129
130
131
Cache object: a19e6f3dd82c4291ce0930417fd110f8
|