From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by mx.groups.io with SMTP id smtpd.web10.30784.1599599094482841099 for ; Tue, 08 Sep 2020 14:04:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@broadcom.com header.s=google header.b=OccnH+X8; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: broadcom.com, ip: 209.85.218.44, mailfrom: vladimir.olovyannikov@broadcom.com) Received: by mail-ej1-f44.google.com with SMTP id i22so412266eja.5 for ; Tue, 08 Sep 2020 14:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:references:in-reply-to:mime-version:thread-index:date :message-id:subject:to:cc; bh=9XRt+h6xUJ3y00t1WOIkULd+g4HIxUKwnpFGSP/CM4s=; b=OccnH+X8iYPPS5BrrfxaZET10+sApvsTntkoz/2x+F4R/TxJ8/DTQnZuFM0i8/mFQv xVCU0K0SLcIJYp5GHlP2d9sT8iycO1axB9G8dzSjuUlWAJlPhTW+9/hmkMuFbuxXu55E MYkr2GsSIhWA5VaAYNlUnnCgeqGxOfxoOinYc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc; bh=9XRt+h6xUJ3y00t1WOIkULd+g4HIxUKwnpFGSP/CM4s=; b=QB38HU9afYmJiOtHDKY76zhNSCmbiWMWuEKT6d5eY1YOU489UBc/CaRh+Z21jgBNwB 6hFOFHv0RcZE3N1y9ZPUyzQL6nk0tJart+P0ZzMqSrmaaLIyB3vDTrPGGtUle+tqmbBk KSY1GDmHoKiaj0n3Xagb5Mq5IIpZxwKFup0mTGShDkxCuSGQRtzd6dzS4k7u8uXt+OXp b8FzSNNupeFP9khlp/4emV9hyRo+CZD7IQkQmqG9FlmAlRYuIIxFEgvyU5CyDWMijLJ4 56HSDfxO+YijsPyJZQW2C2KKTTDT84GSA7Z2/g4Tu+Z6TjgWUJrrLvWwF/uj3mDSfFmC oRfg== X-Gm-Message-State: AOAM5321RRDZqa4zeBT79yzM3MG1akpjhZ2z5eI5dI8F5KoxsRDqruQx MLnABhcai2AtFhQT12RoTYkFujSvOb//CIZ8mostxg== X-Google-Smtp-Source: ABdhPJw8UpGFrtPLR6A31uGlT0SuEP/qYUM2NHFQpGgJ54+iz7zDQ8lBFeAsikb+ZzIs/hTAiA4iC9sub+2l/pxU0Y0= X-Received: by 2002:a17:906:7cc6:: with SMTP id h6mr376973ejp.266.1599599092786; Tue, 08 Sep 2020 14:04:52 -0700 (PDT) From: "Vladimir Olovyannikov" References: <20200902040821.24144-1-vladimir.olovyannikov@broadcom.com> <20200902040821.24144-2-vladimir.olovyannikov@broadcom.com> <30fc1fc2-858f-f0e8-e54f-58b872ad57ae@linux.intel.com> <30233c17-c081-deb6-d0cb-d847c7a9992b@redhat.com> <20ac79e77049e8756de36f50df1e7f36@mail.gmail.com> <8aa008fc-ed91-5118-df37-b24f2eb86c2f@redhat.com> In-Reply-To: <8aa008fc-ed91-5118-df37-b24f2eb86c2f@redhat.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIFbDYdE26JdBaZ6E2uQjXRYlN7OAJms9k1ApTVQKkBz5NrEgHQuk54Am5nf8KoqMQZ0A== Date: Tue, 8 Sep 2020 14:04:54 -0700 Message-ID: Subject: Re: [PATCH v10 1/1] ShellPkg/DynamicCommand: add HttpDynamicCommand To: Laszlo Ersek , "Rabeda, Maciej" , devel@edk2.groups.io, Zhichao Gao , Ray Ni Cc: Samer El-Haj-Mahmoud , Jiaxin Wu , Siyuan Fu , Liming Gao , Nd Content-Type: text/plain; charset="UTF-8" > -----Original Message----- > From: Laszlo Ersek > Sent: Monday, September 7, 2020 2:37 AM > To: Vladimir Olovyannikov ; > Rabeda, Maciej ; devel@edk2.groups.io; > Zhichao Gao ; Ray Ni > Cc: Samer El-Haj-Mahmoud ; Jiaxin Wu > ; Siyuan Fu ; Liming Gao > ; Nd > Subject: Re: [PATCH v10 1/1] ShellPkg/DynamicCommand: add > HttpDynamicCommand > > On 09/04/20 19:55, Vladimir Olovyannikov wrote: > > > There is also another issue with the TimebaseLib: inconsistency in > > return values of the EfiTimeToEpoch (returns UINT32, should return > > UINTN, as Zhichao pointed out earlier in the previous > > HttpDynamicCommand patchset). > > If this one is fixed, I can just use the TimeBaseLib.h header for > > constants. > > Consuming TimeBaseLib.h in this patch would be really nice. OK, if this can be fixed, I will definitely use TimeBaseLib.h header for constants, and will drop duplicate definitions in Http.c/Http.h > > There are two EfiTimeToEpoch() call sites in edk2: > > ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c > EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c > > The latter stores the return value in a UINTN variable, so that seems OK. > The > former is a bit messier, but it seems to ensure that the result fits in 32 > bits for > HW reasons anyway: > > // Because the PL031 is a 32-bit counter counting seconds, > // the maximum time span is just over 136 years. > // Time is stored in Unix Epoch format, so it starts in 1970, > // Therefore it can not exceed the year 2106. > if ((Time->Year < 1970) || (Time->Year >= 2106)) { > return EFI_UNSUPPORTED; > } > ... > EpochSeconds = EfiTimeToEpoch (Time); > ... > MmioWrite32 (mPL031RtcBase + PL031_RTC_LR_LOAD_REGISTER, > EpochSeconds); > > So I think we'd need two patches: > > (1) add an explicit (UINT32) cast to the EfiTimeToEpoch() call in > "ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c", > > (2) change the return value to UINTN in > "EmbeddedPkg/Include/Library/TimeBaseLib.h" and > "EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.c". > > Hmm wait... There are five more call sites in edk2-platforms. :( OK, I > give up > here. Sorry. OK, so what are the next steps, what do you suggest? I saw today that unused macros like SEC_PER_MONTH, etc. were removed from TimeBaseLib.h. Thank you, Vladimir > > Laszlo