From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mx.groups.io with SMTP id smtpd.web11.13136.1676733306493112573 for ; Sat, 18 Feb 2023 07:15:06 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QckjiGUY; spf=pass (domain: gmail.com, ip: 209.85.214.178, mailfrom: pedro.falcato@gmail.com) Received: by mail-pl1-f178.google.com with SMTP id e14so2196745plg.8 for ; Sat, 18 Feb 2023 07:15:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KqqloUbebdq3phYownisEJla+d3ZP5DNCa0+PAJH8mQ=; b=QckjiGUYPe26bn1lkdPn3PggvDlQUyhGE8ave67Y9ZYQ97F7jAP4jmYEZvDJQRyf5A 0fAR0rwIiZcKDX3VsZ9SI+8OMpJNSmUB/egdpOIWwLdJnOcWWBSjnQbQRSQYXFb0Ad3x 0bgEs4Y7gLnXs2zEBUrzqIu21vWIyavXB4vzOpMvd9/sIVUQeQQMPmHQNDdiwoEm6hfh n1KU5Zayu8M+QJHDR2lJIhr8bUCScwXqONnv6mRhUmWNdBKdY/jxz/swSBhfiEw60QGr WsvDXt06Lv2Il7mPkL7xtxnf0Zjuc0HYhv7qU+Hmu8H8HBU/MBvc69SGI723zLhsp+gC izhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KqqloUbebdq3phYownisEJla+d3ZP5DNCa0+PAJH8mQ=; b=awAwjjrihNASssr0ZkE5WIj0smXhUHuMqTqh+SRQMqlz08xls5kUWr9w34cBIsSD7D /cNGk/pPCSZymwxsYnRjkr85GWA+ZlHujnhWZ6v1nAbGm4z6T3qykSWiL1aecN+xRhq/ YhBfROuza58LDWJSbHVmDoA4hRzzekhLxaZvC0Y/sZJRXpDoHhDAmxmleZV5MbhHiUFf 3aa7LSBBAaRB3ffDE+B7298T11q+iiFDI7CndbhLFkXoThxqKs6dxuQlYBm29BwqnUdk U/KwgphoI7Lg7DPyGA0CprkFqiSORgAOiR52uzKx9+jhGuXcFgjsKvLn2JTrtimlhC1U Iy2Q== X-Gm-Message-State: AO0yUKVfZ46SmUjOXoqnVdgp2zrB9HjuQClZz9Z1eYHydEmI51osNDYS p9Sh21I7vtUOlHrBrYuH/BU9ZX3qBhdyu7GRyD0= X-Google-Smtp-Source: AK7set/J051PYq51WBQfiIgukpf4buvF4XbtsmblrNqM0ErRGNL5KjER+wApM5N9aVKK1C+K2Os1pw6Id2WezJo/fg4= X-Received: by 2002:a17:90b:3a8f:b0:234:117c:970f with SMTP id om15-20020a17090b3a8f00b00234117c970fmr2286108pjb.28.1676733305782; Sat, 18 Feb 2023 07:15:05 -0800 (PST) MIME-Version: 1.0 References: <20230217201427.139581-1-pedro.falcato@gmail.com> In-Reply-To: From: "Pedro Falcato" Date: Sat, 18 Feb 2023 15:14:54 +0000 Message-ID: Subject: Re: [PATCH 1/1] Ext4Pkg: Move unicode collation initialization to Start() To: =?UTF-8?Q?Marvin_H=C3=A4user?= Cc: edk2-devel-groups-io , Ard Biesheuvel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Feb 18, 2023 at 12:31 PM Marvin H=C3=A4user wr= ote: > > > > On 17. Feb 2023, at 21:14, Pedro Falcato wrot= e: > > > > @@ -169,5 +170,20 @@ Ext4StrCmpInsensitive ( > > IN CHAR16 *Str2 > > ) > > { > > + ASSERT (gUnicodeCollationInterface !=3D NULL); > > return gUnicodeCollationInterface->StriColl (gUnicodeCollationInterfa= ce, Str1, Str2); > > } > > Off-topic (should merge either way), but is there a reason such a functio= n is not in BaseLib? > @Ard Do you happen to know? Proper collation (and proper unicode handling in general) is AIUI pretty hard and involves a lot of tables, etc. So it makes total sense to me why one wants to "dynamically link" this in using protocols instead of statically linking it everywhere. Should be noted that EnglishDxe makes a mockery out of unicode collation and does plain ASCII operations only :)) > > /** > > @@ -761,6 +753,19 @@ Ext4Bind ( > > BlockIo =3D NULL; > > DiskIo =3D NULL; > > > > + // Note: We initialize collation here since this is called in BDS, w= hen we are likely > > + // to have the Unicode Collation protocols available. > > + if (!Ext4IsCollationInitialized ()) { > > Why do we need to expose this? I.e., why can't this be an internal decisi= on of Ext4InitialiseUnicodeCollation()? > > > + Status =3D Ext4InitialiseUnicodeCollation (BindingProtocol->ImageH= andle); > I did think about that, but then decided against it since I felt that initializing multiple times would make little logical sense. --=20 Pedro