Mercurial > ecos
comparison packages/kernel/current/include/instrmnt.h @ 2:443894e2e912 ecos-v1_2_1-release
Block commit of eCos version 1.2.1
| author | jlarmour |
|---|---|
| date | Tue, 11 May 1999 12:24:34 +0000 |
| parents | 3111d98ba7b3 |
| children | d376b777e2ce |
comparison
equal
deleted
inserted
replaced
| 1:72f549f0d891 | 2:443894e2e912 |
|---|---|
| 1 #ifndef CYGONCE_KERNEL_INSTRMNT_HXX | 1 #ifndef CYGONCE_KERNEL_INSTRMNT_HXX |
| 2 #define CYGONCE_KERNEL_INSTRMNT_HXX | 2 #define CYGONCE_KERNEL_INSTRMNT_HXX |
| 3 | 3 |
| 4 //========================================================================== | 4 //========================================================================== |
| 5 // | 5 // |
| 6 // instrmnt.hxx | 6 // instrmnt.hxx |
| 7 // | 7 // |
| 8 // Kernel Instrumentation mechanism | 8 // Kernel Instrumentation mechanism |
| 9 // | 9 // |
| 10 //========================================================================== | 10 //========================================================================== |
| 11 //####COPYRIGHTBEGIN#### | 11 //####COPYRIGHTBEGIN#### |
| 12 // | 12 // |
| 13 // ------------------------------------------- | 13 // ------------------------------------------- |
| 23 // | 23 // |
| 24 // The Original Code is eCos - Embedded Cygnus Operating System, released | 24 // The Original Code is eCos - Embedded Cygnus Operating System, released |
| 25 // September 30, 1998. | 25 // September 30, 1998. |
| 26 // | 26 // |
| 27 // The Initial Developer of the Original Code is Cygnus. Portions created | 27 // The Initial Developer of the Original Code is Cygnus. Portions created |
| 28 // by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. | 28 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. |
| 29 // ------------------------------------------- | 29 // ------------------------------------------- |
| 30 // | 30 // |
| 31 //####COPYRIGHTEND#### | 31 //####COPYRIGHTEND#### |
| 32 //========================================================================== | 32 //========================================================================== |
| 33 //#####DESCRIPTIONBEGIN#### | 33 //#####DESCRIPTIONBEGIN#### |
| 34 // | 34 // |
| 35 // Author(s): nickg | 35 // Author(s): nickg |
| 36 // Contributors: nickg | 36 // Contributors: nickg |
| 37 // Date: 1997-10-24 | 37 // Date: 1997-10-24 |
| 38 // Purpose: Define kernel instrumentation | 38 // Purpose: Define kernel instrumentation |
| 39 // Description: A set of definitions and macros used to implement an | 39 // Description: A set of definitions and macros used to implement an |
| 40 // instrumentation interface for the kernel. | 40 // instrumentation interface for the kernel. |
| 41 // Usage: #include <cyg/kernel/instrmnt.hxx> | 41 // Usage: #include <cyg/kernel/instrmnt.hxx> |
| 42 // | 42 // |
| 43 //####DESCRIPTIONEND#### | 43 //####DESCRIPTIONEND#### |
| 44 // | 44 // |
| 45 //========================================================================== | 45 //========================================================================== |
| 46 | 46 |
| 70 // ------------------------------------------------------------------------- | 70 // ------------------------------------------------------------------------- |
| 71 // Instrumentation macros | 71 // Instrumentation macros |
| 72 | 72 |
| 73 #ifdef CYGPKG_KERNEL_INSTRUMENT | 73 #ifdef CYGPKG_KERNEL_INSTRUMENT |
| 74 | 74 |
| 75 #define CYG_INSTRUMENT(_type_,_arg1_,_arg2_) cyg_instrument(_type_, CYG_ADDRWORD(_arg1_), CYG_ADDRWORD(_arg2_)) | 75 #define CYG_INSTRUMENT(_type_,_arg1_,_arg2_) cyg_instrument(_type_, (CYG_ADDRWORD)(_arg1_), (CYG_ADDRWORD)(_arg2_)) |
| 76 | 76 |
| 77 #else // ifdef CYGPKG_KERNEL_INSTRUMENT | 77 #else // ifdef CYGPKG_KERNEL_INSTRUMENT |
| 78 | 78 |
| 79 #define CYG_INSTRUMENT(_type_,_arg1_,_arg2_) | 79 #define CYG_INSTRUMENT(_type_,_arg1_,_arg2_) \ |
| 80 CYG_MACRO_START \ | |
| 81 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg1_)); \ | |
| 82 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg2_)); \ | |
| 83 CYG_MACRO_END | |
| 80 | 84 |
| 81 #endif // ifdef CYGPKG_KERNEL_INSTRUMENT | 85 #endif // ifdef CYGPKG_KERNEL_INSTRUMENT |
| 82 | 86 |
| 83 // ------------------------------------------------------------------------- | 87 // ------------------------------------------------------------------------- |
| 84 // Type codes. | 88 // Type codes. |
| 139 #define CYG_INSTRUMENT_EVENT_MUTEX_WAIT 2 | 143 #define CYG_INSTRUMENT_EVENT_MUTEX_WAIT 2 |
| 140 #define CYG_INSTRUMENT_EVENT_MUTEX_LOCKED 3 | 144 #define CYG_INSTRUMENT_EVENT_MUTEX_LOCKED 3 |
| 141 #define CYG_INSTRUMENT_EVENT_MUTEX_TRY 4 | 145 #define CYG_INSTRUMENT_EVENT_MUTEX_TRY 4 |
| 142 #define CYG_INSTRUMENT_EVENT_MUTEX_UNLOCK 5 | 146 #define CYG_INSTRUMENT_EVENT_MUTEX_UNLOCK 5 |
| 143 #define CYG_INSTRUMENT_EVENT_MUTEX_WAKE 6 | 147 #define CYG_INSTRUMENT_EVENT_MUTEX_WAKE 6 |
| 148 #define CYG_INSTRUMENT_EVENT_MUTEX_RELEASE 7 | |
| 149 #define CYG_INSTRUMENT_EVENT_MUTEX_RELEASED 8 | |
| 144 | 150 |
| 145 // Condition variable events | 151 // Condition variable events |
| 146 #define CYG_INSTRUMENT_EVENT_CONDVAR_WAIT 1 | 152 #define CYG_INSTRUMENT_EVENT_CONDVAR_WAIT 1 |
| 147 #define CYG_INSTRUMENT_EVENT_CONDVAR_WOKE 2 | 153 #define CYG_INSTRUMENT_EVENT_CONDVAR_WOKE 2 |
| 148 #define CYG_INSTRUMENT_EVENT_CONDVAR_SIGNAL 3 | 154 #define CYG_INSTRUMENT_EVENT_CONDVAR_SIGNAL 3 |
| 179 #define CYG_INSTRUMENT_EVENT_ALARM_INIT 4 | 185 #define CYG_INSTRUMENT_EVENT_ALARM_INIT 4 |
| 180 #define CYG_INSTRUMENT_EVENT_ALARM_TRIGGER 5 | 186 #define CYG_INSTRUMENT_EVENT_ALARM_TRIGGER 5 |
| 181 #define CYG_INSTRUMENT_EVENT_ALARM_INTERVAL 6 | 187 #define CYG_INSTRUMENT_EVENT_ALARM_INTERVAL 6 |
| 182 | 188 |
| 183 // Mboxt events | 189 // Mboxt events |
| 184 #define CYG_INSTRUMENT_EVENT_MBOXT_WAIT 1 | 190 #define CYG_INSTRUMENT_EVENT_MBOXT_WAIT 1 |
| 185 #define CYG_INSTRUMENT_EVENT_MBOXT_GET 2 | 191 #define CYG_INSTRUMENT_EVENT_MBOXT_GET 2 |
| 186 #define CYG_INSTRUMENT_EVENT_MBOXT_GOT 3 | 192 #define CYG_INSTRUMENT_EVENT_MBOXT_GOT 3 |
| 187 #define CYG_INSTRUMENT_EVENT_MBOXT_TIMEOUT 4 | 193 #define CYG_INSTRUMENT_EVENT_MBOXT_TIMEOUT 4 |
| 188 #define CYG_INSTRUMENT_EVENT_MBOXT_WAKE 5 | 194 #define CYG_INSTRUMENT_EVENT_MBOXT_WAKE 5 |
| 189 #define CYG_INSTRUMENT_EVENT_MBOXT_TRY 6 | 195 #define CYG_INSTRUMENT_EVENT_MBOXT_TRY 6 |
| 190 #define CYG_INSTRUMENT_EVENT_MBOXT_PUT 7 | 196 #define CYG_INSTRUMENT_EVENT_MBOXT_PUT 7 |
| 191 | 197 |
| 192 | 198 |
| 193 | 199 |
| 194 // User events | 200 // User events |
| 195 | 201 |
| 229 #define CYG_INSTRUMENT_SCHED(_event_,_arg1_,_arg2_) \ | 235 #define CYG_INSTRUMENT_SCHED(_event_,_arg1_,_arg2_) \ |
| 230 CYG_INSTRUMENT(CYGINST_EVENT(SCHED,_event_),_arg1_,_arg2_) | 236 CYG_INSTRUMENT(CYGINST_EVENT(SCHED,_event_),_arg1_,_arg2_) |
| 231 | 237 |
| 232 #else | 238 #else |
| 233 | 239 |
| 234 #define CYG_INSTRUMENT_SCHED(_event_,_arg1_,_arg2_) | 240 #define CYG_INSTRUMENT_SCHED(_event_,_arg1_,_arg2_) \ |
| 241 CYG_MACRO_START \ | |
| 242 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg1_)); \ | |
| 243 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg2_)); \ | |
| 244 CYG_MACRO_END | |
| 235 | 245 |
| 236 #endif | 246 #endif |
| 237 | 247 |
| 238 // ------------------------------------------------------------------------- | 248 // ------------------------------------------------------------------------- |
| 239 // Thread instrumentation macros | 249 // Thread instrumentation macros |
| 243 #define CYG_INSTRUMENT_THREAD(_event_,_arg1_,_arg2_) \ | 253 #define CYG_INSTRUMENT_THREAD(_event_,_arg1_,_arg2_) \ |
| 244 CYG_INSTRUMENT(CYGINST_EVENT(THREAD,_event_),_arg1_,_arg2_) | 254 CYG_INSTRUMENT(CYGINST_EVENT(THREAD,_event_),_arg1_,_arg2_) |
| 245 | 255 |
| 246 #else | 256 #else |
| 247 | 257 |
| 248 #define CYG_INSTRUMENT_THREAD(_event_,_arg1_,_arg2_) | 258 #define CYG_INSTRUMENT_THREAD(_event_,_arg1_,_arg2_) \ |
| 259 CYG_MACRO_START \ | |
| 260 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg1_)); \ | |
| 261 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg2_)); \ | |
| 262 CYG_MACRO_END | |
| 249 | 263 |
| 250 #endif | 264 #endif |
| 251 | 265 |
| 252 // ------------------------------------------------------------------------- | 266 // ------------------------------------------------------------------------- |
| 253 // Interrupt instrumentation macros | 267 // Interrupt instrumentation macros |
| 257 #define CYG_INSTRUMENT_INTR(_event_,_arg1_,_arg2_) \ | 271 #define CYG_INSTRUMENT_INTR(_event_,_arg1_,_arg2_) \ |
| 258 CYG_INSTRUMENT(CYGINST_EVENT(INTR,_event_),_arg1_,_arg2_) | 272 CYG_INSTRUMENT(CYGINST_EVENT(INTR,_event_),_arg1_,_arg2_) |
| 259 | 273 |
| 260 #else | 274 #else |
| 261 | 275 |
| 262 #define CYG_INSTRUMENT_INTR(_event_,_arg1_,_arg2_) | 276 #define CYG_INSTRUMENT_INTR(_event_,_arg1_,_arg2_) \ |
| 277 CYG_MACRO_START \ | |
| 278 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg1_)); \ | |
| 279 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg2_)); \ | |
| 280 CYG_MACRO_END | |
| 263 | 281 |
| 264 #endif | 282 #endif |
| 265 | 283 |
| 266 // ------------------------------------------------------------------------- | 284 // ------------------------------------------------------------------------- |
| 267 // Mutex instrumentation macros | 285 // Mutex instrumentation macros |
| 271 #define CYG_INSTRUMENT_MUTEX(_event_,_arg1_,_arg2_) \ | 289 #define CYG_INSTRUMENT_MUTEX(_event_,_arg1_,_arg2_) \ |
| 272 CYG_INSTRUMENT(CYGINST_EVENT(MUTEX,_event_),_arg1_,_arg2_) | 290 CYG_INSTRUMENT(CYGINST_EVENT(MUTEX,_event_),_arg1_,_arg2_) |
| 273 | 291 |
| 274 #else | 292 #else |
| 275 | 293 |
| 276 #define CYG_INSTRUMENT_MUTEX(_event_,_arg1_,_arg2_) | 294 #define CYG_INSTRUMENT_MUTEX(_event_,_arg1_,_arg2_) \ |
| 295 CYG_MACRO_START \ | |
| 296 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg1_)); \ | |
| 297 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg2_)); \ | |
| 298 CYG_MACRO_END | |
| 277 | 299 |
| 278 #endif | 300 #endif |
| 279 | 301 |
| 280 // ------------------------------------------------------------------------- | 302 // ------------------------------------------------------------------------- |
| 281 // Condition variable instrumentation macros | 303 // Condition variable instrumentation macros |
| 285 #define CYG_INSTRUMENT_CONDVAR(_event_,_arg1_,_arg2_) \ | 307 #define CYG_INSTRUMENT_CONDVAR(_event_,_arg1_,_arg2_) \ |
| 286 CYG_INSTRUMENT(CYGINST_EVENT(CONDVAR,_event_),_arg1_,_arg2_) | 308 CYG_INSTRUMENT(CYGINST_EVENT(CONDVAR,_event_),_arg1_,_arg2_) |
| 287 | 309 |
| 288 #else | 310 #else |
| 289 | 311 |
| 290 #define CYG_INSTRUMENT_CONDVAR(_event_,_arg1_,_arg2_) | 312 #define CYG_INSTRUMENT_CONDVAR(_event_,_arg1_,_arg2_) \ |
| 313 CYG_MACRO_START \ | |
| 314 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg1_)); \ | |
| 315 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg2_)); \ | |
| 316 CYG_MACRO_END | |
| 291 | 317 |
| 292 #endif | 318 #endif |
| 293 | 319 |
| 294 // ------------------------------------------------------------------------- | 320 // ------------------------------------------------------------------------- |
| 295 // Binary semaphore instrumentation macros | 321 // Binary semaphore instrumentation macros |
| 299 #define CYG_INSTRUMENT_BINSEM(_event_,_arg1_,_arg2_) \ | 325 #define CYG_INSTRUMENT_BINSEM(_event_,_arg1_,_arg2_) \ |
| 300 CYG_INSTRUMENT(CYGINST_EVENT(BINSEM,_event_),_arg1_,_arg2_) | 326 CYG_INSTRUMENT(CYGINST_EVENT(BINSEM,_event_),_arg1_,_arg2_) |
| 301 | 327 |
| 302 #else | 328 #else |
| 303 | 329 |
| 304 #define CYG_INSTRUMENT_BINSEM(_event_,_arg1_,_arg2_) | 330 #define CYG_INSTRUMENT_BINSEM(_event_,_arg1_,_arg2_) \ |
| 331 CYG_MACRO_START \ | |
| 332 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg1_)); \ | |
| 333 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg2_)); \ | |
| 334 CYG_MACRO_END | |
| 305 | 335 |
| 306 #endif | 336 #endif |
| 307 | 337 |
| 308 // ------------------------------------------------------------------------- | 338 // ------------------------------------------------------------------------- |
| 309 // Counting semaphore instrumentation macros | 339 // Counting semaphore instrumentation macros |
| 313 #define CYG_INSTRUMENT_CNTSEM(_event_,_arg1_,_arg2_) \ | 343 #define CYG_INSTRUMENT_CNTSEM(_event_,_arg1_,_arg2_) \ |
| 314 CYG_INSTRUMENT(CYGINST_EVENT(CNTSEM,_event_),_arg1_,_arg2_) | 344 CYG_INSTRUMENT(CYGINST_EVENT(CNTSEM,_event_),_arg1_,_arg2_) |
| 315 | 345 |
| 316 #else | 346 #else |
| 317 | 347 |
| 318 #define CYG_INSTRUMENT_CNTSEM(_event_,_arg1_,_arg2_) | 348 #define CYG_INSTRUMENT_CNTSEM(_event_,_arg1_,_arg2_) \ |
| 349 CYG_MACRO_START \ | |
| 350 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg1_)); \ | |
| 351 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg2_)); \ | |
| 352 CYG_MACRO_END | |
| 319 | 353 |
| 320 #endif | 354 #endif |
| 321 | 355 |
| 322 // ------------------------------------------------------------------------- | 356 // ------------------------------------------------------------------------- |
| 323 // Clock instrumentation macros | 357 // Clock instrumentation macros |
| 327 #define CYG_INSTRUMENT_CLOCK(_event_,_arg1_,_arg2_) \ | 361 #define CYG_INSTRUMENT_CLOCK(_event_,_arg1_,_arg2_) \ |
| 328 CYG_INSTRUMENT(CYGINST_EVENT(CLOCK,_event_),_arg1_,_arg2_) | 362 CYG_INSTRUMENT(CYGINST_EVENT(CLOCK,_event_),_arg1_,_arg2_) |
| 329 | 363 |
| 330 #else | 364 #else |
| 331 | 365 |
| 332 #define CYG_INSTRUMENT_CLOCK(_event_,_arg1_,_arg2_) | 366 #define CYG_INSTRUMENT_CLOCK(_event_,_arg1_,_arg2_) \ |
| 367 CYG_MACRO_START \ | |
| 368 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg1_)); \ | |
| 369 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg2_)); \ | |
| 370 CYG_MACRO_END | |
| 333 | 371 |
| 334 #endif | 372 #endif |
| 335 | 373 |
| 336 // ------------------------------------------------------------------------- | 374 // ------------------------------------------------------------------------- |
| 337 // Alarm instrumentation macros | 375 // Alarm instrumentation macros |
| 341 #define CYG_INSTRUMENT_ALARM(_event_,_arg1_,_arg2_) \ | 379 #define CYG_INSTRUMENT_ALARM(_event_,_arg1_,_arg2_) \ |
| 342 CYG_INSTRUMENT(CYGINST_EVENT(ALARM,_event_),_arg1_,_arg2_) | 380 CYG_INSTRUMENT(CYGINST_EVENT(ALARM,_event_),_arg1_,_arg2_) |
| 343 | 381 |
| 344 #else | 382 #else |
| 345 | 383 |
| 346 #define CYG_INSTRUMENT_ALARM(_event_,_arg1_,_arg2_) | 384 #define CYG_INSTRUMENT_ALARM(_event_,_arg1_,_arg2_) \ |
| 385 CYG_MACRO_START \ | |
| 386 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg1_)); \ | |
| 387 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg2_)); \ | |
| 388 CYG_MACRO_END | |
| 347 | 389 |
| 348 #endif | 390 #endif |
| 349 | 391 |
| 350 // ------------------------------------------------------------------------- | 392 // ------------------------------------------------------------------------- |
| 351 // Mboxt instrumentation macros | 393 // Mboxt instrumentation macros |
| 355 #define CYG_INSTRUMENT_MBOXT(_event_,_arg1_,_arg2_) \ | 397 #define CYG_INSTRUMENT_MBOXT(_event_,_arg1_,_arg2_) \ |
| 356 CYG_INSTRUMENT(CYGINST_EVENT(MBOXT,_event_),_arg1_,_arg2_) | 398 CYG_INSTRUMENT(CYGINST_EVENT(MBOXT,_event_),_arg1_,_arg2_) |
| 357 | 399 |
| 358 #else | 400 #else |
| 359 | 401 |
| 360 #define CYG_INSTRUMENT_MBOXT(_event_,_arg1_,_arg2_) | 402 #define CYG_INSTRUMENT_MBOXT(_event_,_arg1_,_arg2_) \ |
| 403 CYG_MACRO_START \ | |
| 404 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg1_)); \ | |
| 405 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg2_)); \ | |
| 406 CYG_MACRO_END | |
| 361 | 407 |
| 362 #endif | 408 #endif |
| 363 | 409 |
| 364 // ------------------------------------------------------------------------- | 410 // ------------------------------------------------------------------------- |
| 365 // User instrumentation | 411 // User instrumentation |
| 369 #define CYG_INSTRUMENT_USER(_event_,_arg1_,_arg2_) \ | 415 #define CYG_INSTRUMENT_USER(_event_,_arg1_,_arg2_) \ |
| 370 CYG_INSTRUMENT(CYGINST_EVENT(USER,_event_),_arg1_,_arg2_) | 416 CYG_INSTRUMENT(CYGINST_EVENT(USER,_event_),_arg1_,_arg2_) |
| 371 | 417 |
| 372 #else | 418 #else |
| 373 | 419 |
| 374 #define CYG_INSTRUMENT_USER(_event_,_arg1_,_arg2_) | 420 #define CYG_INSTRUMENT_USER(_event_,_arg1_,_arg2_) \ |
| 421 CYG_MACRO_START \ | |
| 422 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg1_)); \ | |
| 423 CYG_UNUSED_PARAM(CYG_ADDRWORD, (CYG_ADDRWORD)(_arg2_)); \ | |
| 424 CYG_MACRO_END | |
| 375 | 425 |
| 376 #endif | 426 #endif |
| 377 | 427 |
| 378 | 428 |
| 379 // ------------------------------------------------------------------------- | 429 // ------------------------------------------------------------------------- |
