OsdSchedule.c (93818) | OsdSchedule.c (96926) |
---|---|
1/*- 2 * Copyright (c) 2000 Michael Smith 3 * Copyright (c) 2000 BSDi 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * | 1/*- 2 * Copyright (c) 2000 Michael Smith 3 * Copyright (c) 2000 BSDi 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * |
27 * $FreeBSD: head/sys/dev/acpica/Osd/OsdSchedule.c 93818 2002-04-04 21:03:38Z jhb $ | 27 * $FreeBSD: head/sys/dev/acpica/Osd/OsdSchedule.c 96926 2002-05-19 06:16:47Z peter $ |
28 */ 29 30/* 31 * 6.3 : Scheduling services 32 */ 33 34#include "acpi.h" 35 --- 123 unchanged lines hidden (view full) --- 159#endif 160 161ACPI_STATUS 162AcpiOsQueueForExecution(UINT32 Priority, OSD_EXECUTION_CALLBACK Function, void *Context) 163{ 164 struct acpi_task *at; 165 int pri; 166 | 28 */ 29 30/* 31 * 6.3 : Scheduling services 32 */ 33 34#include "acpi.h" 35 --- 123 unchanged lines hidden (view full) --- 159#endif 160 161ACPI_STATUS 162AcpiOsQueueForExecution(UINT32 Priority, OSD_EXECUTION_CALLBACK Function, void *Context) 163{ 164 struct acpi_task *at; 165 int pri; 166 |
167 ACPI_FUNCTION_TRACE(__func__); | 167 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); |
168 169 if (Function == NULL) 170 return_ACPI_STATUS(AE_BAD_PARAMETER); 171 172 at = malloc(sizeof(*at), M_ACPITASK, M_NOWAIT); /* Interrupt Context */ 173 if (at == NULL) 174 return_ACPI_STATUS(AE_NO_MEMORY); 175 bzero(at, sizeof(*at)); --- 26 unchanged lines hidden (view full) --- 202static void 203AcpiOsExecuteQueue(void *arg, int pending) 204{ 205 struct acpi_task *at; 206 struct acpi_task_queue *atq; 207 OSD_EXECUTION_CALLBACK Function; 208 void *Context; 209 | 168 169 if (Function == NULL) 170 return_ACPI_STATUS(AE_BAD_PARAMETER); 171 172 at = malloc(sizeof(*at), M_ACPITASK, M_NOWAIT); /* Interrupt Context */ 173 if (at == NULL) 174 return_ACPI_STATUS(AE_NO_MEMORY); 175 bzero(at, sizeof(*at)); --- 26 unchanged lines hidden (view full) --- 202static void 203AcpiOsExecuteQueue(void *arg, int pending) 204{ 205 struct acpi_task *at; 206 struct acpi_task_queue *atq; 207 OSD_EXECUTION_CALLBACK Function; 208 void *Context; 209 |
210 ACPI_FUNCTION_TRACE(__func__); | 210 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); |
211 212 at = (struct acpi_task *)arg; 213 atq = NULL; 214 Function = NULL; 215 Context = NULL; 216 217#ifdef ACPI_USE_THREADS 218 atq = malloc(sizeof(*atq), M_ACPITASK, M_NOWAIT); --- 24 unchanged lines hidden (view full) --- 243 * make do with that. 244 */ 245void 246AcpiOsSleep (UINT32 Seconds, UINT32 Milliseconds) 247{ 248 int timo; 249 static int dummy; 250 | 211 212 at = (struct acpi_task *)arg; 213 atq = NULL; 214 Function = NULL; 215 Context = NULL; 216 217#ifdef ACPI_USE_THREADS 218 atq = malloc(sizeof(*atq), M_ACPITASK, M_NOWAIT); --- 24 unchanged lines hidden (view full) --- 243 * make do with that. 244 */ 245void 246AcpiOsSleep (UINT32 Seconds, UINT32 Milliseconds) 247{ 248 int timo; 249 static int dummy; 250 |
251 ACPI_FUNCTION_TRACE(__func__); | 251 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); |
252 253 timo = (Seconds * hz) + Milliseconds * hz / 1000; 254 if (timo == 0) 255 timo = 1; 256 tsleep(&dummy, 0, "acpislp", timo); 257 return_VOID; 258} 259 260void 261AcpiOsStall (UINT32 Microseconds) 262{ | 252 253 timo = (Seconds * hz) + Milliseconds * hz / 1000; 254 if (timo == 0) 255 timo = 1; 256 tsleep(&dummy, 0, "acpislp", timo); 257 return_VOID; 258} 259 260void 261AcpiOsStall (UINT32 Microseconds) 262{ |
263 ACPI_FUNCTION_TRACE(__func__); | 263 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); |
264 265 DELAY(Microseconds); 266 return_VOID; 267} 268 269UINT32 270AcpiOsGetThreadId (void) 271{ 272 /* XXX do not add FUNCTION_TRACE here, results in recursive call */ 273 274 KASSERT(curproc != NULL, ("%s: curproc is NULL!", __func__)); 275 return(curproc->p_pid + 1); /* can't return 0 */ 276} | 264 265 DELAY(Microseconds); 266 return_VOID; 267} 268 269UINT32 270AcpiOsGetThreadId (void) 271{ 272 /* XXX do not add FUNCTION_TRACE here, results in recursive call */ 273 274 KASSERT(curproc != NULL, ("%s: curproc is NULL!", __func__)); 275 return(curproc->p_pid + 1); /* can't return 0 */ 276} |