Skip to content

Commit 2ddb8e3

Browse files
committed
8.0.4
1 parent 53fae25 commit 2ddb8e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1370
-703
lines changed

3rd_party

Submodule 3rd_party updated 47 files

examples

Submodule examples updated 331 files

include/qp.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
#define QP_H_
3131

3232
//============================================================================
33-
#define QP_VERSION_STR "8.0.3"
34-
#define QP_VERSION 803U
35-
// <VER>=803 <DATE>=250407
36-
#define QP_RELEASE 0x6ABEE96CU
33+
#define QP_VERSION_STR "8.0.4"
34+
#define QP_VERSION 804U
35+
// <VER>=804 <DATE>=250531
36+
#define QP_RELEASE 0x6AABFDABU
3737

3838
//============================================================================
3939
// default configuration settings
@@ -167,6 +167,7 @@ union QAsmAttr {
167167
QXThreadHandler thr; //!< @private @memberof QAsmAttr
168168
QMTranActTable const *tatbl; //!< @private @memberof QAsmAttr
169169
struct QMState const *obj; //!< @private @memberof QAsmAttr
170+
uintptr_t uint; //!< @private @memberof QAsmAttr
170171
};
171172

172173
#define Q_STATE_CAST(handler_) ((QStateHandler)(handler_))

include/qsafe.h

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
//============================================================================
2-
// SafeQP/C Real-Time Event Framework (RTEF)
2+
// QP/C/C++ Real-Time Event Framework (RTEF)
33
//
44
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
55
//
66
// Q u a n t u m L e a P s
77
// ------------------------
88
// Modern Embedded Software
99
//
10-
// SPDX-License-Identifier: LicenseRef-QL-commercial
10+
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
1111
//
12-
// This software is licensed under the terms of the Quantum Leaps commercial
13-
// licenses. Please contact Quantum Leaps for more information about the
14-
// available licensing options.
12+
// This software is dual-licensed under the terms of the open-source GNU
13+
// General Public License (GPL) or under the terms of one of the closed-
14+
// source Quantum Leaps commercial licenses.
1515
//
16-
// RESTRICTIONS
17-
// You may NOT :
18-
// (a) redistribute, encumber, sell, rent, lease, sublicense, or otherwise
19-
// transfer rights in this software,
20-
// (b) remove or alter any trademark, logo, copyright or other proprietary
21-
// notices, legends, symbols or labels present in this software,
22-
// (c) plagiarize this software to sidestep the licensing obligations.
16+
// Redistributions in source code must retain this top-level comment block.
17+
// Plagiarizing this software to sidestep the license obligations is illegal.
18+
//
19+
// NOTE:
20+
// The GPL does NOT permit the incorporation of this code into proprietary
21+
// programs. Please contact Quantum Leaps for commercial licensing options,
22+
// which expressly supersede the GPL and are designed explicitly for
23+
// closed-source distribution.
2324
//
2425
// Quantum Leaps contact information:
2526
// <www.state-machine.com/licensing>
@@ -43,6 +44,10 @@
4344
#define QF_CRIT_EXIT() ((void)0)
4445
#endif
4546

47+
#ifndef QF_CRIT_EST
48+
#define QF_CRIT_EST() ((void)0)
49+
#endif
50+
4651
#define Q_DEFINE_THIS_MODULE(name_) \
4752
static char const Q_this_module_[] = name_;
4853

@@ -60,36 +65,50 @@
6065
} while (false)
6166

6267
#define Q_ERROR_ID(id_) do { \
63-
QF_CRIT_STAT \
64-
QF_CRIT_ENTRY(); \
68+
QF_CRIT_EST(); \
6569
Q_onError(&Q_this_module_[0], (id_)); \
66-
QF_CRIT_EXIT(); \
70+
} while (false)
71+
72+
#define Q_ASSERT_LOCAL(id_, expr_) do { \
73+
if (expr_) {} else { \
74+
QF_CRIT_EST(); \
75+
Q_onError(&Q_this_module_[0], (id_)); \
76+
} \
6777
} while (false)
6878

6979
// QF-FuSa disabled ==========================================================
7080
#else
7181

7282
#define Q_DEFINE_THIS_MODULE(name_)
73-
#define Q_ASSERT_INCRIT(id_, expr_) ((void)0)
74-
#define Q_ERROR_INCRIT(id_) ((void)0)
75-
#define Q_ASSERT_ID(id_, expr_) ((void)0)
76-
#define Q_ERROR_ID(id_) ((void)0)
83+
#define Q_ASSERT_INCRIT(id_, expr_) ((void)0)
84+
#define Q_ERROR_INCRIT(id_) ((void)0)
85+
#define Q_ASSERT_ID(id_, expr_) ((void)0)
86+
#define Q_ERROR_ID(id_) ((void)0)
87+
#define Q_ASSERT_LOCAL(id_, expr_) ((void)0)
7788

7889
#endif // QF-FuSa disabled
7990

8091
//============================================================================
8192
#define Q_DEFINE_THIS_FILE Q_DEFINE_THIS_MODULE(__FILE__)
8293
#define Q_ASSERT(expr_) Q_ASSERT_ID(__LINE__, (expr_))
8394
#define Q_ERROR() Q_ERROR_ID(__LINE__)
84-
#define Q_REQUIRE_ID(id_, expr_) Q_ASSERT_ID((id_), (expr_))
95+
8596
#define Q_REQUIRE(expr_) Q_ASSERT(expr_)
97+
#define Q_REQUIRE_ID(id_, expr_) Q_ASSERT_ID((id_), (expr_))
8698
#define Q_REQUIRE_INCRIT(id_, expr_) Q_ASSERT_INCRIT((id_), (expr_))
87-
#define Q_ENSURE_ID(id_, expr_) Q_ASSERT_ID((id_), (expr_))
99+
#define Q_REQUIRE_LOCAL(id_, expr_) Q_ASSERT_LOCAL((id_), (expr_))
100+
88101
#define Q_ENSURE(expr_) Q_ASSERT(expr_)
102+
#define Q_ENSURE_ID(id_, expr_) Q_ASSERT_ID((id_), (expr_))
89103
#define Q_ENSURE_INCRIT(id_, expr_) Q_ASSERT_INCRIT((id_), (expr_))
90-
#define Q_INVARIANT_ID(id_, expr_) Q_ASSERT_ID((id_), (expr_))
104+
#define Q_ENSURE_LOCAL(id_, expr_) Q_ASSERT_LOCAL((id_), (expr_))
105+
91106
#define Q_INVARIANT(expr_) Q_ASSERT(expr_)
107+
#define Q_INVARIANT_ID(id_, expr_) Q_ASSERT_ID((id_), (expr_))
92108
#define Q_INVARIANT_INCRIT(id_, expr_) Q_ASSERT_INCRIT((id_), (expr_))
109+
#define Q_INVARIANT_LOCAL(id_, expr_) Q_ASSERT_LOCAL((id_), (expr_))
110+
111+
#define Q_ERROR_LOCAL(id_) Q_ERROR_ID(id_)
93112

94113
#ifndef Q_ASSERT_STATIC
95114
#define Q_ASSERT_STATIC(expr_) extern char Q_static_assert_[(expr_) ? 1 : -1]

ports/arm-cm/qk/armclang/qk_port.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ void NMI_Handler(void);
6262
// For best performance, these functions are implemented in assembly,
6363
// but they can be implemented in C as well.
6464

65-
//int32_t volatile QF_int_lock_nest_; // not used
6665
extern char const QF_port_module_[];
6766
char const QF_port_module_[] = "qk_port";
6867

ports/arm-cm/qk/armclang/qp_port.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
#define QF_CRIT_STAT
5353
#define QF_CRIT_ENTRY() (QF_crit_entry_())
5454
#define QF_CRIT_EXIT() (QF_crit_exit_())
55-
55+
#define QF_CRIT_EST() (QF_crit_entry_())
5656
#define QF_CRIT_EXIT_NOP() __asm volatile ("isb" ::: "memory")
5757

5858
// Efficient log2() ----------------------------------------------------------
@@ -163,8 +163,6 @@ void QF_int_enable_(void);
163163
void QF_crit_entry_(void);
164164
void QF_crit_exit_(void);
165165

166-
extern int32_t volatile QF_int_lock_nest_;
167-
168166
//============================================================================
169167
// NOTE1:
170168
// The critical section policy does not use the "saving and restoring"

ports/arm-cm/qk/gnu/qk_port.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ void NMI_Handler(void);
6262
// For best performance, these functions are implemented in assembly,
6363
// but they can be implemented in C as well.
6464

65-
//int32_t volatile QF_int_lock_nest_; // not used
6665
extern char const QF_port_module_[];
6766
char const QF_port_module_[] = "qk_port";
6867

@@ -124,7 +123,6 @@ __asm volatile (
124123
#else //--------- use PRIMASK for enabling interrupts
125124
" CPSIE i \n" // clear PRIMASK
126125
#endif //--------- use PRIMASK for enabling interrupts
127-
128126
" BX lr \n"
129127
"QF_int_enable_error: \n"
130128
" LDR r0,=QF_port_module_ \n"

ports/arm-cm/qk/gnu/qp_port.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
#define QF_CRIT_STAT
5353
#define QF_CRIT_ENTRY() (QF_crit_entry_())
5454
#define QF_CRIT_EXIT() (QF_crit_exit_())
55-
55+
#define QF_CRIT_EST() (QF_crit_entry_())
5656
#define QF_CRIT_EXIT_NOP() __asm volatile ("isb" ::: "memory")
5757

5858
// Efficient log2() ----------------------------------------------------------

ports/arm-cm/qk/gnu/syscalls.c

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
// dummy system calls to eliminate the following GNU linker warning:
2+
// "warning: xxxx is not implemented and will always fail"
3+
4+
#include <sys/stat.h>
5+
#include <stdlib.h>
6+
#include <errno.h>
7+
#include <stdio.h>
8+
#include <signal.h>
9+
#include <time.h>
10+
#include <sys/time.h>
11+
#include <sys/times.h>
12+
13+
extern int __io_putchar(int ch) __attribute__((weak));
14+
extern int __io_getchar(void) __attribute__((weak));
15+
16+
char *__env[1] = { 0 };
17+
char **environ = __env;
18+
19+
void initialise_monitor_handles() {
20+
}
21+
int _getpid(void) {
22+
return 1;
23+
}
24+
int _kill(int pid, int sig) {
25+
(void)pid;
26+
(void)sig;
27+
errno = EINVAL;
28+
return -1;
29+
}
30+
void _exit (int status) {
31+
_kill(status, -1);
32+
while (1) { // do not return
33+
}
34+
}
35+
__attribute__((weak)) int _read(int file, char *ptr, int len) {
36+
(void)file;
37+
for (int i = len; i != 0; --i) {
38+
*ptr++ = __io_getchar();
39+
}
40+
return len;
41+
}
42+
__attribute__((weak)) int _write(int file, char *ptr, int len) {
43+
(void)file;
44+
for (int i = len; i != 0; --i) {
45+
__io_putchar(*ptr++);
46+
}
47+
return len;
48+
}
49+
int _close(int file) {
50+
(void)file;
51+
return -1;
52+
}
53+
int _fstat(int file, struct stat *st) {
54+
(void)file;
55+
st->st_mode = S_IFCHR;
56+
return 0;
57+
}
58+
int _isatty(int file) {
59+
(void)file;
60+
return 1;
61+
}
62+
int _lseek(int file, int ptr, int dir) {
63+
(void)file;
64+
(void)ptr;
65+
(void)dir;
66+
return 0;
67+
}
68+
int _open(char *path, int flags, ...) {
69+
(void)path;
70+
(void)flags;
71+
return -1;
72+
}
73+
int _wait(int *status) {
74+
(void)status;
75+
errno = ECHILD;
76+
return -1;
77+
}
78+
int _unlink(char *name) {
79+
(void)name;
80+
errno = ENOENT;
81+
return -1;
82+
}
83+
int _times(struct tms *buf) {
84+
(void)buf;
85+
return -1;
86+
}
87+
int _stat(char *file, struct stat *st) {
88+
(void)file;
89+
st->st_mode = S_IFCHR;
90+
return 0;
91+
}
92+
int _link(char *old, char *new) {
93+
(void)old;
94+
(void)new;
95+
errno = EMLINK;
96+
return -1;
97+
}
98+
int _fork(void) {
99+
errno = EAGAIN;
100+
return -1;
101+
}
102+
int _execve(char *name, char **argv, char **env) {
103+
(void)name;
104+
(void)argv;
105+
(void)env;
106+
errno = ENOMEM;
107+
return -1;
108+
}

ports/arm-cm/qk/iar/qk_port.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ void NMI_Handler(void);
6767
#pragma weak QF_crit_entry_
6868
#pragma weak QF_crit_exit_
6969

70-
//int32_t volatile QF_int_lock_nest_; // not used
7170
extern char const QF_port_module_[];
7271
char const QF_port_module_[] = "qk_port";
7372

0 commit comments

Comments
 (0)