Mercurial > ecos
comparison packages/kernel/current/include/kapi.h @ 208:e0c0827131d1 ecos
Merge from eCos master repository on 2002-05-20-20:11:54-BST
| author | jlarmour |
|---|---|
| date | Mon, 20 May 2002 22:19:26 +0000 |
| parents | d61da071934c |
| children | d2c90368aeef |
comparison
equal
deleted
inserted
replaced
| 207:74c807ddde34 | 208:e0c0827131d1 |
|---|---|
| 6 // kapi.h | 6 // kapi.h |
| 7 // | 7 // |
| 8 // Native API for Kernel | 8 // Native API for Kernel |
| 9 // | 9 // |
| 10 //========================================================================== | 10 //========================================================================== |
| 11 //####COPYRIGHTBEGIN#### | 11 //####ECOSGPLCOPYRIGHTBEGIN#### |
| 12 // | 12 // ------------------------------------------- |
| 13 // ------------------------------------------- | 13 // This file is part of eCos, the Embedded Configurable Operating System. |
| 14 // The contents of this file are subject to the Red Hat eCos Public License | 14 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. |
| 15 // Version 1.1 (the "License"); you may not use this file except in | 15 // |
| 16 // compliance with the License. You may obtain a copy of the License at | 16 // eCos is free software; you can redistribute it and/or modify it under |
| 17 // http://www.redhat.com/ | 17 // the terms of the GNU General Public License as published by the Free |
| 18 // | 18 // Software Foundation; either version 2 or (at your option) any later version. |
| 19 // Software distributed under the License is distributed on an "AS IS" | 19 // |
| 20 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | 20 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY |
| 21 // License for the specific language governing rights and limitations under | 21 // WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 22 // the License. | 22 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 23 // | 23 // for more details. |
| 24 // The Original Code is eCos - Embedded Configurable Operating System, | 24 // |
| 25 // released September 30, 1998. | 25 // You should have received a copy of the GNU General Public License along |
| 26 // | 26 // with eCos; if not, write to the Free Software Foundation, Inc., |
| 27 // The Initial Developer of the Original Code is Red Hat. | 27 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
| 28 // Portions created by Red Hat are | 28 // |
| 29 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. | 29 // As a special exception, if other files instantiate templates or use macros |
| 30 // All Rights Reserved. | 30 // or inline functions from this file, or you compile this file and link it |
| 31 // ------------------------------------------- | 31 // with other works to produce a work based on this file, this file does not |
| 32 // | 32 // by itself cause the resulting work to be covered by the GNU General Public |
| 33 //####COPYRIGHTEND#### | 33 // License. However the source code for this file must still be made available |
| 34 // in accordance with section (3) of the GNU General Public License. | |
| 35 // | |
| 36 // This exception does not invalidate any other reasons why a work based on | |
| 37 // this file might be covered by the GNU General Public License. | |
| 38 // | |
| 39 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. | |
| 40 // at http://sources.redhat.com/ecos/ecos-license | |
| 41 // ------------------------------------------- | |
| 42 //####ECOSGPLCOPYRIGHTEND#### | |
| 34 //========================================================================== | 43 //========================================================================== |
| 35 //#####DESCRIPTIONBEGIN#### | 44 //#####DESCRIPTIONBEGIN#### |
| 36 // | 45 // |
| 37 // Author(s): nickg, dsm | 46 // Author(s): nickg, dsm |
| 38 // Contributors: nickg | 47 // Contributors: nickg |
| 116 | 125 |
| 117 /*---------------------------------------------------------------------------*/ | 126 /*---------------------------------------------------------------------------*/ |
| 118 /* Scheduler operations */ | 127 /* Scheduler operations */ |
| 119 | 128 |
| 120 /* Starts scheduler with created threads. Never returns. */ | 129 /* Starts scheduler with created threads. Never returns. */ |
| 121 void cyg_scheduler_start(void) __attribute__ ((noreturn)); | 130 void cyg_scheduler_start(void) CYGBLD_ATTRIB_NORET; |
| 122 | 131 |
| 123 /* Lock and unlock the scheduler. When the scheduler is */ | 132 /* Lock and unlock the scheduler. When the scheduler is */ |
| 124 /* locked thread preemption is disabled. */ | 133 /* locked thread preemption is disabled. */ |
| 125 void cyg_scheduler_lock(void); | 134 void cyg_scheduler_lock(void); |
| 126 | 135 |
| 288 | 297 |
| 289 void cyg_interrupt_enable(void); | 298 void cyg_interrupt_enable(void); |
| 290 | 299 |
| 291 /* Interrupt controller access */ | 300 /* Interrupt controller access */ |
| 292 void cyg_interrupt_mask(cyg_vector_t vector); | 301 void cyg_interrupt_mask(cyg_vector_t vector); |
| 302 void cyg_interrupt_mask_intunsafe(cyg_vector_t vector); | |
| 293 | 303 |
| 294 void cyg_interrupt_unmask(cyg_vector_t vector); | 304 void cyg_interrupt_unmask(cyg_vector_t vector); |
| 305 void cyg_interrupt_unmask_intunsafe(cyg_vector_t vector); | |
| 295 | 306 |
| 296 void cyg_interrupt_acknowledge(cyg_vector_t vector); | 307 void cyg_interrupt_acknowledge(cyg_vector_t vector); |
| 297 | 308 |
| 298 void cyg_interrupt_configure( | 309 void cyg_interrupt_configure( |
| 299 cyg_vector_t vector, /* vector to configure */ | 310 cyg_vector_t vector, /* vector to configure */ |
| 329 cyg_tick_count_t new_value | 340 cyg_tick_count_t new_value |
| 330 ); | 341 ); |
| 331 | 342 |
| 332 /* Advance counter by one tick */ | 343 /* Advance counter by one tick */ |
| 333 void cyg_counter_tick(cyg_handle_t counter); | 344 void cyg_counter_tick(cyg_handle_t counter); |
| 345 | |
| 346 /* Advance counter by multiple ticks */ | |
| 347 void cyg_counter_multi_tick(cyg_handle_t counter, cyg_tick_count_t ticks); | |
| 334 | 348 |
| 335 | 349 |
| 336 #define CYG_RESOLUTION_T_MEMBERS \ | 350 #define CYG_RESOLUTION_T_MEMBERS \ |
| 337 cyg_uint32 dividend; \ | 351 cyg_uint32 dividend; \ |
| 338 cyg_uint32 divisor; | 352 cyg_uint32 divisor; |
| 390 | 404 |
| 391 void cyg_alarm_initialize( | 405 void cyg_alarm_initialize( |
| 392 cyg_handle_t alarm, | 406 cyg_handle_t alarm, |
| 393 cyg_tick_count_t trigger, /* Absolute trigger time */ | 407 cyg_tick_count_t trigger, /* Absolute trigger time */ |
| 394 cyg_tick_count_t interval /* Relative retrigger interval */ | 408 cyg_tick_count_t interval /* Relative retrigger interval */ |
| 409 ); | |
| 410 | |
| 411 void cyg_alarm_get_times( | |
| 412 cyg_handle_t alarm, | |
| 413 cyg_tick_count_t *trigger, /* Next trigger time */ | |
| 414 cyg_tick_count_t *interval /* Current interval */ | |
| 395 ); | 415 ); |
| 396 | 416 |
| 397 void cyg_alarm_enable( cyg_handle_t alarm ); | 417 void cyg_alarm_enable( cyg_handle_t alarm ); |
| 398 | 418 |
| 399 void cyg_alarm_disable( cyg_handle_t alarm ); | 419 void cyg_alarm_disable( cyg_handle_t alarm ); |
