xiaoxiang781216 commented on a change in pull request #1009: URL: https://github.com/apache/incubator-nuttx/pull/1009#discussion_r422494270
########## File path: arch/sim/src/sim/up_timer.c ########## @@ -0,0 +1,169 @@ +/**************************************************************************** + * arch/sim/src/sim/up_timer.c + * + * Copyright (C) 2014, 2019 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gn...@nuttx.org> + * Sebastian Ene <sebastian.en...@gmail.com> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <signal.h> +#include <stdio.h> +#include <stdlib.h> +#include <stdbool.h> +#include <string.h> +#include <stdint.h> +#include <stdarg.h> + +#include <sys/types.h> +#include <sys/time.h> +#include <sys/wait.h> + +#include "../../../../include/nuttx/config.h" + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +typedef void (*sched_timer_callback_t)(void); + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static sched_timer_callback_t g_sched_process_timer_cb; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: host_signal_handler + * + * Description: + * The signal handler is called periodically and is used to deliver TICK + * events to the OS. + * + ****************************************************************************/ +static void host_signal_handler(int sig, siginfo_t *si, void *old_ucontext) +{ + g_sched_process_timer_cb(); Review comment: Yes, I saw your patch which disable/enable signal in save/restore irq. That's why ask you reorg your patch set to ensure each patch work correctly. From my review, most patch need merge into three: 1.The alarm timer 2.ucontext 3.nsh3 config But I think item 2 doesn't need which just increase the complex and porting effort. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org