This commit is contained in:
purplerain 2023-06-22 18:19:48 +00:00
parent 3f8ae0d130
commit be633fa56a
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
84 changed files with 420 additions and 347 deletions

View file

@ -0,0 +1 @@
#machdep.lidaction=0 # 1=suspend, 2=hibernate laptop upon lid closing

View file

@ -113,7 +113,7 @@ Summary:
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* We use subtraction of (char *) 0 instead of casting to int /* We use subtraction of (char *) 0 instead of casting to int
because on word-addressable machines a simple cast to int because on word-addressable machines a simple cast to int
may ignore the byte-within-word field of the pointer. */ may ignore the byte-within-word field of the pointer. */
@ -196,7 +196,7 @@ extern int _obstack_begin_1 (struct obstack *, int, int,
void *(*) (void *, long), void *(*) (void *, long),
void (*) (void *, void *), void *); void (*) (void *, void *), void *);
extern int _obstack_memory_used (struct obstack *); extern int _obstack_memory_used (struct obstack *);
/* Do the function-declarations after the structs /* Do the function-declarations after the structs
but before defining the macros. */ but before defining the macros. */
@ -242,7 +242,7 @@ extern void (*obstack_alloc_failed_handler) (void);
/* Exit value used when `print_and_abort' is used. */ /* Exit value used when `print_and_abort' is used. */
extern int obstack_exit_failure; extern int obstack_exit_failure;
/* Pointer to beginning of object being allocated or to be allocated next. /* Pointer to beginning of object being allocated or to be allocated next.
Note that this might not be the final address of the object Note that this might not be the final address of the object
because a new chunk might be needed to hold the final size. */ because a new chunk might be needed to hold the final size. */
@ -291,7 +291,7 @@ extern int obstack_exit_failure;
#define obstack_blank_fast(h,n) ((h)->next_free += (n)) #define obstack_blank_fast(h,n) ((h)->next_free += (n))
#define obstack_memory_used(h) _obstack_memory_used (h) #define obstack_memory_used(h) _obstack_memory_used (h)
#if defined __GNUC__ && defined __STDC__ && __STDC__ #if defined __GNUC__ && defined __STDC__ && __STDC__
/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and /* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
does not implement __extension__. But that compiler doesn't define does not implement __extension__. But that compiler doesn't define
@ -441,7 +441,7 @@ __extension__ \
if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \ if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \
__o->next_free = __o->object_base = (char *) __obj; \ __o->next_free = __o->object_base = (char *) __obj; \
else (obstack_free) (__o, __obj); }) else (obstack_free) (__o, __obj); })
#else /* not __GNUC__ or not __STDC__ */ #else /* not __GNUC__ or not __STDC__ */
# define obstack_object_size(h) \ # define obstack_object_size(h) \

View file

@ -172,7 +172,7 @@ typedef unsigned long int reg_syntax_t;
stored in the pattern buffer, so changing this does not affect stored in the pattern buffer, so changing this does not affect
already-compiled regexps. */ already-compiled regexps. */
extern reg_syntax_t re_syntax_options; extern reg_syntax_t re_syntax_options;
/* Define combinations of the above bits for the standard possibilities. /* Define combinations of the above bits for the standard possibilities.
(The [[[ comments delimit what gets put into the Texinfo file, so (The [[[ comments delimit what gets put into the Texinfo file, so
don't delete them!) */ don't delete them!) */
@ -242,7 +242,7 @@ extern reg_syntax_t re_syntax_options;
| RE_NO_BK_PARENS | RE_NO_BK_REFS \ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD) | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
/* [[[end syntaxes]]] */ /* [[[end syntaxes]]] */
/* Maximum number of duplicates an interval can allow. Some systems /* Maximum number of duplicates an interval can allow. Some systems
(erroneously) define this in other header files, but we want our (erroneously) define this in other header files, but we want our
value, so remove any previous define. */ value, so remove any previous define. */
@ -317,7 +317,7 @@ typedef enum
REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */ REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */ REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
} reg_errcode_t; } reg_errcode_t;
/* This data structure represents a compiled pattern. Before calling /* This data structure represents a compiled pattern. Before calling
the pattern compiler, the fields `buffer', `allocated', `fastmap', the pattern compiler, the fields `buffer', `allocated', `fastmap',
`translate', and `no_sub' can be set. After the pattern has been `translate', and `no_sub' can be set. After the pattern has been
@ -397,7 +397,7 @@ struct re_pattern_buffer
}; };
typedef struct re_pattern_buffer regex_t; typedef struct re_pattern_buffer regex_t;
/* Type for byte offsets within the string. POSIX mandates this. */ /* Type for byte offsets within the string. POSIX mandates this. */
typedef int regoff_t; typedef int regoff_t;
@ -428,7 +428,7 @@ typedef struct
regoff_t rm_so; /* Byte offset from string's start to substring's start. */ regoff_t rm_so; /* Byte offset from string's start to substring's start. */
regoff_t rm_eo; /* Byte offset from string's start to substring's end. */ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
} regmatch_t; } regmatch_t;
/* Declarations for routines. */ /* Declarations for routines. */
/* To avoid duplicating every routine declaration -- once with a /* To avoid duplicating every routine declaration -- once with a
@ -555,7 +555,7 @@ extern void regfree (regex_t *__preg);
#endif /* C++ */ #endif /* C++ */
#endif /* regex.h */ #endif /* regex.h */
/* /*
Local variables: Local variables:
make-backup-files: t make-backup-files: t

View file

@ -55,7 +55,7 @@ modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be author's reputation will not be affected by problems that might be
introduced by others. introduced by others.
Finally, software patents pose a constant threat to the existence of Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a effectively restrict the users of a free program by obtaining a
@ -111,7 +111,7 @@ modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The "work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must former contains code derived from the library, whereas the latter must
be combined with the library in order to run. be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@ -158,7 +158,7 @@ Library.
You may charge a fee for the physical act of transferring a copy, You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a and you may at your option offer warranty protection in exchange for a
fee. fee.
2. You may modify your copy or copies of the Library or any portion 2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1 distribute such modifications or work under the terms of Section 1
@ -216,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in that version instead if you wish.) Do not make any other change in
these notices. these notices.
Once this change is made in a given copy, it is irreversible for Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy. subsequent copies and derivative works made from that copy.
@ -267,7 +267,7 @@ Library will still fall under Section 6.)
distribute the object code for the work under the terms of Section 6. distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6, Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself. whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or 6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work work containing portions of the Library, and distribute that work
@ -329,7 +329,7 @@ restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you use both them and the Library together in an executable that you
distribute. distribute.
7. You may place library facilities that are a work based on the 7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined facilities not covered by this License, and distribute such a combined
@ -370,7 +370,7 @@ subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein. restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with You are not responsible for enforcing compliance by third parties with
this License. this License.
11. If, as a consequence of a court judgment or allegation of patent 11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues), infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or conditions are imposed on you (whether by court order, agreement or
@ -422,7 +422,7 @@ conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by license version number, you may choose any version ever published by
the Free Software Foundation. the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free 14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these, programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is write to the author to ask for permission. For software which is
@ -456,7 +456,7 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES. DAMAGES.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest If you develop a new library, and you want it to be of the greatest

View file

@ -51,7 +51,7 @@ static void fibnode_insert_after (fibnode_t, fibnode_t);
#define fibnode_insert_before(a, b) fibnode_insert_after (a->left, b) #define fibnode_insert_before(a, b) fibnode_insert_after (a->left, b)
static fibnode_t fibnode_remove (fibnode_t); static fibnode_t fibnode_remove (fibnode_t);
/* Create a new fibonacci heap. */ /* Create a new fibonacci heap. */
fibheap_t fibheap_t
fibheap_new (void) fibheap_new (void)

View file

@ -248,7 +248,7 @@ const struct floatformat floatformat_ia64_quad_little =
"floatformat_ia64_quad_little", "floatformat_ia64_quad_little",
floatformat_always_valid floatformat_always_valid
}; };
/* Extract a field which starts at START and is LEN bits long. DATA and /* Extract a field which starts at START and is LEN bits long. DATA and
TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */ TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */
static unsigned long static unsigned long
@ -413,7 +413,7 @@ floatformat_to_double (const struct floatformat *fmt,
dto = -dto; dto = -dto;
*to = dto; *to = dto;
} }
static void put_field (unsigned char *, enum floatformat_byteorders, static void put_field (unsigned char *, enum floatformat_byteorders,
unsigned int, unsigned int,
unsigned int, unsigned int,

View file

@ -23,7 +23,7 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301,
USA. */ USA. */
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>. /* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */ Ditto for AIX 3.2 and <stdlib.h>. */
#ifndef _NO_PROTO #ifndef _NO_PROTO
@ -192,7 +192,7 @@ static enum
/* Value of POSIXLY_CORRECT environment variable. */ /* Value of POSIXLY_CORRECT environment variable. */
static char *posixly_correct; static char *posixly_correct;
#ifdef __GNU_LIBRARY__ #ifdef __GNU_LIBRARY__
/* We want to avoid inclusion of string.h with non-GNU libraries /* We want to avoid inclusion of string.h with non-GNU libraries
because there are many ways it can cause trouble. because there are many ways it can cause trouble.
@ -250,7 +250,7 @@ extern int strlen (const char *);
#endif /* __GNUC__ */ #endif /* __GNUC__ */
#endif /* not __GNU_LIBRARY__ */ #endif /* not __GNU_LIBRARY__ */
/* Handle permutation of arguments. */ /* Handle permutation of arguments. */
/* Describe the part of ARGV that contains non-options that have /* Describe the part of ARGV that contains non-options that have
@ -461,7 +461,7 @@ _getopt_initialize (int argc ATTRIBUTE_UNUSED,
return optstring; return optstring;
} }
/* Scan elements of ARGV (whose length is ARGC) for option characters /* Scan elements of ARGV (whose length is ARGC) for option characters
given in OPTSTRING. given in OPTSTRING.
@ -980,7 +980,7 @@ getopt (int argc, char *const *argv, const char *optstring)
} }
#endif /* Not ELIDE_CODE. */ #endif /* Not ELIDE_CODE. */
#ifdef TEST #ifdef TEST
/* Compile with -DTEST to make an executable for use in testing /* Compile with -DTEST to make an executable for use in testing

View file

@ -19,7 +19,7 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301,
USA. */ USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
@ -86,7 +86,7 @@ getopt_long_only (int argc, char *const *argv, const char *options,
#endif /* Not ELIDE_CODE. */ #endif /* Not ELIDE_CODE. */
#ifdef TEST #ifdef TEST
#include <stdio.h> #include <stdio.h>

View file

@ -128,7 +128,7 @@ struct obstack *_obstack;
} while (0) } while (0)
#endif #endif
/* Initialize an obstack H for use. Specify chunk size SIZE (0 means default). /* Initialize an obstack H for use. Specify chunk size SIZE (0 means default).
Objects start on multiples of ALIGNMENT (0 means use default). Objects start on multiples of ALIGNMENT (0 means use default).
CHUNKFUN is the function to use to allocate chunks, CHUNKFUN is the function to use to allocate chunks,
@ -317,7 +317,7 @@ _obstack_allocated_p (struct obstack *h, POINTER obj)
} }
return lp != 0; return lp != 0;
} }
/* Free objects in obstack H, including OBJ and everything allocate /* Free objects in obstack H, including OBJ and everything allocate
more recently than OBJ. If OBJ is zero, free everything in H. */ more recently than OBJ. If OBJ is zero, free everything in H. */
@ -387,7 +387,7 @@ obstack_free (struct obstack *h, POINTER obj)
/* obj is not in any of the chunks! */ /* obj is not in any of the chunks! */
abort (); abort ();
} }
int int
_obstack_memory_used (struct obstack *h) _obstack_memory_used (struct obstack *h)
{ {
@ -400,7 +400,7 @@ _obstack_memory_used (struct obstack *h)
} }
return nbytes; return nbytes;
} }
/* Define the error handler. */ /* Define the error handler. */
#ifndef _ #ifndef _
# if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC # if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
@ -419,7 +419,7 @@ print_and_abort (void)
fputs (_("memory exhausted\n"), stderr); fputs (_("memory exhausted\n"), stderr);
exit (obstack_exit_failure); exit (obstack_exit_failure);
} }
#if 0 #if 0
/* These are now turned off because the applications do not use it /* These are now turned off because the applications do not use it
and it uses bcopy via obstack_grow, which causes trouble on sysV. */ and it uses bcopy via obstack_grow, which causes trouble on sysV. */

View file

@ -217,7 +217,7 @@ static int rand_deg = DEG_3;
static int rand_sep = SEP_3; static int rand_sep = SEP_3;
static long int *end_ptr = &randtbl[sizeof(randtbl) / sizeof(randtbl[0])]; static long int *end_ptr = &randtbl[sizeof(randtbl) / sizeof(randtbl[0])];
/* Initialize the random number generator based on the given seed. If the /* Initialize the random number generator based on the given seed. If the
type is the trivial no-state-information type, just remember the seed. type is the trivial no-state-information type, just remember the seed.
Otherwise, initializes state[] based on the given "seed" via a linear Otherwise, initializes state[] based on the given "seed" via a linear
@ -241,7 +241,7 @@ srandom (unsigned int x)
random(); random();
} }
} }
/* Initialize the state information in the given array of N bytes for /* Initialize the state information in the given array of N bytes for
future random number generation. Based on the number of bytes we future random number generation. Based on the number of bytes we
are given, and the break values for the different R.N.G.'s, we choose are given, and the break values for the different R.N.G.'s, we choose
@ -309,7 +309,7 @@ initstate (unsigned int seed, PTR arg_state, unsigned long n)
return ostate; return ostate;
} }
/* Restore the state from the given state array. /* Restore the state from the given state array.
Note: It is important that we also remember the locations of the pointers Note: It is important that we also remember the locations of the pointers
in the current state information, and restore the locations of the pointers in the current state information, and restore the locations of the pointers
@ -360,7 +360,7 @@ setstate (PTR arg_state)
return ostate; return ostate;
} }
/* If we are using the trivial TYPE_0 R.N.G., just do the old linear /* If we are using the trivial TYPE_0 R.N.G., just do the old linear
congruential bit. Otherwise, we do our fancy trinomial stuff, which is the congruential bit. Otherwise, we do our fancy trinomial stuff, which is the
same in all ther other cases due to all the global variables that have been same in all ther other cases due to all the global variables that have been

View file

@ -188,7 +188,7 @@ char *realloc ();
# ifndef MB_LEN_MAX # ifndef MB_LEN_MAX
# define MB_LEN_MAX 1 # define MB_LEN_MAX 1
# endif # endif
/* Get the interface, including the syntax bits. */ /* Get the interface, including the syntax bits. */
# include "xregex.h" /* change for libiberty */ # include "xregex.h" /* change for libiberty */
@ -258,7 +258,7 @@ char *realloc ();
/* As in Harbison and Steele. */ /* As in Harbison and Steele. */
# define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128) # define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
# endif # endif
# ifndef emacs # ifndef emacs
/* How many characters in the character set. */ /* How many characters in the character set. */
# define CHAR_SET_SIZE 256 # define CHAR_SET_SIZE 256
@ -297,7 +297,7 @@ init_syntax_once (void)
# define SYNTAX(c) re_syntax_table[(unsigned char) (c)] # define SYNTAX(c) re_syntax_table[(unsigned char) (c)]
# endif /* emacs */ # endif /* emacs */
/* Integer type for pointers. */ /* Integer type for pointers. */
# if !defined _LIBC && !defined HAVE_UINTPTR_T # if !defined _LIBC && !defined HAVE_UINTPTR_T
typedef unsigned long int uintptr_t; typedef unsigned long int uintptr_t;
@ -444,7 +444,7 @@ static int wcs_re_search_2 (struct re_pattern_buffer *bufp,
struct re_registers *regs, int stop); struct re_registers *regs, int stop);
static int wcs_re_compile_fastmap (struct re_pattern_buffer *bufp); static int wcs_re_compile_fastmap (struct re_pattern_buffer *bufp);
#endif #endif
/* These are the command codes that appear in compiled regular /* These are the command codes that appear in compiled regular
expressions. Some opcodes are followed by argument bytes. A expressions. Some opcodes are followed by argument bytes. A
command code can specify any interpretation whatsoever for its command code can specify any interpretation whatsoever for its
@ -603,7 +603,7 @@ typedef enum
# endif /* emacs */ # endif /* emacs */
} re_opcode_t; } re_opcode_t;
#endif /* not INSIDE_RECURSION */ #endif /* not INSIDE_RECURSION */
#ifdef BYTE #ifdef BYTE
# define CHAR_T char # define CHAR_T char
@ -735,7 +735,7 @@ PREFIX(extract_number_and_incr) (int *destination, UCHAR_T **source)
# endif /* DEBUG */ # endif /* DEBUG */
/* If DEBUG is defined, Regex prints many voluminous messages about what /* If DEBUG is defined, Regex prints many voluminous messages about what
it is doing (if the variable `debug' is nonzero). If linked with the it is doing (if the variable `debug' is nonzero). If linked with the
@ -1226,7 +1226,7 @@ printchar (int c)
# endif /* not DEBUG */ # endif /* not DEBUG */
# ifdef WCHAR # ifdef WCHAR
/* This convert a multibyte string to a wide character string. /* This convert a multibyte string to a wide character string.
@ -1337,7 +1337,7 @@ re_set_syntax (reg_syntax_t syntax)
# ifdef _LIBC # ifdef _LIBC
weak_alias (__re_set_syntax, re_set_syntax) weak_alias (__re_set_syntax, re_set_syntax)
# endif # endif
/* This table gives an error message for each of the error codes listed /* This table gives an error message for each of the error codes listed
in regex.h. Obviously the order here has to be same as there. in regex.h. Obviously the order here has to be same as there.
POSIX doesn't require that we do anything for REG_NOERROR, POSIX doesn't require that we do anything for REG_NOERROR,
@ -1363,7 +1363,7 @@ static const char *re_error_msgid[] =
gettext_noop ("Regular expression too big"), /* REG_ESIZE */ gettext_noop ("Regular expression too big"), /* REG_ESIZE */
gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */ gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */
}; };
#endif /* INSIDE_RECURSION */ #endif /* INSIDE_RECURSION */
#ifndef DEFINED_ONCE #ifndef DEFINED_ONCE
@ -1404,7 +1404,7 @@ static const char *re_error_msgid[] =
# undef MATCH_MAY_ALLOCATE # undef MATCH_MAY_ALLOCATE
# endif # endif
#endif /* not DEFINED_ONCE */ #endif /* not DEFINED_ONCE */
#ifdef INSIDE_RECURSION #ifdef INSIDE_RECURSION
/* Failure stack declarations and macros; both re_compile_fastmap and /* Failure stack declarations and macros; both re_compile_fastmap and
re_match_2 use a failure stack. These have to be macros because of re_match_2 use a failure stack. These have to be macros because of
@ -1776,7 +1776,7 @@ typedef struct
set_regs_matched_done = 0; \ set_regs_matched_done = 0; \
DEBUG_STATEMENT (nfailure_points_popped++); \ DEBUG_STATEMENT (nfailure_points_popped++); \
} /* POP_FAILURE_POINT */ } /* POP_FAILURE_POINT */
/* Structure for per-register (a.k.a. per-group) information. /* Structure for per-register (a.k.a. per-group) information.
Other register information, such as the Other register information, such as the
starting and ending positions (which are addresses), and the list of starting and ending positions (which are addresses), and the list of
@ -2195,7 +2195,7 @@ typedef struct
|| STREQ (string, "cntrl") || STREQ (string, "blank")) || STREQ (string, "cntrl") || STREQ (string, "blank"))
# endif # endif
# endif /* DEFINED_ONCE */ # endif /* DEFINED_ONCE */
# ifndef MATCH_MAY_ALLOCATE # ifndef MATCH_MAY_ALLOCATE
/* If we cannot allocate large objects within re_match_2_internal, /* If we cannot allocate large objects within re_match_2_internal,
@ -2245,7 +2245,7 @@ PREFIX(regex_grow_registers) (int num_regs)
} }
# endif /* not MATCH_MAY_ALLOCATE */ # endif /* not MATCH_MAY_ALLOCATE */
# ifndef DEFINED_ONCE # ifndef DEFINED_ONCE
static boolean group_in_compile_stack (compile_stack_type compile_stack, static boolean group_in_compile_stack (compile_stack_type compile_stack,
regnum_t regnum); regnum_t regnum);
@ -4502,7 +4502,7 @@ byte_compile_range (unsigned int range_start_char, const char **p_ptr,
return ret; return ret;
} }
#endif /* WCHAR */ #endif /* WCHAR */
/* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in /* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in
BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible
characters can start a string that matches the pattern. This fastmap characters can start a string that matches the pattern. This fastmap
@ -4869,7 +4869,7 @@ re_compile_fastmap (struct re_pattern_buffer *bufp)
#ifdef _LIBC #ifdef _LIBC
weak_alias (__re_compile_fastmap, re_compile_fastmap) weak_alias (__re_compile_fastmap, re_compile_fastmap)
#endif #endif
/* Set REGS to hold NUM_REGS registers, storing them in STARTS and /* Set REGS to hold NUM_REGS registers, storing them in STARTS and
ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use
@ -4906,7 +4906,7 @@ re_set_registers (struct re_pattern_buffer *bufp,
#ifdef _LIBC #ifdef _LIBC
weak_alias (__re_set_registers, re_set_registers) weak_alias (__re_set_registers, re_set_registers)
#endif #endif
/* Searching routines. */ /* Searching routines. */
/* Like re_search_2, below, but only one string is specified, and /* Like re_search_2, below, but only one string is specified, and
@ -5382,7 +5382,7 @@ PREFIX(re_search_2) (struct re_pattern_buffer *bufp, const char *string1,
to actually save any registers when none are active. */ to actually save any registers when none are active. */
#define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH) #define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH)
#define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1) #define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1)
#else /* not INSIDE_RECURSION */ #else /* not INSIDE_RECURSION */
/* Matching routines. */ /* Matching routines. */
@ -7746,7 +7746,7 @@ PREFIX(bcmp_translate) (const CHAR_T *s1, const CHAR_T *s2, register int len,
} }
return 0; return 0;
} }
#else /* not INSIDE_RECURSION */ #else /* not INSIDE_RECURSION */
@ -7793,7 +7793,7 @@ re_compile_pattern (const char *pattern, size_t length,
#ifdef _LIBC #ifdef _LIBC
weak_alias (__re_compile_pattern, re_compile_pattern) weak_alias (__re_compile_pattern, re_compile_pattern)
#endif #endif
/* Entry points compatible with 4.2 BSD regex library. We don't define /* Entry points compatible with 4.2 BSD regex library. We don't define
them unless specifically requested. */ them unless specifically requested. */
@ -7865,7 +7865,7 @@ re_exec (const char *s)
} }
#endif /* _REGEX_RE_COMP */ #endif /* _REGEX_RE_COMP */
/* POSIX.2 functions. Don't define these for Emacs. */ /* POSIX.2 functions. Don't define these for Emacs. */
#ifndef emacs #ifndef emacs
@ -8132,7 +8132,7 @@ weak_alias (__regfree, regfree)
#endif /* not INSIDE_RECURSION */ #endif /* not INSIDE_RECURSION */
#undef STORE_NUMBER #undef STORE_NUMBER
#undef STORE_NUMBER_AND_INCR #undef STORE_NUMBER_AND_INCR
#undef EXTRACT_NUMBER #undef EXTRACT_NUMBER

View file

@ -30,9 +30,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.\" $OpenBSD: malloc.3,v 1.133 2023/06/04 06:58:33 otto Exp $ .\" $OpenBSD: malloc.3,v 1.134 2023/06/22 11:04:16 otto Exp $
.\" .\"
.Dd $Mdocdate: June 4 2023 $ .Dd $Mdocdate: June 22 2023 $
.Dt MALLOC 3 .Dt MALLOC 3
.Os .Os
.Sh NAME .Sh NAME
@ -294,6 +294,17 @@ To record the dump:
To view the leak report: To view the leak report:
.Pp .Pp
.Dl $ kdump -u malloc ... .Dl $ kdump -u malloc ...
.Pp
By default, the immediate caller of a
.Nm
function will be recorded.
Use malloc options
.Cm 2
or
.Cm 3
to record the caller one or two stack frames deeper instead.
These malloc options imply
.Cm D .
.It Cm F .It Cm F
.Dq Freecheck . .Dq Freecheck .
Enable more extensive double free and use after free detection. Enable more extensive double free and use after free detection.
@ -813,3 +824,14 @@ and
.Fn realloc .Fn realloc
to avoid these problems on to avoid these problems on
.Ox . .Ox .
.Pp
The mechanism to record caller functions when using malloc options
.Cm 2
or
.Cm 3
is not guaranteed to work for all platforms, compilers or compilation
options,
and might even crash your program.
Use
.Em only
for debugging purposes.

View file

@ -1,4 +1,4 @@
/* $OpenBSD: malloc.c,v 1.286 2023/06/07 12:56:22 aoyama Exp $ */ /* $OpenBSD: malloc.c,v 1.287 2023/06/22 11:04:16 otto Exp $ */
/* /*
* Copyright (c) 2008, 2010, 2011, 2016, 2023 Otto Moerbeek <otto@drijf.net> * Copyright (c) 2008, 2010, 2011, 2016, 2023 Otto Moerbeek <otto@drijf.net>
* Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
@ -255,7 +255,11 @@ void malloc_dump(void);
PROTO_NORMAL(malloc_dump); PROTO_NORMAL(malloc_dump);
static void malloc_exit(void); static void malloc_exit(void);
#endif #endif
#define CALLER (DO_STATS ? __builtin_return_address(0) : NULL) #define CALLER ( \
DO_STATS == 0 ? NULL : (__builtin_extract_return_addr( \
DO_STATS == 1 ? __builtin_return_address(0) : \
DO_STATS == 2 ? __builtin_return_address(1) : \
DO_STATS == 3 ? __builtin_return_address(2) : NULL)))
/* low bits of r->p determine size: 0 means >= page size and r->size holding /* low bits of r->p determine size: 0 means >= page size and r->size holding
* real size, otherwise low bits is the bucket + 1 * real size, otherwise low bits is the bucket + 1
@ -365,8 +369,15 @@ omalloc_parseopt(char opt)
mopts.malloc_stats = 0; mopts.malloc_stats = 0;
break; break;
case 'D': case 'D':
case '1':
mopts.malloc_stats = 1; mopts.malloc_stats = 1;
break; break;
case '2':
mopts.malloc_stats = 2;
break;
case '3':
mopts.malloc_stats = 3;
break;
#endif /* MALLOC_STATS */ #endif /* MALLOC_STATS */
case 'f': case 'f':
mopts.malloc_freecheck = 0; mopts.malloc_freecheck = 0;

View file

@ -1,10 +1,8 @@
# $OpenBSD: Makefile,v 1.3 2022/09/21 15:24:45 tb Exp $ # $OpenBSD: Makefile,v 1.4 2023/06/22 19:23:27 tb Exp $
TESTS = \ TESTS = \
symbols symbols
PROG = ${TESTS}
REGRESS_TARGETS= all_tests REGRESS_TARGETS= all_tests
.include <bsd.own.mk> # for BSDSRCDIR .include <bsd.own.mk> # for BSDSRCDIR
@ -29,10 +27,10 @@ CFLAGS+= -Wno-deprecated-declarations
CLEANFILES+= include_headers.c symbols.c symbols.c.tmp CLEANFILES+= include_headers.c symbols.c symbols.c.tmp
symbols.c: symbols.awk ../../../../lib/libcrypto/Symbols.list symbols.c: symbols.awk ../../../../lib/libcrypto/Symbols.list
make -f ${.CURDIR}/Makefile include_headers.c make -f ${.CURDIR}/Makefile include_headers.c; \
awk -f ${.CURDIR}/symbols.awk \ awk -f ${.CURDIR}/symbols.awk \
< ${BSDSRCDIR}/lib/libcrypto/Symbols.list > symbols.c.tmp < ${BSDSRCDIR}/lib/libcrypto/Symbols.list > $@.tmp; \
mv symbols.c.tmp symbols.c mv -f $@.tmp $@
all_tests: ${TESTS} all_tests: ${TESTS}
@for test in $>; do \ @for test in $>; do \

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: aplsmc.4,v 1.2 2022/01/10 21:16:44 jmc Exp $ .\" $OpenBSD: aplsmc.4,v 1.3 2023/06/22 15:29:05 tobhe Exp $
.\" .\"
.\" Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org> .\" Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org>
.\" .\"
@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" .\"
.Dd $Mdocdate: January 10 2022 $ .Dd $Mdocdate: June 22 2023 $
.Dt APLSMC 4 arm64 .Dt APLSMC 4 arm64
.Os .Os
.Sh NAME .Sh NAME
@ -28,7 +28,7 @@ The
driver provides support for the System Management Controller (SMC) driver provides support for the System Management Controller (SMC)
found on various Apple SoCs. found on various Apple SoCs.
The driver provides a collection of current, fan, power, temperature, The driver provides a collection of current, fan, power, temperature,
voltage and battery information sensors. voltage, lid position and battery information sensors.
.Pp .Pp
Sensor values are made available through the Sensor values are made available through the
.Xr sysctl 8 .Xr sysctl 8

View file

@ -1,4 +1,4 @@
/* $OpenBSD: apm.c,v 1.130 2023/02/10 14:34:16 visa Exp $ */ /* $OpenBSD: apm.c,v 1.131 2023/06/22 13:18:02 claudio Exp $ */
/*- /*-
* Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved. * Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved.
@ -907,7 +907,7 @@ apm_thread(void *v)
rw_enter_write(&sc->sc_lock); rw_enter_write(&sc->sc_lock);
(void) apm_periodic_check(sc); (void) apm_periodic_check(sc);
rw_exit_write(&sc->sc_lock); rw_exit_write(&sc->sc_lock);
tsleep_nsec(&lbolt, PWAIT, "apmev", INFSLP); tsleep_nsec(&nowake, PWAIT, "apmev", SEC_TO_NSEC(1));
} }
} }

View file

@ -1214,7 +1214,6 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev,
const struct drm_mode_config_funcs amdgpu_mode_funcs = { const struct drm_mode_config_funcs amdgpu_mode_funcs = {
.fb_create = amdgpu_display_user_framebuffer_create, .fb_create = amdgpu_display_user_framebuffer_create,
.output_poll_changed = drm_fb_helper_output_poll_changed,
}; };
static const struct drm_prop_enum_list amdgpu_underscan_enum_list[] = static const struct drm_prop_enum_list amdgpu_underscan_enum_list[] =

View file

@ -1605,6 +1605,7 @@ static const u16 amdgpu_unsupported_pciidlist[] = {
0x5874, 0x5874,
0x5940, 0x5940,
0x5941, 0x5941,
0x5b70,
0x5b72, 0x5b72,
0x5b73, 0x5b73,
0x5b74, 0x5b74,

View file

@ -3570,6 +3570,9 @@ static ssize_t amdgpu_psp_vbflash_read(struct file *filp, struct kobject *kobj,
void *fw_pri_cpu_addr; void *fw_pri_cpu_addr;
int ret; int ret;
if (adev->psp.vbflash_image_size == 0)
return -EINVAL;
dev_info(adev->dev, "VBIOS flash to PSP started"); dev_info(adev->dev, "VBIOS flash to PSP started");
ret = amdgpu_bo_create_kernel(adev, adev->psp.vbflash_image_size, ret = amdgpu_bo_create_kernel(adev, adev->psp.vbflash_image_size,
@ -3623,14 +3626,14 @@ static ssize_t amdgpu_psp_vbflash_status(struct device *dev,
#ifdef notyet #ifdef notyet
static const struct bin_attribute psp_vbflash_bin_attr = { static const struct bin_attribute psp_vbflash_bin_attr = {
.attr = {.name = "psp_vbflash", .mode = 0664}, .attr = {.name = "psp_vbflash", .mode = 0660},
.size = 0, .size = 0,
.write = amdgpu_psp_vbflash_write, .write = amdgpu_psp_vbflash_write,
.read = amdgpu_psp_vbflash_read, .read = amdgpu_psp_vbflash_read,
}; };
#endif #endif
static DEVICE_ATTR(psp_vbflash_status, 0444, amdgpu_psp_vbflash_status, NULL); static DEVICE_ATTR(psp_vbflash_status, 0440, amdgpu_psp_vbflash_status, NULL);
int amdgpu_psp_sysfs_init(struct amdgpu_device *adev) int amdgpu_psp_sysfs_init(struct amdgpu_device *adev)
{ {

View file

@ -6969,8 +6969,10 @@ static int gfx_v10_0_kiq_resume(struct amdgpu_device *adev)
return r; return r;
r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr); r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr);
if (unlikely(r != 0)) if (unlikely(r != 0)) {
amdgpu_bo_unreserve(ring->mqd_obj);
return r; return r;
}
gfx_v10_0_kiq_init_queue(ring); gfx_v10_0_kiq_init_queue(ring);
amdgpu_bo_kunmap(ring->mqd_obj); amdgpu_bo_kunmap(ring->mqd_obj);

View file

@ -3651,8 +3651,10 @@ static int gfx_v9_0_kiq_resume(struct amdgpu_device *adev)
return r; return r;
r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr); r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr);
if (unlikely(r != 0)) if (unlikely(r != 0)) {
amdgpu_bo_unreserve(ring->mqd_obj);
return r; return r;
}
gfx_v9_0_kiq_init_queue(ring); gfx_v9_0_kiq_init_queue(ring);
amdgpu_bo_kunmap(ring->mqd_obj); amdgpu_bo_kunmap(ring->mqd_obj);

View file

@ -117,7 +117,11 @@ static int vcn_v4_0_sw_init(void *handle)
if (adev->vcn.harvest_config & (1 << i)) if (adev->vcn.harvest_config & (1 << i))
continue; continue;
atomic_set(&adev->vcn.inst[i].sched_score, 0); /* Init instance 0 sched_score to 1, so it's scheduled after other instances */
if (i == 0)
atomic_set(&adev->vcn.inst[i].sched_score, 1);
else
atomic_set(&adev->vcn.inst[i].sched_score, 0);
/* VCN UNIFIED TRAP */ /* VCN UNIFIED TRAP */
r = amdgpu_irq_add_id(adev, amdgpu_ih_clientid_vcns[i], r = amdgpu_irq_add_id(adev, amdgpu_ih_clientid_vcns[i],

View file

@ -83,7 +83,6 @@
#include <drm/drm_atomic_uapi.h> #include <drm/drm_atomic_uapi.h>
#include <drm/drm_atomic_helper.h> #include <drm/drm_atomic_helper.h>
#include <drm/drm_blend.h> #include <drm/drm_blend.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_fourcc.h> #include <drm/drm_fourcc.h>
#include <drm/drm_edid.h> #include <drm/drm_edid.h>
#include <drm/drm_vblank.h> #include <drm/drm_vblank.h>
@ -2877,7 +2876,6 @@ const struct amdgpu_ip_block_version dm_ip_block =
static const struct drm_mode_config_funcs amdgpu_dm_mode_funcs = { static const struct drm_mode_config_funcs amdgpu_dm_mode_funcs = {
.fb_create = amdgpu_display_user_framebuffer_create, .fb_create = amdgpu_display_user_framebuffer_create,
.get_format_info = amd_get_format_info, .get_format_info = amd_get_format_info,
.output_poll_changed = drm_fb_helper_output_poll_changed,
.atomic_check = amdgpu_dm_atomic_check, .atomic_check = amdgpu_dm_atomic_check,
.atomic_commit = drm_atomic_helper_commit, .atomic_commit = drm_atomic_helper_commit,
}; };
@ -6944,7 +6942,13 @@ static int amdgpu_dm_connector_get_modes(struct drm_connector *connector)
drm_add_modes_noedid(connector, 640, 480); drm_add_modes_noedid(connector, 640, 480);
} else { } else {
amdgpu_dm_connector_ddc_get_modes(connector, edid); amdgpu_dm_connector_ddc_get_modes(connector, edid);
amdgpu_dm_connector_add_common_modes(encoder, connector); /* most eDP supports only timings from its edid,
* usually only detailed timings are available
* from eDP edid. timings which are not from edid
* may damage eDP
*/
if (connector->connector_type != DRM_MODE_CONNECTOR_eDP)
amdgpu_dm_connector_add_common_modes(encoder, connector);
amdgpu_dm_connector_add_freesync_modes(connector, edid); amdgpu_dm_connector_add_freesync_modes(connector, edid);
} }
amdgpu_dm_fbc_init(connector); amdgpu_dm_fbc_init(connector);

View file

@ -1677,10 +1677,39 @@ static int smu_v13_0_0_set_power_profile_mode(struct smu_context *smu,
} }
} }
/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ if (smu->power_profile_mode == PP_SMC_POWER_PROFILE_COMPUTE &&
workload_type = smu_cmn_to_asic_specific_index(smu, (((smu->adev->pdev->device == 0x744C) && (smu->adev->pdev->revision == 0xC8)) ||
((smu->adev->pdev->device == 0x744C) && (smu->adev->pdev->revision == 0xCC)))) {
ret = smu_cmn_update_table(smu,
SMU_TABLE_ACTIVITY_MONITOR_COEFF,
WORKLOAD_PPLIB_COMPUTE_BIT,
(void *)(&activity_monitor_external),
false);
if (ret) {
dev_err(smu->adev->dev, "[%s] Failed to get activity monitor!", __func__);
return ret;
}
ret = smu_cmn_update_table(smu,
SMU_TABLE_ACTIVITY_MONITOR_COEFF,
WORKLOAD_PPLIB_CUSTOM_BIT,
(void *)(&activity_monitor_external),
true);
if (ret) {
dev_err(smu->adev->dev, "[%s] Failed to set activity monitor!", __func__);
return ret;
}
workload_type = smu_cmn_to_asic_specific_index(smu,
CMN2ASIC_MAPPING_WORKLOAD,
PP_SMC_POWER_PROFILE_CUSTOM);
} else {
/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */
workload_type = smu_cmn_to_asic_specific_index(smu,
CMN2ASIC_MAPPING_WORKLOAD, CMN2ASIC_MAPPING_WORKLOAD,
smu->power_profile_mode); smu->power_profile_mode);
}
if (workload_type < 0) if (workload_type < 0)
return -EINVAL; return -EINVAL;

View file

@ -179,7 +179,7 @@ static const struct dmi_system_id orientation_data[] = {
}, { /* AYA NEO AIR */ }, { /* AYA NEO AIR */
.matches = { .matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYANEO"), DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYANEO"),
DMI_MATCH(DMI_BOARD_NAME, "AIR"), DMI_MATCH(DMI_PRODUCT_NAME, "AIR"),
}, },
.driver_data = (void *)&lcd1080x1920_leftside_up, .driver_data = (void *)&lcd1080x1920_leftside_up,
}, { /* AYA NEO NEXT */ }, { /* AYA NEO NEXT */

View file

@ -1,4 +1,4 @@
/* $OpenBSD: kern_clockintr.c,v 1.24 2023/06/18 23:19:01 cheloha Exp $ */ /* $OpenBSD: kern_clockintr.c,v 1.25 2023/06/22 16:23:50 cheloha Exp $ */
/* /*
* Copyright (c) 2003 Dale Rahn <drahn@openbsd.org> * Copyright (c) 2003 Dale Rahn <drahn@openbsd.org>
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org> * Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
@ -107,7 +107,7 @@ clockintr_init(u_int flags)
void void
clockintr_cpu_init(const struct intrclock *ic) clockintr_cpu_init(const struct intrclock *ic)
{ {
uint64_t multiplier = 0; uint64_t multiplier = 0, offset;
struct cpu_info *ci = curcpu(); struct cpu_info *ci = curcpu();
struct clockintr_queue *cq = &ci->ci_queue; struct clockintr_queue *cq = &ci->ci_queue;
int reset_cq_intrclock = 0; int reset_cq_intrclock = 0;
@ -170,8 +170,8 @@ clockintr_cpu_init(const struct intrclock *ic)
clockintr_advance(cq->cq_hardclock, hardclock_period); clockintr_advance(cq->cq_hardclock, hardclock_period);
} else { } else {
if (cq->cq_hardclock->cl_expiration == 0) { if (cq->cq_hardclock->cl_expiration == 0) {
clockintr_stagger(cq->cq_hardclock, hardclock_period, offset = hardclock_period / ncpus * multiplier;
multiplier, ncpus); cq->cq_hardclock->cl_expiration = offset;
} }
clockintr_advance(cq->cq_hardclock, hardclock_period); clockintr_advance(cq->cq_hardclock, hardclock_period);
} }
@ -179,16 +179,12 @@ clockintr_cpu_init(const struct intrclock *ic)
/* /*
* We can always advance the statclock and schedclock. * We can always advance the statclock and schedclock.
*/ */
if (cq->cq_statclock->cl_expiration == 0) { offset = statclock_avg / ncpus * multiplier;
clockintr_stagger(cq->cq_statclock, statclock_avg, multiplier, clockintr_schedule(cq->cq_statclock, offset);
ncpus);
}
clockintr_advance(cq->cq_statclock, statclock_avg); clockintr_advance(cq->cq_statclock, statclock_avg);
if (schedhz != 0) { if (schedhz != 0) {
if (cq->cq_schedclock->cl_expiration == 0) { offset = schedclock_period / ncpus * multiplier;
clockintr_stagger(cq->cq_schedclock, schedclock_period, clockintr_schedule(cq->cq_schedclock, offset);
multiplier, ncpus);
}
clockintr_advance(cq->cq_schedclock, schedclock_period); clockintr_advance(cq->cq_schedclock, schedclock_period);
} }

View file

@ -1,4 +1,4 @@
/* $OpenBSD: json.c,v 1.9 2023/06/05 16:24:05 claudio Exp $ */ /* $OpenBSD: json.c,v 1.10 2023/06/22 09:07:04 claudio Exp $ */
/* /*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org> * Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
@ -232,7 +232,7 @@ json_do_string(const char *name, const char *v)
eb = fprintf(jsonfh, "\"") < 0; eb = fprintf(jsonfh, "\"") < 0;
while ((c = *v++) != '\0' && !eb) { while ((c = *v++) != '\0' && !eb) {
/* skip escaping '/' since our use case does not require it */ /* skip escaping '/' since our use case does not require it */
switch(c) { switch (c) {
case '"': case '"':
eb = fprintf(jsonfh, "\\\"") < 0; eb = fprintf(jsonfh, "\\\"") < 0;
break; break;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: auth.c,v 1.12 2019/12/19 16:47:14 remi Exp $ */ /* $OpenBSD: auth.c,v 1.13 2023/06/22 10:38:27 claudio Exp $ */
/* /*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@ -21,6 +21,7 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <limits.h> #include <limits.h>
#include <md5.h> #include <md5.h>
#include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -236,14 +237,14 @@ auth_add_trailer(struct ibuf *buf, struct iface *iface)
MD5_CTX hash; MD5_CTX hash;
u_int8_t digest[MD5_DIGEST_LENGTH]; u_int8_t digest[MD5_DIGEST_LENGTH];
struct auth_md *md; struct auth_md *md;
struct md5_auth *a; size_t pos;
int pos;
pos = sizeof(struct rip_hdr) + sizeof(struct rip_auth); pos = sizeof(struct rip_hdr) + sizeof(struct rip_auth) +
offsetof(struct md5_auth, auth_offset);
/* add offset to header */ /* add offset to header */
a = ibuf_seek(buf, pos, sizeof(*a)); if (ibuf_set_n16(buf, pos, ibuf_size(buf)) == -1)
a->auth_offset = htons(buf->wpos); return (-1);
/* insert plaintext key */ /* insert plaintext key */
if ((md = md_list_find(&iface->auth_md_list, if ((md = md_list_find(&iface->auth_md_list,
@ -259,7 +260,7 @@ auth_add_trailer(struct ibuf *buf, struct iface *iface)
/* calculate MD5 digest */ /* calculate MD5 digest */
MD5Init(&hash); MD5Init(&hash);
MD5Update(&hash, buf->buf, buf->wpos); MD5Update(&hash, ibuf_data(buf), ibuf_size(buf));
MD5Update(&hash, digest, MD5_DIGEST_LENGTH); MD5Update(&hash, digest, MD5_DIGEST_LENGTH);
MD5Final(digest, &hash); MD5Final(digest, &hash);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: json.c,v 1.3 2023/06/05 14:19:13 claudio Exp $ */ /* $OpenBSD: json.c,v 1.4 2023/06/22 09:08:02 claudio Exp $ */
/* /*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org> * Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
@ -232,7 +232,7 @@ json_do_string(const char *name, const char *v)
eb = fprintf(jsonfh, "\"") < 0; eb = fprintf(jsonfh, "\"") < 0;
while ((c = *v++) != '\0' && !eb) { while ((c = *v++) != '\0' && !eb) {
/* skip escaping '/' since our use case does not require it */ /* skip escaping '/' since our use case does not require it */
switch(c) { switch (c) {
case '"': case '"':
eb = fprintf(jsonfh, "\\\"") < 0; eb = fprintf(jsonfh, "\\\"") < 0;
break; break;