1 | /* |
2 | Copyright (c) 2012, Broadcom Europe Ltd |
3 | All rights reserved. |
4 | |
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the following conditions are met: |
7 | * Redistributions of source code must retain the above copyright |
8 | notice, this list of conditions and the following disclaimer. |
9 | * Redistributions in binary form must reproduce the above copyright |
10 | notice, this list of conditions and the following disclaimer in the |
11 | documentation and/or other materials provided with the distribution. |
12 | * Neither the name of the copyright holder nor the |
13 | names of its contributors may be used to endorse or promote products |
14 | derived from this software without specific prior written permission. |
15 | |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY |
20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ |
27 | |
28 | #ifndef VCHI_CFG_INTERNAL_H_ |
29 | #define VCHI_CFG_INTERNAL_H_ |
30 | |
31 | /**************************************************************************************** |
32 | * Control optimisation attempts. |
33 | ***************************************************************************************/ |
34 | |
35 | // Don't use lots of short-term locks - use great long ones, reducing the overall locks-per-second |
36 | #define VCHI_COARSE_LOCKING |
37 | |
38 | // Avoid lock then unlock on exit from blocking queue operations (msg tx, bulk rx/tx) |
39 | // (only relevant if VCHI_COARSE_LOCKING) |
40 | #define VCHI_ELIDE_BLOCK_EXIT_LOCK |
41 | |
42 | // Avoid lock on non-blocking peek |
43 | // (only relevant if VCHI_COARSE_LOCKING) |
44 | #define VCHI_AVOID_PEEK_LOCK |
45 | |
46 | // Use one slot-handler thread per connection, rather than 1 thread dealing with all connections in rotation. |
47 | #define VCHI_MULTIPLE_HANDLER_THREADS |
48 | |
49 | // Put free descriptors onto the head of the free queue, rather than the tail, so that we don't thrash |
50 | // our way through the pool of descriptors. |
51 | #define VCHI_PUSH_FREE_DESCRIPTORS_ONTO_HEAD |
52 | |
53 | // Don't issue a MSG_AVAILABLE callback for every single message. Possibly only safe if VCHI_COARSE_LOCKING. |
54 | #define VCHI_FEWER_MSG_AVAILABLE_CALLBACKS |
55 | |
56 | // Don't use message descriptors for TX messages that don't need them |
57 | #define VCHI_MINIMISE_TX_MSG_DESCRIPTORS |
58 | |
59 | // Nano-locks for multiqueue |
60 | //#define VCHI_MQUEUE_NANOLOCKS |
61 | |
62 | // Lock-free(er) dequeuing |
63 | //#define VCHI_RX_NANOLOCKS |
64 | |
65 | #endif /*VCHI_CFG_INTERNAL_H_*/ |
66 | |