Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,83 +0,0 @@
1
-/*
2
- * Copyright (C) 2007 iptelorg GmbH
3
- *
4
- * Permission to use, copy, modify, and distribute this software for any
5
- * purpose with or without fee is hereby granted, provided that the above
6
- * copyright notice and this permission notice appear in all copies.
7
- *
8
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
- */
16
-
17
-/*!
18
- * \file
19
- * \brief Kamailio core :: Compiler specific optimizations
20
- * \see \ref CompilerOptions
21
- * \auth Andrei
22
- *
23
- * \ingroup core
24
- * Module: \ref core
25
- *
26
- * \page CompilerOptions compiler specific optimizations:
27
- *
28
-\verbatim
29
- *   - likely(expr)         - branch predicition optimization - is more likely
30
- *                          that expr value will be 1 so optimize for this 
31
- *                          case.
32
- *                          Example: if (likely(p!=NULL)) {... }
33
- *   - unlikely(expr)       - branch prediction optimization - is unlikely that 
34
- *                          expr will be true, so optimize for this case
35
- *   - prefetch(addr)        - will prefetch addr. for reading
36
- *   - prefetch_w(addr)      - will prefetch addr. for writing
37
- *   - prefetch_loc_r(addr, loc) - prefetch for reading, data at addr has
38
- *                                no temporal locality (loc==0), a short
39
- *                                degree of temporal locality (loc==1), 
40
- *                                moderate (loc==2) or high (loc==3).
41
- *                                prefetch(addr) is equiv. to 
42
- *                                prefetch_loc_r(addr, 3).
43
- *  prefetch_loc_w(addr, loc) - like above but for writing.
44
-\endverbatim
45
- */
46
-
47
-#ifndef __compiler_opt_h
48
-#define __compiler_opt_h
49
-
50
-/* likely/unlikely */
51
-#if __GNUC__ >= 3
52
-
53
-#define likely(expr)              __builtin_expect(!!(expr), 1)
54
-#define unlikely(expr)            __builtin_expect(!!(expr), 0)
55
-
56
-#else /* __GNUC__ */
57
-
58
-/* #warning "No compiler optimizations supported try gcc 4.x" */
59
-#define likely(expr) (expr)
60
-#define unlikely(expr) (expr)
61
-
62
-#endif /* __GNUC__ */
63
-
64
-
65
-
66
-/* prefetch* */
67
-#if ( __GNUC__ > 3 ) || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 )
68
-
69
-#define prefetch(addr)            __builtin_prefetch((addr))
70
-#define prefetch_w(addr)          __builtin_prefetch((addr), 1)
71
-#define prefetch_loc_r(addr, loc) __builtin_prefetch((addr), 0, (loc))
72
-#define prefetch_loc_w(addr, loc) __builtin_prefetch((addr), 1, (loc))
73
-
74
-#else
75
-
76
-#define prefetch(addr)
77
-#define prefetch_w(addr)
78
-#define prefetch_loc_r(addr, loc)
79
-#define prefetch_loc_w(addr, loc)
80
-
81
-#endif /* __GNUC__ > 3  || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 ) */
82
-
83
-#endif
Browse code

core : Update include files - delete IDs, update doxygen, delete history

Olle E. Johansson authored on 03/01/2015 10:55:48
Showing 1 changed files
... ...
@@ -1,6 +1,4 @@
1 1
 /*
2
- * $Id$
3
- * 
4 2
  * Copyright (C) 2007 iptelorg GmbH
5 3
  *
6 4
  * Permission to use, copy, modify, and distribute this software for any
... ...
@@ -18,8 +16,9 @@
18 16
 
19 17
 /*!
20 18
  * \file
21
- * \brief SIP-router core :: Compiler specific optimizations
19
+ * \brief Kamailio core :: Compiler specific optimizations
22 20
  * \see \ref CompilerOptions
21
+ * \auth Andrei
23 22
  *
24 23
  * \ingroup core
25 24
  * Module: \ref core
... ...
@@ -45,12 +44,6 @@
45 44
 \endverbatim
46 45
  */
47 46
 
48
-/* 
49
- * History:
50
- * --------
51
- *  2007-05-14  created by andrei
52
- */
53
-
54 47
 #ifndef __compiler_opt_h
55 48
 #define __compiler_opt_h
56 49
 
Browse code

Doxygen updates

oej authored on 25/10/2009 19:11:28
Showing 1 changed files
... ...
@@ -15,6 +15,7 @@
15 15
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 16
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 17
  */
18
+
18 19
 /*!
19 20
  * \file
20 21
  * \brief SIP-router core :: Compiler specific optimizations
Browse code

- Doxygen updates on core files - Add project name to doxygen in Makefile

oej authored on 19/10/2009 20:35:43
Showing 1 changed files
... ...
@@ -15,26 +15,35 @@
15 15
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 16
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 17
  */
18
-/*
19
- * compiler specific optimizations:
20
- * --------------------------------
18
+/*!
19
+ * \file
20
+ * \brief SIP-router core :: Compiler specific optimizations
21
+ * \see \ref CompilerOptions
22
+ *
23
+ * \ingroup core
24
+ * Module: \ref core
21 25
  *
22
- *   likely(expr)         - branch predicition optimization - is more likely
26
+ * \page CompilerOptions compiler specific optimizations:
27
+ *
28
+\verbatim
29
+ *   - likely(expr)         - branch predicition optimization - is more likely
23 30
  *                          that expr value will be 1 so optimize for this 
24 31
  *                          case.
25 32
  *                          Example: if (likely(p!=NULL)) {... }
26
- *   unlikely(expr)       - branch prediction optimization - is unlikely that 
33
+ *   - unlikely(expr)       - branch prediction optimization - is unlikely that 
27 34
  *                          expr will be true, so optimize for this case
28
- *   prefetch(addr)        - will prefetch addr. for reading
29
- *   prefetch_w(addr)      - will prefetch addr. for writing
30
- *   prefetch_loc_r(addr, loc) - prefetch for reading, data at addr has
35
+ *   - prefetch(addr)        - will prefetch addr. for reading
36
+ *   - prefetch_w(addr)      - will prefetch addr. for writing
37
+ *   - prefetch_loc_r(addr, loc) - prefetch for reading, data at addr has
31 38
  *                                no temporal locality (loc==0), a short
32 39
  *                                degree of temporal locality (loc==1), 
33 40
  *                                moderate (loc==2) or high (loc==3).
34 41
  *                                prefetch(addr) is equiv. to 
35 42
  *                                prefetch_loc_r(addr, 3).
36 43
  *  prefetch_loc_w(addr, loc) - like above but for writing.
44
+\endverbatim
37 45
  */
46
+
38 47
 /* 
39 48
  * History:
40 49
  * --------
Browse code

compile: don't warn on old gcc versions

Andrei Pelinescu-Onciul authored on 12/10/2009 14:39:38
Showing 1 changed files
... ...
@@ -52,7 +52,7 @@
52 52
 
53 53
 #else /* __GNUC__ */
54 54
 
55
-#warning "No compiler optimizations supported try gcc 4.x"
55
+/* #warning "No compiler optimizations supported try gcc 4.x" */
56 56
 #define likely(expr) (expr)
57 57
 #define unlikely(expr) (expr)
58 58
 
Browse code

compiler_opts: __builtin_prefetch supported from gcc 3.1

Andrei Pelinescu-Onciul authored on 30/09/2009 22:56:49
Showing 1 changed files
... ...
@@ -44,25 +44,37 @@
44 44
 #ifndef __compiler_opt_h
45 45
 #define __compiler_opt_h
46 46
 
47
+/* likely/unlikely */
47 48
 #if __GNUC__ >= 3
49
+
48 50
 #define likely(expr)              __builtin_expect(!!(expr), 1)
49 51
 #define unlikely(expr)            __builtin_expect(!!(expr), 0)
50 52
 
51
-#define prefetch(addr)            __builtin_prefetch((addr))
52
-#define prefetch_w(addr)          __builtin_prefetch((addr), 1)
53
-#define prefetch_loc_r(addr, loc) __builtin_prefetch((addr), 0, (loc))
54
-#define prefetch_loc_w(addr, loc) __builtin_prefetch((addr), 1, (loc))
55
-
56 53
 #else /* __GNUC__ */
57 54
 
58 55
 #warning "No compiler optimizations supported try gcc 4.x"
59 56
 #define likely(expr) (expr)
60 57
 #define unlikely(expr) (expr)
61 58
 
59
+#endif /* __GNUC__ */
60
+
61
+
62
+
63
+/* prefetch* */
64
+#if ( __GNUC__ > 3 ) || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 )
65
+
66
+#define prefetch(addr)            __builtin_prefetch((addr))
67
+#define prefetch_w(addr)          __builtin_prefetch((addr), 1)
68
+#define prefetch_loc_r(addr, loc) __builtin_prefetch((addr), 0, (loc))
69
+#define prefetch_loc_w(addr, loc) __builtin_prefetch((addr), 1, (loc))
70
+
71
+#else
72
+
62 73
 #define prefetch(addr)
63 74
 #define prefetch_w(addr)
64 75
 #define prefetch_loc_r(addr, loc)
65 76
 #define prefetch_loc_w(addr, loc)
66
-#endif /* __GNUC__ */
77
+
78
+#endif /* __GNUC__ > 3  || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 ) */
67 79
 
68 80
 #endif
Browse code

- minor typos

Andrei Pelinescu-Onciul authored on 30/05/2007 21:50:39
Showing 1 changed files
... ...
@@ -25,15 +25,15 @@
25 25
  *                          Example: if (likely(p!=NULL)) {... }
26 26
  *   unlikely(expr)       - branch prediction optimization - is unlikely that 
27 27
  *                          expr will be true, so optimize for this case
28
- *   prefetch(addr)        - will prefetch addr for reading
29
- *   prefetch_w(addr)      - will prefetch add for writing
28
+ *   prefetch(addr)        - will prefetch addr. for reading
29
+ *   prefetch_w(addr)      - will prefetch addr. for writing
30 30
  *   prefetch_loc_r(addr, loc) - prefetch for reading, data at addr has
31 31
  *                                no temporal locality (loc==0), a short
32 32
  *                                degree of temporal locality (loc==1), 
33 33
  *                                moderate (loc==2) or high (loc==3).
34 34
  *                                prefetch(addr) is equiv. to 
35 35
  *                                prefetch_loc_r(addr, 3).
36
- *  prefetch_loc_r(addr, loc) - like above but for writing.
36
+ *  prefetch_loc_w(addr, loc) - like above but for writing.
37 37
  */
38 38
 /* 
39 39
  * History:
... ...
@@ -49,7 +49,7 @@
49 49
 #define unlikely(expr)            __builtin_expect(!!(expr), 0)
50 50
 
51 51
 #define prefetch(addr)            __builtin_prefetch((addr))
52
-#define prefecth_w(addr)          __builtin_prefetch((addr), 1)
52
+#define prefetch_w(addr)          __builtin_prefetch((addr), 1)
53 53
 #define prefetch_loc_r(addr, loc) __builtin_prefetch((addr), 0, (loc))
54 54
 #define prefetch_loc_w(addr, loc) __builtin_prefetch((addr), 1, (loc))
55 55
 
... ...
@@ -60,7 +60,7 @@
60 60
 #define unlikely(expr) (expr)
61 61
 
62 62
 #define prefetch(addr)
63
-#define prefecth_w(addr)
63
+#define prefetch_w(addr)
64 64
 #define prefetch_loc_r(addr, loc)
65 65
 #define prefetch_loc_w(addr, loc)
66 66
 #endif /* __GNUC__ */
Browse code

*** empty log message ***

Andrei Pelinescu-Onciul authored on 14/05/2007 17:09:31
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,68 @@
1
+/*
2
+ * $Id$
3
+ * 
4
+ * Copyright (C) 2007 iptelorg GmbH
5
+ *
6
+ * Permission to use, copy, modify, and distribute this software for any
7
+ * purpose with or without fee is hereby granted, provided that the above
8
+ * copyright notice and this permission notice appear in all copies.
9
+ *
10
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
+ */
18
+/*
19
+ * compiler specific optimizations:
20
+ * --------------------------------
21
+ *
22
+ *   likely(expr)         - branch predicition optimization - is more likely
23
+ *                          that expr value will be 1 so optimize for this 
24
+ *                          case.
25
+ *                          Example: if (likely(p!=NULL)) {... }
26
+ *   unlikely(expr)       - branch prediction optimization - is unlikely that 
27
+ *                          expr will be true, so optimize for this case
28
+ *   prefetch(addr)        - will prefetch addr for reading
29
+ *   prefetch_w(addr)      - will prefetch add for writing
30
+ *   prefetch_loc_r(addr, loc) - prefetch for reading, data at addr has
31
+ *                                no temporal locality (loc==0), a short
32
+ *                                degree of temporal locality (loc==1), 
33
+ *                                moderate (loc==2) or high (loc==3).
34
+ *                                prefetch(addr) is equiv. to 
35
+ *                                prefetch_loc_r(addr, 3).
36
+ *  prefetch_loc_r(addr, loc) - like above but for writing.
37
+ */
38
+/* 
39
+ * History:
40
+ * --------
41
+ *  2007-05-14  created by andrei
42
+ */
43
+
44
+#ifndef __compiler_opt_h
45
+#define __compiler_opt_h
46
+
47
+#if __GNUC__ >= 3
48
+#define likely(expr)              __builtin_expect(!!(expr), 1)
49
+#define unlikely(expr)            __builtin_expect(!!(expr), 0)
50
+
51
+#define prefetch(addr)            __builtin_prefetch((addr))
52
+#define prefecth_w(addr)          __builtin_prefetch((addr), 1)
53
+#define prefetch_loc_r(addr, loc) __builtin_prefetch((addr), 0, (loc))
54
+#define prefetch_loc_w(addr, loc) __builtin_prefetch((addr), 1, (loc))
55
+
56
+#else /* __GNUC__ */
57
+
58
+#warning "No compiler optimizations supported try gcc 4.x"
59
+#define likely(expr) (expr)
60
+#define unlikely(expr) (expr)
61
+
62
+#define prefetch(addr)
63
+#define prefecth_w(addr)
64
+#define prefetch_loc_r(addr, loc)
65
+#define prefetch_loc_w(addr, loc)
66
+#endif /* __GNUC__ */
67
+
68
+#endif